include/Photos/PhotosHepMC3Particle.h
1#ifndef _PhotosHepMC3Particle_h_included_
2#define _PhotosHepMC3Particle_h_included_
3
4/**
5 * @class PhotosHepMC3Particle
6 *
7 * @brief Interface to GenParticle objects
8 *
9 * This class implements the virtual methods of
10 * PhotosParticle. In this way it provides an
11 * interface between the generic PhotosParticle class
12 * and a GenParticle object.
13 *
14 * @date 26 Jan 2020
15 *
16 * This code is licensed under GNU General Public Licence.
17 * For more informations, see: http://www.gnu.org/licenses/
18 */
19
20#include <vector>
21
22#include "HepMC3/GenParticle.h"
23#include "PhotosParticle.h"
24
25namespace Photospp
26{
27using namespace HepMC3;
29
30 public:
31 /** General constructor */
33
34 /** Constructor which keeps a pointer to the GenParticle*/
35 PhotosHepMC3Particle(GenParticlePtr particle);
36
37 /** Constructor which creates a new GenParticle and
38 sets the properties pdg_id, statu and mass. */
39 PhotosHepMC3Particle(int pdg_id, int status, double mass);
40
41 /** Destructor */
43
44 /** return the GenParticlePtr */
45 GenParticlePtr getHepMC3();
46
47 /** Set the mothers of this particle via a vector of PhotosParticle*/
48 void setMothers(std::vector<PhotosParticle*> mothers);
49
50 /** Set the daughters of this particle via a vector of PhotosParticle*/
51 void setDaughters(std::vector<PhotosParticle*> daughters);
52
53 /** Add a new daughter to the end vertex of this particle */
54 void addDaughter(PhotosParticle* daughter);
55
56 /** Returns the mothers of this particle via a vector of PhotosParticle */
57 std::vector<PhotosParticle*> getMothers();
58
59 /** Returns the daughters of this particle via a vector of PhotosParticle
60 IMPORTANT: this method will remeber list from the first call. Particles
61 (e.g. photons) added later will be ignored */
62 std::vector<PhotosParticle*> getDaughters();
63
64 /** Returns all particles in the decay tree of this particle
65 via a vector of PhotosParticle */
66 std::vector<PhotosParticle*> getAllDecayProducts();
67
68 /** Set the PDG ID code of this particle */
69 void setPdgID(int pdg_id);
70
71 /** Set the status of this particle */
72 void setStatus(int statu);
73
74 /** Set the mass of this particle */
75 void setMass(double mass);
76
77 /** Get the PDG ID code of this particle */
78 int getPdgID();
79
80 /** Get the status of this particle */
81 int getStatus();
82
83 /** Get the barcode of this particle */
84 int getBarcode();
85
86 /** check that the 4 momentum in conserved at the vertices producing
87 and ending this particle */
89
90 /** Create a new particle of type PhotosHepMC3Particle, with the given
91 properties. The new particle bares no relations to this
92 particle, but it provides a way of creating a instance of
93 this derived class. eg. createNewParticle() is used inside
94 filhep_() so that a PhotosHepMC3Particle can be created without
95 the method having explicit knowledge of the PhotosHepMC3Particle
96 class */
97 PhotosHepMC3Particle * createNewParticle(int pdg_id, int status, double mass,
98 double px, double py,
99 double pz, double e);
100
101 /** Create history entry for HepMC event record.
102 Creates copy of this particle with status = 3 */
103 void createHistoryEntry();
104
105 /** Create a self-decay vertex for this particle
106 with 'out' being the outgoing particle in new vertex */
108
109 /** Print some information about this particle to standard output */
110 void print();
111
112 /** Returns the px component of the four vector*/
113 double getPx();
114
115 /** Returns the py component of the four vector */
116 double getPy();
117
118 /** Returns the pz component of the four vector */
119 double getPz();
120
121 /** Returns the energy component of the four vector */
122 double getE();
123
124 /** Returns the mass taken from event record */
125 double getMass();
126
127 /** Set the px component of the four vector */
128 void setPx( double px );
129
130 /** Set the px component of the four vector */
131 void setPy( double py );
132
133 /** Set the pz component of the four vector */
134 void setPz( double pz );
135
136 /** Set the energy component of the four vector */
137 void setE( double e );
138
139 private:
140 /** Internal function used to clear particles from the vector */
141 void clear(std::vector<PhotosParticle*> v);
142
143 /** A pointer to the GenParticle particle */
144 GenParticlePtr m_particle;
145
146 /** A vector of this particles mothers */
147 std::vector<PhotosParticle*> m_mothers;
148
149 /** A vector of this particles daughters */
150 std::vector<PhotosParticle*> m_daughters;
151
152 /** A vector of all decay products of this particle */
153 std::vector<PhotosParticle*> m_decay_products;
154
155 /** list to keep track of new particles which have been
156 created from this one, so we can call their destructor later */
157 std::vector<PhotosParticle*> m_created_particles;
158
159};
160
161} // namespace Photospp
162#endif
Interface to GenParticle objects.
Abstract base class for particle in the event. This class also handles boosting.
void setMothers(std::vector< PhotosParticle * > mothers)
void setDaughters(std::vector< PhotosParticle * > daughters)
std::vector< PhotosParticle * > getAllDecayProducts()
void clear(std::vector< PhotosParticle * > v)
std::vector< PhotosParticle * > getDaughters()
void createSelfDecayVertex(PhotosParticle *out)
void addDaughter(PhotosParticle *daughter)
std::vector< PhotosParticle * > m_created_particles
PhotosHepMC3Particle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)
std::vector< PhotosParticle * > getMothers()