PFParticle.h
Go to the documentation of this file.
1 //
2 // PFParticle.h
3 //
4 // Created by Eldwan Brianne on 07/06/2020.
5 //
6 
7 #ifndef GAR_RECONSTRUCTIONDATAPRODUCTS_PFParticle_h
8 #define GAR_RECONSTRUCTIONDATAPRODUCTS_PFParticle_h
9 
10 #include <iostream>
11 
12 #include <map>
13 #include <list>
14 #include <vector>
15 
17 
18 namespace gar {
19  namespace rec {
20 
21  class PFParticle {
22 
23  public:
24  PFParticle();
25 
26  PFParticle(int type, float energy, float pos[3], float mom[3], float charge, int pdg, float goodness, size_t parent, std::vector<size_t> daughters);
27 
28  // let the compiler provide the dtor
29 
30  struct ParticleIDData {
31  int fPdg;
32  float fGoodness;
33  };
34 
35  private:
36 
37  static gar::rec::IDNumber const FirstNumber = 800000;
39 
40  int fType{0}; ///< type of the PFParticle
41  float fEnergy{0.}; ///< energy of the PFParticle in GeV
42  float fPos[3]; ///< position of the PFParticle (cluster CoG)
43  float fMom[3]; ///< momentum of the PFParticle in GeV
44  float fMass{0}; ///< mass of the PFParticle
45  float fCharge{0}; ///< charge of the PFParticle
46  int fPdg; ///< PDG of the PFParticle
47  float fGoodness; ///< Goodness of the PDG of the PFParticle
48  size_t fParent{0}; ///< Parent of the PFParticle
49  std::vector<size_t> fDaughters; ///< Daughters of the PFParticle
50 
51  #ifndef __GCCXML__
52 
53  public:
54 
55  //Copy constructor
56  PFParticle(const gar::rec::PFParticle &) = default;
57 
58  bool operator==(const PFParticle& rhs) const;
59  bool operator!=(const PFParticle& rhs) const;
61 
62  void setType(int type);
63  void setEnergy(float energy);
64  void setPosition(const float pos[3]);
65  void setMomentum(const float mom[3]);
66  void setMass(float mass);
67  void setCharge(float charge);
68  void setParticleID(int pdg, float goodness);
69  void setParent(size_t parent);
70  void setDaughters(std::vector<size_t> daughters);
71 
72  int Type() const;
73  float Energy() const;
74  const float* Position() const;
75  const float* Momentum() const;
76  float Mass() const;
77  float Charge() const;
78  int Pdg() const;
79  float GoodnessOfPdg() const;
80  size_t Parent() const;
81  const std::vector<size_t> Daughters() const;
82  size_t NDaughters() const;
83 
84  friend std::ostream& operator << (std::ostream & o, gar::rec::PFParticle const& h);
85 
86  #endif
87 
88  };
89 
90  inline int gar::rec::PFParticle::Type() const { return fType; }
91  inline float gar::rec::PFParticle::Energy() const { return fEnergy; }
92  inline const float* gar::rec::PFParticle::Position() const { return &fPos[0]; }
93  inline const float* gar::rec::PFParticle::Momentum() const { return &fMom[0]; }
94  inline float gar::rec::PFParticle::Mass() const { return fMass; }
95  inline float gar::rec::PFParticle::Charge() const { return fCharge; }
96  inline int gar::rec::PFParticle::Pdg() const { return fPdg; }
97  inline float gar::rec::PFParticle::GoodnessOfPdg() const { return fGoodness; }
98  inline size_t gar::rec::PFParticle::Parent() const { return fParent; }
99  inline const std::vector<size_t> gar::rec::PFParticle::Daughters() const { return fDaughters; }
100  inline size_t gar::rec::PFParticle::NDaughters() const { return fDaughters.size(); }
101  }//rec
102 } // gar
103 
104 
105 #endif /* GAR_RECONSTRUCTIONDATAPRODUCTS_PFParticle_h */
float fCharge
charge of the PFParticle
Definition: PFParticle.h:45
int Type() const
Definition: PFParticle.h:90
rec
Definition: tracks.py:88
const float * Momentum() const
Definition: PFParticle.h:93
static gar::rec::IDNumber const FirstNumber
Definition: PFParticle.h:37
void setMass(float mass)
Definition: PFParticle.cxx:80
float Mass() const
Definition: PFParticle.h:94
float fPos[3]
position of the PFParticle (cluster CoG)
Definition: PFParticle.h:42
gar::rec::IDNumber fIDnumero
Definition: PFParticle.h:38
std::vector< size_t > fDaughters
Daughters of the PFParticle.
Definition: PFParticle.h:49
void setEnergy(float energy)
Definition: PFParticle.cxx:61
float Energy() const
Definition: PFParticle.h:91
void setParent(size_t parent)
Definition: PFParticle.cxx:96
int fPdg
PDG of the PFParticle.
Definition: PFParticle.h:46
float fMass
mass of the PFParticle
Definition: PFParticle.h:44
const float * Position() const
Definition: PFParticle.h:92
const std::vector< size_t > Daughters() const
Definition: PFParticle.h:99
bool operator==(const PFParticle &rhs) const
Definition: PFParticle.cxx:131
float fGoodness
Goodness of the PDG of the PFParticle.
Definition: PFParticle.h:47
int Pdg() const
Definition: PFParticle.h:96
float fMom[3]
momentum of the PFParticle in GeV
Definition: PFParticle.h:43
float Charge() const
Definition: PFParticle.h:95
float fEnergy
energy of the PFParticle in GeV
Definition: PFParticle.h:41
bool operator!=(const PFParticle &rhs) const
Definition: PFParticle.cxx:135
int fType
type of the PFParticle
Definition: PFParticle.h:40
General GArSoft Utilities.
void setMomentum(const float mom[3])
Definition: PFParticle.cxx:73
friend std::ostream & operator<<(std::ostream &o, gar::rec::PFParticle const &h)
Definition: PFParticle.cxx:106
void setDaughters(std::vector< size_t > daughters)
Definition: PFParticle.cxx:101
void setPosition(const float pos[3])
Definition: PFParticle.cxx:66
void setCharge(float charge)
Definition: PFParticle.cxx:85
size_t fParent
Parent of the PFParticle.
Definition: PFParticle.h:48
void setParticleID(int pdg, float goodness)
Definition: PFParticle.cxx:90
void setType(int type)
Definition: PFParticle.cxx:56
gar::rec::IDNumber getIDNumber() const
Definition: PFParticle.cxx:139
size_t NDaughters() const
Definition: PFParticle.h:100
size_t IDNumber
Definition: IDNumberGen.h:71
def parent(G, child, parent_type)
Definition: graph.py:67
float GoodnessOfPdg() const
Definition: PFParticle.h:97
size_t Parent() const
Definition: PFParticle.h:98