HepMC3 event record library
HepMC3Particle.h
1 /**
2  * @class HepMC3Particle
3  * @brief HEPParticle interface to HepMC classes
4  *
5  * HepMC3Particle extends GenParticle class, so that
6  * MC-TESTER can accesses the particle information through
7  * the common HEPEvent methods
8  *
9  */
10 
11 #ifndef _HepMC3Particle_H
12 #define _HepMC3Particle_H
13 
14 #include "HEPParticle.H"
15 #include "HepMC3/GenParticle.h"
16 #include "HepMC3/GenVertex.h"
17 
18 #ifdef _USE_ROOT_
19 #include <TObject.h>
20 #include <TBuffer.h>
21 #include <TClass.h>
22 #endif
23 
24 class HepMC3Event;
25 class HepMC3Particle : public HEPParticle
26 {
27 
28 private:
29  /** Event which the particle belongs to.*/
31  /** ID number of particle as given by MC-TESTER (not the same as
32  GenParticle pdg_id or barcode).*/
33  int id ;
34 
35 public:
36  /** Plain constructor.*/
38  /** Constructor which makes a HepMC3Particle from GenParticle. */
39  HepMC3Particle(HepMC3::GenParticle& particle, HEPEvent * e, int Id);
40  /** Destructor*/
42 
43  /** Set all the particle properties of "p" to this particle.*/
44  const HepMC3Particle operator=(HEPParticle &p);
45 
46  /** Returns the event that this particle belongs to.*/
47  HEPEvent* GetEvent() ;
48  /** returns the ID number of particle as used by MC-TESTER (not
49  the same as GenParticle pdg_id or barcode).*/
50  int const GetId() ;
51  /** Dummy function definition. Do not use.*/
52  int const GetMother() ;
53  /** Dummy function definition. Do not use.*/
54  int const GetMother2() ;
55  /** Dummy function definition. Do not use.*/
56  int const GetFirstDaughter() ;
57  /** Dummy function definition. Do not use.*/
58  int const GetLastDaughter() ;
59 
60  /** Returns the particle's energy */
61  double const GetE () ;
62  /** Returns the x component of the particle's momentum */
63  double const GetPx() ;
64  /** Returns the y component of the particle's momentum */
65  double const GetPy() ;
66  /** Returns the z component of the particle's momentum */
67  double const GetPz() ;
68  /** Returns the particle's mass */
69  double const GetM () ;
70  /** Returns the particle's PDG ID code. */
71  int const GetPDGId () ;
72  /** Returns the particle's Status code. */
73  int const GetStatus() ;
74  /** Returns true is the particle has status code 1. */
75  int const IsStable() ;
76  /** Returns true is the particle has status code 2
77  or (for pythia 8) if it has a status < 0, has an end vertex and
78  does not have any daughters of the same PDG code.*/
79  int const Decays();
80  /** Returns true is the particle has status code 3 or (for pythia 8)
81  if fails both IsStable() and Decays().*/
82  int const IsHistoryEntry();
83 
84  /** Returns the x value of the particle's production vertex */
85  double const GetVx () ;
86  /** Returns the y value of the particle's production vertex */
87  double const GetVy () ;
88  /** Returns the z value of the particle's production vertex */
89  double const GetVz () ;
90  /** Dummy function definition. Do not use.*/
91  double const GetTau () ;
92 
93  /** Sets the event that this particle belongs to */
94  void SetEvent ( HEPEvent *event );
95  /** Sets ID (as used by MC-TESTER) of this particle */
96  void SetId ( int id );
97  /** Dummy function definition. Do not use.*/
98  void SetMother ( int mother );
99  /** Dummy function definition. Do not use.*/
100  void SetMother2 ( int mother );
101  /** Dummy function definition. Do not use.*/
102  void SetFirstDaughter( int daughter );
103  /** Dummy function definition. Do not use.*/
104  void SetLastDaughter ( int daughter );
105 
106  /** Sets the energy of this particle */
107  void SetE ( double E ) ;
108  /** Sets the x component of this particle's momentum */
109  void SetPx ( double px ) ;
110  /** Sets the x component of this particle's momentum */
111  void SetPy ( double py ) ;
112  /** Sets the x component of this particle's momentum */
113  void SetPz ( double pz ) ;
114  /** Dummy function definition. Do not use.*/
115  void SetM ( double m ) ;
116 
117  /** Sets the PDG ID code of this particle */
118  void SetPDGId ( int pdg ) ;
119  /** Sets the status code of this particle */
120  void SetStatus( int st ) ;
121  /** Sets the x value of this particle's production vertex */
122  void SetVx ( double vx ) ;
123  /** Sets the y value of this particle's production vertex */
124  void SetVy ( double vy ) ;
125  /** Sets the z value of this particle's production vertex */
126  void SetVz ( double vz ) ;
127  /** Dummy function definition. Do not use.*/
128  void SetTau( double tau ) ;
129 
130  /** Returns a list of daughter particles of this particle.
131  If a list of particle is given as a parameter, the daughters
132  are appended to the end. If the daughter is already found
133  in the list, it is not added. The function finds daughters by
134  iterating over the outgoing particles from the end vertex.
135  The daughter particle must be stable of decaying to be added to
136  the list. (for pythia 8) if the status code is negative, the
137  daughter's daughters are searched recursively.*/
138 
139  HEPParticleList* GetDaughterList(HEPParticleList *list);
140  /** Returns a list of daughter particles of this particle.*/
141  HEPParticleList* GetMotherList(HEPParticleList *list);
142 public:
143  HepMC3::GenParticle *part;
144 
145 #ifdef _USE_ROOT_
146  ClassDef(HepMC3Particle,0)
147 #endif
148 };
149 
150 #endif // _HepMC3Particle_H
void SetM(double m)
void SetVy(double vy)
void SetTau(double tau)
int const IsStable()
void SetVx(double vx)
double const GetM()
Definition of class GenParticle.
double const GetE()
void SetStatus(int st)
double const GetVx()
double const GetVz()
int const GetLastDaughter()
Definition of class GenVertex.
int const Decays()
void SetId(int id)
Stores particle-related information.
Definition: GenParticle.h:31
void SetLastDaughter(int daughter)
void SetVz(double vz)
void SetE(double E)
void SetMother(int mother)
double const GetPx()
double const GetTau()
HEPEvent * GetEvent()
const HepMC3Particle operator=(HEPParticle &p)
HepMC3Event * event
HEPEvent Interface to HepMC classes.
Definition: HepMC3Event.h:30
void SetFirstDaughter(int daughter)
int const GetId()
void SetEvent(HEPEvent *event)
Definition: pytypes.h:1320
double const GetPz()
double const GetPy()
int const GetPDGId()
void SetPy(double py)
double const GetVy()
HEPParticle interface to HepMC classes.
void SetMother2(int mother)
int const IsHistoryEntry()
void SetPx(double px)
int const GetFirstDaughter()
int const GetMother()
void SetPz(double pz)
int const GetStatus()
HEPParticleList * GetDaughterList(HEPParticleList *list)
int const GetMother2()
HEPParticleList * GetMotherList(HEPParticleList *list)
void SetPDGId(int pdg)