LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MCTruth.h
Go to the documentation of this file.
1 #ifndef SIMB_MCTRUTH_H
9 #define SIMB_MCTRUTH_H
10 
11 #include <string>
12 #include <vector>
15 
16 namespace simb {
17 
18  class MCParticle;
19 
21  typedef enum _ev_origin{
27  } Origin_t;
28 
29  //......................................................................
30 
32  class MCTruth {
33  public:
34  MCTruth();
35 
36  private:
37 
38  std::vector<simb::MCParticle> fPartList;
42  bool fNeutrinoSet;
43 
44  public:
45  const simb::MCGeneratorInfo& GeneratorInfo() const;
46  simb::Origin_t Origin() const;
47  int NParticles() const;
48  const simb::MCParticle& GetParticle(int i) const;
49  const simb::MCNeutrino& GetNeutrino() const;
50  bool NeutrinoSet() const;
51 
52  void Add(simb::MCParticle const& part);
53  void Add(simb::MCParticle&& part);
54  void SetGeneratorInfo(simb::Generator_t generator,
55  const std::string & genVersion,
56  const std::unordered_map<std::string, std::string>& genConfig);
58  void SetNeutrino(int CCNC,
59  int mode,
60  int interactionType,
61  int target,
62  int nucleon,
63  int quark,
64  double w,
65  double x,
66  double y,
67  double qsqr);
68 
69  friend std::ostream& operator<< (std::ostream& o, simb::MCTruth const& a);
70  };
71 }
72 
74 inline simb::Origin_t simb::MCTruth::Origin() const { return fOrigin; }
75 inline int simb::MCTruth::NParticles() const { return (int)fPartList.size(); }
76 inline const simb::MCParticle& simb::MCTruth::GetParticle(int i) const { return fPartList[i]; }
77 inline const simb::MCNeutrino& simb::MCTruth::GetNeutrino() const { return fMCNeutrino; }
78 inline bool simb::MCTruth::NeutrinoSet() const { return fNeutrinoSet; }
79 
80 inline void simb::MCTruth::Add(simb::MCParticle const& part) { fPartList.push_back(part); }
81 inline void simb::MCTruth::Add(simb::MCParticle&& part) { fPartList.push_back(std::move(part)); }
83 
85  const std::string &genVersion,
86  const std::unordered_map<std::string, std::string>& genConfig)
87 {
88  fGenInfo = simb::MCGeneratorInfo(generator, genVersion, genConfig);
89 }
90 
91 #endif //SIMB_MCTRUTH_H
92 
Float_t x
Definition: compare.C:6
std::vector< simb::MCParticle > fPartList
list of particles in this event
Definition: MCTruth.h:38
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:77
void SetOrigin(simb::Origin_t origin)
Definition: MCTruth.h:82
Float_t y
Definition: compare.C:6
simb::Origin_t Origin() const
Definition: MCTruth.h:74
enum simb::_ev_origin Origin_t
event origin types
_ev_origin
event origin types
Definition: MCTruth.h:21
enum simb::_ev_generator Generator_t
generator used to produce event, if applicable
int NParticles() const
Definition: MCTruth.h:75
void SetNeutrino(int CCNC, int mode, int interactionType, int target, int nucleon, int quark, double w, double x, double y, double qsqr)
Definition: MCTruth.cxx:30
simb::MCNeutrino fMCNeutrino
reference to neutrino info - null if not a neutrino
Definition: MCTruth.h:39
simb::MCGeneratorInfo fGenInfo
information about the generator that produced this event
Definition: MCTruth.h:41
TString part[npart]
Definition: Style.C:32
single particles thrown at the detector
Definition: MCTruth.h:26
ART objects.
const simb::MCParticle & GetParticle(int i) const
Definition: MCTruth.h:76
simb::Origin_t fOrigin
origin for this event
Definition: MCTruth.h:40
friend std::ostream & operator<<(std::ostream &o, simb::MCTruth const &a)
Definition: MCTruth.cxx:70
void SetGeneratorInfo(simb::Generator_t generator, const std::string &genVersion, const std::unordered_map< std::string, std::string > &genConfig)
Definition: MCTruth.h:84
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
cout<< "-> Edep in the target
Definition: analysis.C:53
Supernova neutrinos.
Definition: MCTruth.h:25
bool NeutrinoSet() const
Definition: MCTruth.h:78
Event generator information.
Definition: MCTruth.h:32
bool fNeutrinoSet
flag for whether the neutrino information has been set
Definition: MCTruth.h:42
Event generator information.
Definition: MCNeutrino.h:18
Float_t w
Definition: plot.C:20
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:229
Cosmic rays.
Definition: MCTruth.h:24
Beam neutrinos.
Definition: MCTruth.h:23
const simb::MCGeneratorInfo & GeneratorInfo() const
Definition: MCTruth.h:73