MakeGENIEReweightTable_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Use NuReweight to compute +/-1,2sigma shifts for all systematics
3 /// \author Christopher Backhouse - bckhouse@caltech.edu
4 ////////////////////////////////////////////////////////////////////////
5 
6 // GENIE: Macros in here conflict with art's MessageFacility. So include it
7 // first and then unset them again
8 #include "GENIE/Framework/Messenger/Messenger.h"
9 #undef MF_LOG_INFO
10 #undef MF_LOG_DEBUG
11 #undef MF_LOG_ERROR
12 
13 #include <cassert>
14 #include <ctime>
15 #include <iomanip>
16 #include <memory>
17 #include <string>
18 #include <unordered_set>
19 
20 #include "TH1D.h"
21 
27 #include "art_root_io/TFileService.h"
28 #include "cetlib_except/exception.h"
29 #include "fhiclcpp/ParameterSet.h"
31 
32 #include "Geometry/Geometry.h"
34 #include "nugen/EventGeneratorBase/GENIE/GENIE2ART.h"
35 #include "nugen/NuReweight/art/NuReweight.h"
40 #include "Utilities/AssociationUtil.h"
41 
42 #include "GENIE/RwFramework/GReWeight.h"
43 
44 namespace rwgt
45 {
46  // It's a shame such a thing isn't officially defined in any of the headers
47  const int kMaxReweightIdx = rwgt::fReweightAxFFCCQEshape;
48 
49  /// \brief Use NuReweight to compute +/-1,2sigma shifts for all systematics
51  {
52  public:
53  explicit MakeGENIEReweightTable(const fhicl::ParameterSet& pset);
54  virtual ~MakeGENIEReweightTable();
55 
56  void produce(art::Event& evt) override;
57  void beginJob() override;
58  void endJob() override;
59 
60  private:
63 
64  bool fConsiderNDRock; ///< Include rock interaction in the ND?
65  bool fConsiderFDRock; ///< Include rock interaction in the FD?
66 
67  bool fTimeKnobs; ///< Keep tabs on the reweight knobs & measure the time they take?
68 
70 
71  std::vector<std::string> fKnobNamesToSkip;
72  // organized by tune name
73  std::unordered_map<std::string, std::unordered_set<rwgt::ReweightLabel_t, std::hash<int>>> fKnobsToSkip;
74 
75  std::vector<rwgt::NuReweight*> fRWsMinus2;
76  std::vector<rwgt::NuReweight*> fRWsMinus1;
77  std::vector<rwgt::NuReweight*> fRWsPlus1;
78  std::vector<rwgt::NuReweight*> fRWsPlus2;
79 
80  std::map<rwgt::ReweightLabel_t, TH1D*> fKnobTimes;
82  };
83 
84  //___________________________________________________________________________
86  : EDProducer(pset),
87  fGeneratorToken(consumes<std::vector<simb::MCTruth>>(pset.get<std::string>("GeneratorLabel"))),
88  fGeneratorLabel(pset.get<std::string>("GeneratorLabel")),
89  fConsiderNDRock(pset.get<bool>("ConsiderNDRock")),
90  fConsiderFDRock(pset.get<bool>("ConsiderFDRock")),
91  fTimeKnobs(pset.get<bool>("TimeKnobs")),
92  fSkipCCQEWgtsForHyperons(pset.get<bool>("SkipCCQEWgtsForHyperons"))
93 // fKnobNamesToSkip(pset.get<std::unordered_map<std::string, std::vector<std::string>>>("KnobsToSkip"))
94  {
95  produces<std::vector<rwgt::GENIEReweightTable>>();
96 
97  produces<art::Assns<rwgt::GENIEReweightTable, simb::MCTruth>>();
98 
99  mf::LogInfo("MakeGENIEReweightTable") << "Skipping the following reweight knobs:";
100  auto knobsToSkipLists = pset.get<fhicl::ParameterSet>("KnobsToSkip");
101  if (!knobsToSkipLists.has_key("default"))
102  {
103  mf::LogWarning("MakeGENIEReweightTable") << "No 'default' key in KnobsToSkip table. Assuming empty list...";
104  fKnobsToSkip["default"]; // default-initializes...
105  }
106  for (const auto & knobListKey : knobsToSkipLists.get_names())
107  {
108  mf::LogInfo("MakeGENIEReweightTable") << " for tune '" << knobListKey << "'" << std::endl;
109  for (const auto &knobName : knobsToSkipLists.get<std::vector<std::string>>(knobListKey))
110  {
112  throw cet::exception("MakeGENIEReweightTable",
113  "Unknown GENIE reweight knob name: " + knobName);
114 
115  this->fKnobsToSkip[knobListKey].insert(rwgt::REWEIGHT_KNOB_INDICES.at(knobName));
116  mf::LogInfo("MakeGENIEReweightTable")
117  << " " << knobName
118  << " (index: " << rwgt::REWEIGHT_KNOB_INDICES.at(knobName) << ")";
119  }
120  }
121  }
122 
123  //___________________________________________________________________________
125  {
126  for(rwgt::NuReweight* rw: fRWsMinus2) delete rw;
127  for(rwgt::NuReweight* rw: fRWsMinus1) delete rw;
128  for(rwgt::NuReweight* rw: fRWsPlus1) delete rw;
129  for(rwgt::NuReweight* rw: fRWsPlus2) delete rw;
130  }
131 
132  //___________________________________________________________________________
134  {
135  mf::LogInfo("MakeGENIEReweightTable") << "Initializing GENIE reweight calculators...";
136 
137  // for GENIE 3, need to set the tune before you do anything.
138  // (this function is a no-op for GENIE 2 so it's safe anyway.)
139  // note that this sets the tune to the one that the genie_xsec UPS product
140  // is configured to load. 99.9999% of the time that's the one you want,
141  // but if you're trying to create reweights for MC that was generated
142  // in a different release than the one you're using,
143  // you may need to add some FCL handles to pass options to this function.
144  evgb::SetEventGeneratorListAndTune();
145 
146  // Don't need to see every tiny thing these modules are thinking...
148  log4cpp::Priority::WARN);
150  log4cpp::Priority::WARN);
152  log4cpp::Priority::WARN);
153 
154  // The way NuReweight constructs the EventRecord it inevitably trips this
157 
158  genie::Messenger::Instance()->SetPriorityLevel("GENIEReweight",
159  log4cpp::Priority::WARN);
160 
161  fRWsMinus2.resize(kMaxReweightIdx+1, 0);
162  fRWsMinus1.resize(kMaxReweightIdx+1, 0);
163  fRWsPlus1. resize(kMaxReweightIdx+1, 0);
164  fRWsPlus2. resize(kMaxReweightIdx+1, 0);
165 
166  // Start at 1. Zero is kReweightNull. Not worth dealing with shifting all
167  // the indices by one everywhere, just leave it empty.
168  for(int i = 1; i <= kMaxReweightIdx; ++i){
169  for(int sigma: {-2, -1, +1, +2}){
170  rwgt::NuReweight* rw = new rwgt::NuReweight;
171 
172  switch(sigma){
173  case -2: fRWsMinus2[i] = rw; break;
174  case -1: fRWsMinus1[i] = rw; break;
175  case +1: fRWsPlus1 [i] = rw; break;
176  case +2: fRWsPlus2 [i] = rw; break;
177  }
178  double shift = sigma;
179 
180  //Catch the cases where shape parameters are called instead of rate parameters.
181  switch(i) {
182  case rwgt::fReweightNormCCQE:
183  case rwgt::fReweightNormCCQEenu:
184  case rwgt::fReweightMaCCQEshape:
185  rw->MaQEshape();
186  break;
187 
188  case rwgt::fReweightNormCCRES:
189  case rwgt::fReweightMaCCRESshape:
190  case rwgt::fReweightMvCCRESshape:
191  rw->CCRESshape();
192  break;
193 
194  case rwgt::fReweightNormNCRES:
195  case rwgt::fReweightMaNCRESshape:
196  case rwgt::fReweightMvNCRESshape:
197  rw->NCRESshape();
198  break;
199 
200  case rwgt::fReweightAhtBYshape:
201  case rwgt::fReweightBhtBYshape:
202  case rwgt::fReweightCV1uBYshape:
203  case rwgt::fReweightCV2uBYshape:
204  rw->DIS_BYshape();
205  break;
206 
207  case rwgt::fReweightCCQEMomDistroFGtoSF:
208  case rwgt::fReweightTheta_Delta2Npi:
209  // These are continuous knobs.
210  // Encode -2sigma = .25, -1sigma = .5, +1sigma = .75, +2sigma = 1
211  shift = (shift < 0) ? (shift+3.0)/4.0 : (shift + 2)/4.0;
212  break;
213 
214  case rwgt::fReweightRnubarnuCC:
215 // case rwgt::fReweightDISNuclMod: // disabled in GENIE v3. may return later?
216  // These are binary switches. Make the negative sigmas be "off" and
217  // the positive be "on".
218  shift = (shift < 0) ? 0 : 1;
219  break;
220  }
221 
222  rw->AddReweightValue(rwgt::ReweightLabel_t(i), shift);
223  rw->Configure();
224  }
225  }
226 
227  mf::LogInfo("MakeGENIEReweightTable") << "Done initializing GENIE reweight calculators...";
228 
229  }
230  //___________________________________________________________________________
232  {
233  if (!fTimeKnobs)
234  return;
235 
236  std::cout << "Statistics regarding time spent in each reweight knob:" << std::endl;
237  std::cout << "knob # | total time (s) | mean time (s) | median time (s)" << std::endl;
238  std::cout << "---------------------------------------------------------" << std::endl;
239 
240  for (auto & knobTimePair : this->fKnobTimes)
241  {
242  std::cout << std::setw(7) << knobTimePair.first << "|";
243  TH1D * knobHist = knobTimePair.second;
244 
245  double sum = 0;
246  for (int bin = 1; bin < knobHist->GetNbinsX()+1; bin++)
247  sum += pow(10, knobHist->GetBinCenter(bin)) * knobHist->GetBinContent(bin);
248  std::cout << std::setw(16) << sum << "|";
249 
250  std::cout << std::setw(15);
251  if (knobHist->GetEntries() > 0)
252  std::cout << pow(10, knobHist->GetMean());
253  else
254  std::cout << "-";
255  std::cout << "|";
256 
257  std::cout << std::setw(16);
258  int n = knobHist->GetXaxis()->GetNbins();
259  std::vector<double> x(n);
260  knobHist->GetXaxis()->GetCenter( &x[0] );
261  const double * y = knobHist->GetArray();
262  std::cout << pow(10, TMath::Median(n, &x[0], &y[1]));
263 
264  std::cout << std::endl;
265  }
266  }
267 
268  //___________________________________________________________________________
270  {
272 
273  std::unique_ptr<std::vector<rwgt::GENIEReweightTable>> tablecol(new std::vector<rwgt::GENIEReweightTable>);
274 
275  std::unique_ptr<art::Assns<rwgt::GENIEReweightTable, simb::MCTruth>> assns(new art::Assns<rwgt::GENIEReweightTable, simb::MCTruth>);
276 
277 
279  evt.getByToken(fGeneratorToken, mctruths);
280  assert(!mctruths.failedToGet());
281 
282  art::FindManyP<simb::GTruth> fmp(mctruths, evt, fGeneratorLabel);
283  assert(fmp.isValid());
284 
285  for(unsigned int truthIdx = 0; truthIdx < mctruths->size(); ++truthIdx){
286  const std::vector<art::Ptr<simb::GTruth>> gtruths = fmp.at(truthIdx);
287  assert(gtruths.size() == 1);
288 
289  const simb::MCTruth& mctruth = (*mctruths)[truthIdx];
290 
291  // obviously we won't have a reweight table if this isn't a GENIE event
292  if (mctruth.GeneratorInfo().generator != simb::Generator_t::kGENIE)
293  continue;
294 
295  const simb::GTruth& gtruth = *gtruths[0];
296 
297  mf::LogDebug("MakeGENIEReweightTable") << "Reweighting event:\n"
298  << "Interaction type: " << (mctruth.GetNeutrino().CCNC() == simb::kCC ? "CC" : "NC") << " " << ", mode = " << mctruth.GetNeutrino().Mode();
299 
300  // If we want to skip rock events in this detector
301  if((geom->DetId() == novadaq::cnv::kNEARDET && !fConsiderNDRock) ||
302  (geom->DetId() == novadaq::cnv::kFARDET && !fConsiderFDRock)){
303  // Where's the true vertex?
304  const TVector3 vtx = mctruth.GetNeutrino().Nu().Position().Vect();
305 
306  // If the vertex is outside the detector, skip this event
307  if(!geom->isInsideDetectorBigBox(vtx.X(), vtx.Y(), vtx.Z())) continue;
308  }
309 
310  // Signal of a nu/e interaction, which can cause trouble
311  if(gtruth.fgQ2 < 0) continue;
312 
314 
315  // default-initialize to 1.0 so that the list is always the same size.
316  // will override below for knobs that we actually calculate
317  double wm1, wm2, wp1, wp2;
318  wm1 = wm2 = wp1 = wp2 = 1.0;
319 
320  std::string tuneName = "default";
321  const auto * knobsToSkip = &this->fKnobsToSkip.at("default");
322  if (!mctruth.GeneratorInfo().generatorVersion.empty()
323  && (mctruth.GeneratorInfo().generatorVersion != "unknown")
324  && std::atoi(&mctruth.GeneratorInfo().generatorVersion[0]) >= 3
325  && mctruth.GeneratorInfo().generatorConfig.find("tune") != mctruth.GeneratorInfo().generatorConfig.end())
326  {
327  tuneName = mctruth.GeneratorInfo().generatorConfig.at("tune");
328  if (this->fKnobsToSkip.find(tuneName) == this->fKnobsToSkip.end())
329  {
330  mf::LogWarning("MakeGENIEReweightTable") << "No tune-specific knob list for tune '" << tuneName
331  << "'. Using default list.";
332  tuneName = "default";
333  }
334  else
335  knobsToSkip = &this->fKnobsToSkip.at(tuneName);
336  }
337  mf::LogDebug("MakeGENIEReweightTable") << "Using knob list for tune: '" << tuneName << "'";
338  bool hyperonCCQE = ((gtruth.fIsStrange || gtruth.fIsCharm)
339  && mctruth.GetNeutrino().Mode() == simb::kQE
340  && mctruth.GetNeutrino().CCNC() == simb::kCC);
341  for(int systIdx = 1; systIdx <= kMaxReweightIdx; ++systIdx)
342  {
343  // User can specify in FCL any knobs they want to skip
344  bool skipThisKnob = knobsToSkip->find(ReweightLabel_t(systIdx)) != knobsToSkip->end();
345 
346  // CCQE knobs sometimes barf on CCQE-strange antinu events. assume it probably does the same on CCQE-charm nu events too
347  if (hyperonCCQE && fSkipCCQEWgtsForHyperons)
348  {
349  genie::rew::GReWeight * wgtCalc = fRWsPlus1[systIdx]->WeightCalculator();
350  for (const auto & wgtrName : wgtCalc->WghtCalcNames())
351  {
352  const genie::rew::GReWeightI * wgtr = wgtCalc->WghtCalc(wgtrName);
353  if (wgtr->AppliesTo(genie::kScQuasiElastic, true))
354  {
355  skipThisKnob = true;
356  break;
357  }
358  }
359  }
360 
361  // we don't need this warning for knobs that are skipped *every* event, just the QES ones
362  if (skipThisKnob && hyperonCCQE)
363  {
364  mf::LogWarning("MakeGENIEReweightTable") << "Setting weights for knob "
365  << genie::rew::GSyst::AsString(static_cast<genie::rew::GSyst_t>(systIdx))
366  << " to unity for event:";
367  mf::LogWarning("MakeGENIEReweightTable") << gtruth;
368  }
369 
370  // actual reweighting here, if appropriate
371  if (!skipThisKnob)
372  {
373  std::clock_t start = std::clock();
374  wm2 = fRWsMinus2[systIdx]->CalcWeight(mctruth, gtruth);
375  wm1 = fRWsMinus1[systIdx]->CalcWeight(mctruth, gtruth);
376  wp1 = fRWsPlus1[systIdx]->CalcWeight(mctruth, gtruth);
377  wp2 = fRWsPlus2[systIdx]->CalcWeight(mctruth, gtruth);
378 
379  double duration = (std::clock() - start) / (double) CLOCKS_PER_SEC;
380 
381  rwgt::EReweightLabel systLabel = rwgt::EReweightLabel(systIdx);
382  if (this->fTimeKnobs)
383  {
384  if (this->fKnobTimes.find(systLabel) == this->fKnobTimes.end())
385  this->fKnobTimes[systLabel] = this->fFileService->make<TH1D>(Form("knob_%d", systIdx), Form(
386  ";Log_{10}(Time reweight knob %d used in event) (s)", systIdx), 100, -7, 3);
387 
388  if (duration <= 0)
389  this->fKnobTimes[systLabel]->Fill(-7);
390  else
391  this->fKnobTimes[systLabel]->Fill(log10(duration));
392  }
393  }
394 
395  table.SetWeights(systIdx, wm2, wm1, wp1, wp2);
396  } // end for systIdx
397 
398  tablecol->push_back(table);
399 
400  util::CreateAssn(evt, *tablecol,
401  art::Ptr<simb::MCTruth>(mctruths, truthIdx),
402  *assns);
403  } // end for truthIdx
404 
405 
406  evt.put(std::move(tablecol));
407  evt.put(std::move(assns));
408  }
409 
411 
412 } // namespace
413 
414 
415 // If the GENIE enum values are ever out of sync between generation-time and
416 // analysis time that can cause all sorts of confusion. Hopefully GENIE never
417 // change their enum values, but if it does happen then at least this will warn
418 // us.
419 
420 // Message has to be a string literal so I can't do "const std::string" here.
421 #define m "GENIE reweight enumeration values have changed."
422 
423 static_assert(rwgt::kReweightNull == 0, m);
424 static_assert(rwgt::fReweightMaNCEL == 1, m);
425 static_assert(rwgt::fReweightEtaNCEL == 2, m);
426 static_assert(rwgt::fReweightNormCCQE == 3, m);
427 static_assert(rwgt::fReweightNormCCQEenu == 4, m);
428 static_assert(rwgt::fReweightMaCCQEshape == 5, m);
429 static_assert(rwgt::fReweightMaCCQE == 6, m);
430 static_assert(rwgt::fReweightVecCCQEshape == 7, m);
431 static_assert(rwgt::fReweightNormCCRES == 8, m);
432 static_assert(rwgt::fReweightMaCCRESshape == 9, m);
433 static_assert(rwgt::fReweightMvCCRESshape == 10, m);
434 static_assert(rwgt::fReweightMaCCRES == 11, m);
435 static_assert(rwgt::fReweightMvCCRES == 12, m);
436 static_assert(rwgt::fReweightNormNCRES == 13, m);
437 static_assert(rwgt::fReweightMaNCRESshape == 14, m);
438 static_assert(rwgt::fReweightMvNCRESshape == 15, m);
439 static_assert(rwgt::fReweightMaNCRES == 16, m);
440 static_assert(rwgt::fReweightMvNCRES == 17, m);
441 static_assert(rwgt::fReweightMaCOHpi == 18, m);
442 static_assert(rwgt::fReweightR0COHpi == 19, m);
443 static_assert(rwgt::fReweightRvpCC1pi == 20, m);
444 static_assert(rwgt::fReweightRvpCC2pi == 21, m);
445 static_assert(rwgt::fReweightRvpNC1pi == 22, m);
446 static_assert(rwgt::fReweightRvpNC2pi == 23, m);
447 static_assert(rwgt::fReweightRvnCC1pi == 24, m);
448 static_assert(rwgt::fReweightRvnCC2pi == 25, m);
449 static_assert(rwgt::fReweightRvnNC1pi == 26, m);
450 static_assert(rwgt::fReweightRvnNC2pi == 27, m);
451 static_assert(rwgt::fReweightRvbarpCC1pi == 28, m);
452 static_assert(rwgt::fReweightRvbarpCC2pi == 29, m);
453 static_assert(rwgt::fReweightRvbarpNC1pi == 30, m);
454 static_assert(rwgt::fReweightRvbarpNC2pi == 31, m);
455 static_assert(rwgt::fReweightRvbarnCC1pi == 32, m);
456 static_assert(rwgt::fReweightRvbarnCC2pi == 33, m);
457 static_assert(rwgt::fReweightRvbarnNC1pi == 34, m);
458 static_assert(rwgt::fReweightRvbarnNC2pi == 35, m);
459 static_assert(rwgt::fReweightAhtBY == 36, m);
460 static_assert(rwgt::fReweightBhtBY == 37, m);
461 static_assert(rwgt::fReweightCV1uBY == 38, m);
462 static_assert(rwgt::fReweightCV2uBY == 39, m);
463 static_assert(rwgt::fReweightAhtBYshape == 40, m);
464 static_assert(rwgt::fReweightBhtBYshape == 41, m);
465 static_assert(rwgt::fReweightCV1uBYshape == 42, m);
466 static_assert(rwgt::fReweightCV2uBYshape == 43, m);
467 static_assert(rwgt::fReweightNormDISCC == 44, m);
468 static_assert(rwgt::fReweightRnubarnuCC == 45, m);
469 static_assert(rwgt::fReweightDISNuclMod == 46, m);
470 static_assert(rwgt::fReweightNC == 47, m);
471 static_assert(rwgt::fReweightAGKY_xF1pi == 48, m);
472 static_assert(rwgt::fReweightAGKY_pT1pi == 49, m);
473 static_assert(rwgt::fReweightFormZone == 50, m);
474 static_assert(rwgt::fReweightMFP_pi == 51, m);
475 static_assert(rwgt::fReweightMFP_N == 52, m);
476 static_assert(rwgt::fReweightFrCEx_pi == 53, m);
477 //static_assert(rwgt::fReweightFrElas_pi == 54, m);
478 static_assert(rwgt::fReweightFrInel_pi == 55, m);
479 static_assert(rwgt::fReweightFrAbs_pi == 56, m);
480 static_assert(rwgt::fReweightFrPiProd_pi == 57, m);
481 static_assert(rwgt::fReweightFrCEx_N == 58, m);
482 //static_assert(rwgt::fReweightFrElas_N == 59, m);
483 static_assert(rwgt::fReweightFrInel_N == 60, m);
484 static_assert(rwgt::fReweightFrAbs_N == 61, m);
485 static_assert(rwgt::fReweightFrPiProd_N == 62, m);
486 static_assert(rwgt::fReweightCCQEPauliSupViaKF == 63, m);
487 static_assert(rwgt::fReweightCCQEMomDistroFGtoSF == 64, m);
488 static_assert(rwgt::fReweightBR1gamma == 65, m);
489 static_assert(rwgt::fReweightBR1eta == 66, m);
490 static_assert(rwgt::fReweightTheta_Delta2Npi == 67, m);
491 static_assert(rwgt::fReweightZNormCCQE == 68, m);
492 static_assert(rwgt::fReweightZExpA1CCQE == 69, m);
493 static_assert(rwgt::fReweightZExpA2CCQE == 70, m);
494 static_assert(rwgt::fReweightZExpA3CCQE == 71, m);
495 static_assert(rwgt::fReweightZExpA4CCQE == 72, m);
496 static_assert(rwgt::fReweightAxFFCCQEshape == 73, m);
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
bool fTimeKnobs
Keep tabs on the reweight knobs & measure the time they take?
bool getByToken(ProductToken< PROD > const &, Handle< PROD > &result) const
Definition: DataViewImpl.h:462
bool fConsiderNDRock
Include rock interaction in the ND?
void SetWeights(unsigned int i, double m2, double m1, double p1, double p2)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const std::unordered_map< std::string, ReweightLabel_t > REWEIGHT_KNOB_INDICES
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::vector< rwgt::NuReweight * > fRWsPlus1
constexpr T pow(T x)
Definition: pow.h:72
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
Use NuReweight to compute +/-1,2sigma shifts for all systematics.
DEFINE_ART_MODULE(TestTMapFile)
std::vector< rwgt::NuReweight * > fRWsMinus2
bool fIsStrange
strange production // added version 13
Definition: GTruth.h:73
std::vector< rwgt::NuReweight * > fRWsPlus2
const art::ProductToken< std::vector< simb::MCTruth > > fGeneratorToken
::xsd::cxx::tree::duration< char, simple_type > duration
Definition: Database.h:188
Far Detector at Ash River, MN.
std::vector< rwgt::NuReweight * > fRWsMinus1
Use NuReweight to compute +/-1,2sigma shifts for all systematics.
Definition: FillTruth.h:18
std::void_t< T > n
static Messenger * Instance(void)
Definition: Messenger.cxx:71
T get(std::string const &key) const
Definition: ParameterSet.h:231
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
int evt
#define ERROR
Near Detector in the NuMI cavern.
bool fIsCharm
did the interaction produce a charmed hadron?
Definition: GTruth.h:71
bool isInsideDetectorBigBox(const double x_cm, const double y_cm, const double z_cm) const
Is the particle inside the detector Big Box?
std::vector< std::string > fKnobNamesToSkip
float bin[41]
Definition: plottest35.C:14
This class describes a particle created in the detector Monte Carlo simulation.
double sigma(TH1F *hist, double percentile)
OStream cout
Definition: OStream.cxx:6
std::map< rwgt::ReweightLabel_t, TH1D * > fKnobTimes
T log10(T number)
Definition: d0nt_math.hpp:120
void SetPriorityLevel(const char *stream, log4cpp::Priority::Value p)
Definition: Messenger.cxx:110
std::unordered_map< std::string, std::unordered_set< rwgt::ReweightLabel_t, std::hash< int > > > fKnobsToSkip
MakeGENIEReweightTable(const fhicl::ParameterSet &pset)
double fgQ2
Definition: GTruth.h:61
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
Store +/-1,2sigma shifts for all GENIE reweighting systematics.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geom(int which=0)
Definition: geom.C:163
assert(nhit_max >=nhit_nbins)
ProductToken< T > consumes(InputTag const &)
Definition: ModuleBase.h:55
const char * AsString(Resonance_t res)
resonance id -> string
Event generator information.
Definition: MCTruth.h:32
Double_t sum
Definition: plot.C:31
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:730
bool fConsiderFDRock
Include rock interaction in the FD?
Encapsulate the geometry of one entire detector (near, far, ndos)
bool failedToGet() const
Definition: Handle.h:190
void produce(art::Event &evt) override
art::ServiceHandle< art::TFileService > fFileService
enum BeamMode string