LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GENIE2ART.h
Go to the documentation of this file.
1 #ifndef EVGB_GENIE2ART_H
11 #define EVGB_GENIE2ART_H
12 
13 #include <string>
16 #include <unordered_map>
17 
19 namespace genie {
20  class EventRecord;
21  class GFluxI;
22  namespace flux {
23  class GNuMIFlux;
24  class GNuMIFluxPassThroughInfo;
25  class GSimpleNtpFlux;
26  class GSimpleNtpEntry;
27  class GSimpleNtpNuMI;
28  class GSimpleNtpAux;
29  class GSimpleNtpMeta;
30  class GDk2NuFlux;
31  }
32 }
33 namespace bsim {
34  class Dk2Nu;
35  class NuChoice;
36  class DkMeta;
37 }
38 
40 namespace simb {
41  class MCTruth;
42  class GTruth;
43  class MCFlux;
44 }
45 
47 class TLorentzVector;
48 
49 namespace evgb {
50 
51 
52  // utility function: if s starts w/ $, get env var, otherwise return as is
53  std::string ExpandEnvVar(const std::string& s);
54 
55  void SetEventGeneratorListAndTune(const std::string& evtlistname = "",
56  const std::string& tunename = "${GENIE_XSEC_TUNE}");
57 
58  // adapted from GENIEHelper
59  void FillMCTruth(const genie::EventRecord* grec,
60  double spillTime,
61  simb::MCTruth& mctruth,
62  const std::string & genieVersion="unknown",
63  const std::string & genieTune="unknown",
64  bool addGenieVtxTime = false,
65  const std::unordered_map<std::string, std::string> genConfig = {});
66  void FillMCTruth(const genie::EventRecord* grec,
67  TLorentzVector& vtxOffset,
68  simb::MCTruth& mctruth,
69  const std::string & genieVersion="unknown",
70  const std::string & genieTune="unknown",
71  bool addGenieVtxTime = false,
72  const std::unordered_map<std::string, std::string> genConfig = {});
73  void FillGTruth(const genie::EventRecord* grec,
74  simb::GTruth& gtruth);
75 
77  // adapted from NuReweight
78  //
79  genie::EventRecord* RetrieveGHEP(const simb::MCTruth& truth,
80  const simb::GTruth& gtruth,
81  bool useFirstTrajPosition = true);
82 
83  std::vector<std::unique_ptr<genie::EventRecord>> RetrieveGHEPs(
84  const art::Handle<std::vector<simb::MCTruth>>& mcTruthHandle,
85  const art::Handle<std::vector<simb::GTruth>>& gTruthHandle
86  );
87  std::vector<std::unique_ptr<genie::EventRecord>> RetrieveGHEPs(
88  const art::Event& e,
89  std::string mcTruthLabel,
90  std::string gTruthLabel
91  );
92 
93  void FillMCFlux(genie::GFluxI* fdriver, simb::MCFlux& mcflux);
94 
95  void FillMCFlux(genie::flux::GNuMIFlux* gnumi,
96  simb::MCFlux& mcflux);
97  void FillMCFlux(const genie::flux::GNuMIFluxPassThroughInfo* nflux,
98  double dk2gen,
99  simb::MCFlux& flux);
100 
101  void FillMCFlux(genie::flux::GSimpleNtpFlux* gsimple,
102  simb::MCFlux& mcflux);
103  void FillMCFlux(const genie::flux::GSimpleNtpEntry* nflux_entry,
104  const genie::flux::GSimpleNtpNuMI* nflux_numi,
105  const genie::flux::GSimpleNtpAux* nflux_aux,
106  const genie::flux::GSimpleNtpMeta* nflux_meta,
107  simb::MCFlux& flux);
108 
109  void FillMCFlux(genie::flux::GDk2NuFlux* gdk2nu,
110  simb::MCFlux& mcflux);
111  void FillMCFlux(const bsim::Dk2Nu* dk2nu,
112  const bsim::NuChoice* nuchoice,
113  simb::MCFlux& flux);
114 
115 } // end-of-namespace evgb
116 
117 #endif // EVGB_GENIE2ART_H
void FillMCFlux(const bsim::Dk2Nu *dk2nu, const bsim::NuChoice *nuchoice, simb::MCFlux &flux)
Definition: GENIE2ART.cxx:1161
GENIE neutrino interaction simulation objects.
Definition: GENIE2ART.h:19
std::vector< std::unique_ptr< genie::EventRecord > > RetrieveGHEPs(const art::Event &e, std::string mcTruthLabel, std::string gTruthLabel)
Definition: GENIE2ART.cxx:821
genie::EventRecord * RetrieveGHEP(const simb::MCTruth &truth, const simb::GTruth &gtruth, bool useFirstTrajPosition=true)
return genie::EventRecord pointer; callee takes possession
Definition: GENIE2ART.cxx:540
Definition: GENIE2ART.h:33
std::string ExpandEnvVar(const std::string &s)
Definition: GENIE2ART.cxx:98
ART objects.
void FillMCTruth(const genie::EventRecord *grec, TLorentzVector &vtxOffset, simb::MCTruth &mctruth, const std::string &genieVersion="unknown", const std::string &genieTune="unknown", bool addGenieVtxTime=false, const std::unordered_map< std::string, std::string > genConfig={})
Definition: GENIE2ART.cxx:194
void SetEventGeneratorListAndTune(const std::string &evtlistname="", const std::string &tunename="${GENIE_XSEC_TUNE}")
Definition: GENIE2ART.cxx:128
Physics generators for neutrinos, cosmic rays, and others.
Definition: CRYHelper.cxx:33
void FillGTruth(const genie::EventRecord *grec, simb::GTruth &gtruth)
Definition: GENIE2ART.cxx:391
Event generator information.
Definition: MCTruth.h:32
Float_t e
Definition: plot.C:35