Skip to content
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

Merged
merged 93 commits into from
Oct 17, 2024
Merged

Feature osc class magic #161

merged 93 commits into from
Oct 17, 2024

Conversation

EdAtkin
Copy link
Contributor

@EdAtkin EdAtkin commented Oct 10, 2024

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

EdAtkin and others added 30 commits June 7, 2024 13:58
@KSkwarczynski KSkwarczynski marked this pull request as ready for review October 11, 2024 17:04
@github-actions github-actions bot added the GPU label Oct 16, 2024
CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
README.md Show resolved Hide resolved
cmake/Modules/NuOscillatorSetup.cmake Show resolved Hide resolved
cmake/Templates/MaCh3Config.cmake.in Show resolved Hide resolved
samplePDF/samplePDFFDBase.h Show resolved Hide resolved
#pragma omp parallel for
#endif
for(int i=0; i<splineKnots; i++){
for(int i = 0; i < splineKnots; i++){

if(tmpXCoeffArr[i]==-999){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard coded magic numbers

Copy link
Contributor Author

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());
Copy link
Contributor

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()));

Copy link
Contributor Author

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");
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic numbers

Copy link
Contributor Author

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.

@dbarrow257 dbarrow257 merged commit f2234ed into develop Oct 17, 2024
10 of 11 checks passed
@dbarrow257 dbarrow257 deleted the feature_OscClassMagic branch October 17, 2024 15:50
@KSkwarczynski KSkwarczynski mentioned this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmake GPU Nu Osc/Xsec Related with neutrino interactions or oscialtions Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dum* passing of Xsec in sample FD cosntructor Fixed baseline and densitiy in cudaprob
4 participants