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
26class HepMC3Event;
27class HepMC3Particle : public HEPParticle
28{
29
30private:
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
37public:
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);
144public:
146
147#ifdef _USE_ROOT_
148 ClassDef(HepMC3Particle,0)
149#endif
150};
151
152#endif // _HepMC3Particle_H
Definition of class GenParticle.
Definition of class GenVertex.
HEPEvent Interface to HepMC classes.
Definition: HepMC3Event.h:33
HEPParticle interface to HepMC classes.
void SetId(int id)
void SetMother2(int mother)
double const GetPz()
int const IsHistoryEntry()
void SetStatus(int st)
const HepMC3Particle operator=(HEPParticle &p)
HEPParticleList * GetMotherList(HEPParticleList *list)
void SetEvent(HEPEvent *event)
void SetPz(double pz)
void SetTau(double tau)
int const GetMother()
double const GetPy()
double const GetVx()
double const GetTau()
void SetVz(double vz)
int const GetFirstDaughter()
int const GetLastDaughter()
void SetVx(double vx)
void SetFirstDaughter(int daughter)
int const GetPDGId()
int const GetMother2()
int const GetId()
HEPEvent * GetEvent()
void SetE(double E)
HepMC3Event * event
int const IsStable()
void SetPDGId(int pdg)
double const GetVz()
void SetLastDaughter(int daughter)
double const GetVy()
double const GetPx()
double const GetE()
void SetPy(double py)
void SetPx(double px)
int const Decays()
void SetVy(double vy)
void SetMother(int mother)
int const GetStatus()
HEPParticleList * GetDaughterList(HEPParticleList *list)
double const GetM()
HepMC3Particle(HepMC3::GenParticle &particle, HEPEvent *e, int Id)
void SetM(double m)
Stores particle-related information.
Definition: GenParticle.h:31