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