-
Notifications
You must be signed in to change notification settings - Fork 35
Bugfix for FluxWeight and MeVPrtl #621
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -224,7 +224,7 @@ namespace sbn { | |||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| //or do the above 3 lines in one line | ||||||||||||||||||||||
| // auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel); | ||||||||||||||||||||||
| auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // If no neutrinos in this event, gives 0 weight; | ||||||||||||||||||||||
| int NUni = fParameterSet.fNuniverses; | ||||||||||||||||||||||
|
|
@@ -264,8 +264,8 @@ namespace sbn { | |||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Collect neutrino energy; mclist is replaced with fluxlist. | ||||||||||||||||||||||
| // double enu= mclist[inu].GetNeutrino().Nu().E(); | ||||||||||||||||||||||
| double enu= fluxlist[inu].fnenergyn; | ||||||||||||||||||||||
| if ( enu == -1 ) enu= mclist[inu].GetNeutrino().Nu().E(); //For MeVPrtl generator, not all MCFlux result in a neutrino, so equivalent neutrino energy is computed and saved as MCTruth | ||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If MCFlux does not contain a neutrino, it seems unnecessary to add a fake neutrino energy different from -1. I think it is safer to keep neutrino energy = -1 and handle the exception downstream.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The flux SBND weight module needs the neutrino energy to compute the systematic, see line: https://github.com/SBNSoftware/sbncode/blob/develop/sbncode/SBNEventWeight/Calculators/BNBFlux/FluxCalcPrep.cxx#L276 The equivalent neutrino energy is computed by MeVPrtl here: sbncode/sbncode/EventGenerator/MeVPrtl/Tools/IMeVPrtlFlux.h Lines 127 to 136 in 8b07405
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the time being, the flux module would seg fault when the neutrino energy is missing or -1. So this fix is neccessary for at least the flux module to work with MeVPrtl inputs. See @grayputnam 's comments from a while ago: https://github.com/SBNSoftware/sbncode/blob/develop/sbncode/EventGenerator/MeVPrtl/MeVPrtlGen_module.cc#L363-L371 |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| //Let's make a weights based on the calculator you have requested | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
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.
If this line is only uncommented for the neutrino energy fix when MCFlux does not have a neutrino, I would move it to a block under
if ( enu == -1 ). However, see my other comment about not fixing the energy in that case.Uh oh!
There was an error while loading. Please reload this page.
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.
There are several lines after this where mclist was commented out. So I'd like to keep at the same line for bookkeeping sake.