Skip to content

Commit 546ecf4

Browse files
authored
Merge pull request #621 from SBNSoftware/bugfix/fluxweight_for_mevprtl
Bugfix for FluxWeight and MeVPrtl
2 parents 8b07405 + 775e7f1 commit 546ecf4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

sbncode/EventGenerator/MeVPrtl/Tools/BNBKaonGen_tool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ simb::MCFlux BNBKaonGen::MakeMCFlux(const bsim::BooNe &boone) {
311311
<< std::endl;
312312
}
313313

314-
flux.fFluxType = simb::kDk2Nu;
314+
flux.fFluxType = simb::kNtuple;
315315
flux.fnimpwt = fBooneNtp.beamwgt;
316316
flux.fvx = fBooneNtp.ini_pos[0][0]; //0
317317
flux.fvy = fBooneNtp.ini_pos[0][1]; //0

sbncode/SBNEventWeight/Calculators/BNBFlux/FluxCalcPrep.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ namespace sbn {
224224
}
225225

226226
//or do the above 3 lines in one line
227-
// auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel);
227+
auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel);
228228

229229
// If no neutrinos in this event, gives 0 weight;
230230
int NUni = fParameterSet.fNuniverses;
@@ -264,8 +264,8 @@ namespace sbn {
264264
}
265265

266266
// Collect neutrino energy; mclist is replaced with fluxlist.
267-
// double enu= mclist[inu].GetNeutrino().Nu().E();
268267
double enu= fluxlist[inu].fnenergyn;
268+
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
269269

270270
//Let's make a weights based on the calculator you have requested
271271

0 commit comments

Comments
 (0)