-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature osc class magic #161
Conversation
…class for low memory structs
…file name to base object
…on taken from manager
…correct forward declared function signature
…how shifts and weights are applied
…FFDBase::SetupNuOscillator
…h3 into feature_OscClassMagic Latest changes from Dan
#pragma omp parallel for | ||
#endif | ||
for(int i=0; i<splineKnots; i++){ | ||
for(int i = 0; i < splineKnots; i++){ | ||
|
||
if(tmpXCoeffArr[i]==-999){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard coded magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these checks on -999 don't actually make any sense so I'll remove them. The spline coefficients are initialised to -999 here: https://github.com/mach3-software/MaCh3/blob/develop/splines/splineFDBase.cpp#L767
But then we immediately call GetCoef() where if the there is some failure here we would not get -999 out. So I have removed this check.
@@ -394,13 +395,13 @@ std::vector<TAxis *> splineFDBase::FindSplineBinning(std::string FileName, std:: | |||
TFile *File = new TFile(FileName.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best to do something like:
auto File = std::unique_ptr<TFile>(TFile::Open(Filename.c_str()));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree!
@@ -414,9 +415,8 @@ std::vector<TAxis *> splineFDBase::FindSplineBinning(std::string FileName, std:: | |||
Obj = File->Get("dev_tmp.0.0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can use typed TFile::Get<T>
@@ -683,7 +682,7 @@ void splineFDBase::PrepForReweight() | |||
UniqueSystSplines[iSpline]->GetKnot(iKnot, xPoint, yPoint); | |||
if (xPoint == -999 || yPoint == -999) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another case where this won't actually do anything since if GetKnot fails it won't just return -999.
…ointerToKinematicParameter as it's more accurate
…h3 into feature_OscClassMagic Latest changes from origin
Pull request description
Contains both samplePDFFD clean up changes and uses the NuOscillator class for oscillation calculation.
Changes or fixes
Moves a lot of the samplePDFFD constructor into core which simplifies setting up a derived class.
Removed of a lot of the boiler plate for oscillation weights and calculations since this is now done in NuOscillator.
Examples