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
HepMC3Particle::GetLastDaughter
int const GetLastDaughter()
HepMC3Particle::SetVx
void SetVx(double vx)
HepMC3Particle::SetVy
void SetVy(double vy)
HepMC3Particle::GetFirstDaughter
int const GetFirstDaughter()
HepMC3Event
HEPEvent Interface to HepMC classes.
Definition: HepMC3Event.h:31
HepMC3Particle::SetLastDaughter
void SetLastDaughter(int daughter)
HepMC3Particle::SetId
void SetId(int id)
list
Definition: pytypes.h:1320
HepMC3Particle::HepMC3Particle
HepMC3Particle()
HepMC3Particle::SetM
void SetM(double m)
HepMC3Particle::GetVx
double const GetVx()
HepMC3Particle::SetVz
void SetVz(double vz)
HepMC3Particle::SetTau
void SetTau(double tau)
HepMC3Particle::GetVz
double const GetVz()
GenVertex.h
Definition of class GenVertex.
HepMC3Particle::operator=
const HepMC3Particle operator=(HEPParticle &p)
HepMC3Particle::SetPz
void SetPz(double pz)
HepMC3Particle
HEPParticle interface to HepMC classes.
Definition: HepMC3Particle.h:26
HepMC3Particle::GetPx
double const GetPx()
GenParticle.h
Definition of class GenParticle.
HepMC3Particle::SetE
void SetE(double E)
HepMC3Particle::IsStable
int const IsStable()
HepMC3Particle::GetEvent
HEPEvent * GetEvent()
HepMC3Particle::SetEvent
void SetEvent(HEPEvent *event)
HepMC3Particle::Decays
int const Decays()
HepMC3Particle::SetFirstDaughter
void SetFirstDaughter(int daughter)
HepMC3Particle::GetTau
double const GetTau()
HepMC3Particle::GetMother
int const GetMother()
HepMC3Particle::GetStatus
int const GetStatus()
HepMC3Particle::id
int id
Definition: HepMC3Particle.h:33
HepMC3Particle::SetMother
void SetMother(int mother)
HepMC3Particle::GetId
int const GetId()
HepMC3Particle::GetPz
double const GetPz()
HepMC3Particle::IsHistoryEntry
int const IsHistoryEntry()
HepMC3Particle::GetVy
double const GetVy()
HepMC3Particle::GetMotherList
HEPParticleList * GetMotherList(HEPParticleList *list)
HepMC3Particle::SetPx
void SetPx(double px)
HepMC3Particle::~HepMC3Particle
~HepMC3Particle()
HepMC3Particle::GetE
double const GetE()
HepMC3Particle::GetPDGId
int const GetPDGId()
HepMC3Particle::SetStatus
void SetStatus(int st)
HepMC3Particle::HepMC3Particle
HepMC3Particle(HepMC3::GenParticle &particle, HEPEvent *e, int Id)
HepMC3Particle::event
HepMC3Event * event
Definition: HepMC3Particle.h:30
HepMC3::GenParticle
Stores particle-related information.
Definition: GenParticle.h:31
HepMC3Particle::GetPy
double const GetPy()
HepMC3Particle::SetPy
void SetPy(double py)
HepMC3Particle::SetMother2
void SetMother2(int mother)
HepMC3Particle::GetM
double const GetM()
HepMC3Particle::SetPDGId
void SetPDGId(int pdg)
HepMC3Particle::GetDaughterList
HEPParticleList * GetDaughterList(HEPParticleList *list)
HepMC3Particle::GetMother2
int const GetMother2()