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
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:32
void SetFirstDaughter(int daughter)
int const GetId()
void SetEvent(HEPEvent *event)
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)