1 #ifndef _PhotosParticle_h_included_
2 #define _PhotosParticle_h_included_
5 * @class PhotosParticle
7 * @brief Abstract base class for particle in the event. This class also
10 * PhotosParticle is a Photos representation of a particle. It has virtual
11 * getter and setter methods that need to be implemented by a derived class.
12 * An example of this is PhotosHepMCParticle. In this way it provides an
13 * interface to the information in the Event Record.
15 * @author Nadia Davidson
28 /** Stable particle status */
29 static const int STABLE=1;
31 /** Decayed particle status */
32 static const int DECAYED=2;
34 /** History particle status */
35 static const int HISTORY=3;
38 static const int X_AXIS=1;
41 static const int Y_AXIS=2;
44 static const int Z_AXIS=3;
47 static const int Z0 = 23;
50 static const int HIGGS = 25;
53 static const int HIGGS_H = 35;
56 static const int HIGGS_A = 36;
59 static const int HIGGS_PLUS = 37;
62 static const int HIGGS_MINUS = -37;
65 static const int W_PLUS = 24;
68 static const int W_MINUS = -24;
71 static const int GAMMA = 22;
74 static const int TAU_PLUS = -15;
77 static const int TAU_MINUS = 15;
79 /** tau neutrino particle */
80 static const int TAU_NEUTRINO = 16;
82 /** tau antineutrino particle */
83 static const int TAU_ANTINEUTRINO = -16;
86 static const int MUON_PLUS = -13;
89 static const int MUON_MINUS = 13;
91 /** muon neutrino particle */
92 static const int MUON_NEUTRINO = 14;
94 /** muon antineutrino particle */
95 static const int MUON_ANTINEUTRINO = -14;
98 static const int POSITRON = -11;
101 static const int ELECTRON = 11;
103 /** e neutrino particle */
104 static const int ELECTRON_NEUTRINO = 12;
106 /** e antineutrino particle */
107 static const int ELECTRON_ANTINEUTRINO = -12;
110 static const int UP = 2;
113 static const int ANTIUP = -2;
116 static const int DOWN = 1;
118 /** anti-down quark */
119 static const int ANTIDOWN = -1;
121 /** All other particle types*/
122 static const int OTHER = 0;
125 virtual ~PhotosParticle(){};
127 /** Return whether the particle has any chidren */
130 /** Traverse the event structure and find the final version
131 of this particle which does not have a particle of it's own type
132 as it's daughter. eg. Generally the final stable copy */
133 PhotosParticle * findLastSelf();
135 /** Traverse the event structure and find the first set of mothers
136 which are not of the same type as this particle. */
137 std::vector<PhotosParticle *> findProductionMothers();
139 /** Return whole decay tree starting from this particle */
140 std::vector<PhotosParticle *> getDecayTree();
142 /** Transform this particles four momentum from the lab frome
143 into the rest frame of the paramter PhotosParticle. */
144 void boostToRestFrame(PhotosParticle * boost);
146 /** Transform the four momentum of all the daughters recursively
147 into the frame of the "particle" PhotosParticle. */
148 void boostDaughtersToRestFrame(PhotosParticle * boost);
150 /** Transform this particles four momentum from the rest frame of
151 the paramter PhotosParticle, back into the lab frame. */
152 void boostFromRestFrame(PhotosParticle * boost);
154 /** Transform this particles four momentum from the lab frame to
155 the rest frame of the parameter PhotosParticle. */
156 void boostDaughtersFromRestFrame(PhotosParticle * boost);
158 /** Do a Lorenz transformation along the Z axis. */
159 void boostAlongZ(double pz, double e);
161 /** rotate this particles 4-momentum by an angle phi from
162 the axisis "axis" towards the axis "second_axis". */
163 void rotate(int axis, double phi, int second_axis=Z_AXIS);
165 /** rotate 4-momentum of daughters of this particle by an angle phi from
166 the axisis "axis" towards the axis "second_axis". */
167 void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS);
169 /** Returns the angle around the axis "axis" needed to rotate
170 the four momenum is such a way that the non-Z component
171 disappears and Z>0. This is used to in rotating the coordinate
172 system into a frame with only a Z component before calling
174 double getRotationAngle(int axis, int second_axis=Z_AXIS);
176 /** Get scalar momentum */
179 /** Get momentum component in the direction of "axis" (x,y,z) */
180 double getP(int axis);
182 /** Set momentum component in the direction of "axis" (x,y,z) */
183 void setP(int axis, double p_component);
185 /** Get sqrt(e^2-p^2) */
186 virtual double getVirtuality();
189 /** check that the 4 momentum in conserved at the vertices producing
190 and ending this particle */
191 virtual bool checkMomentumConservation()=0;
193 /** Returns the px component of the four vector */
194 virtual double getPx()=0;
196 /** Returns the py component of the four vector */
197 virtual double getPy()=0;
199 /** Returns the pz component of the four vector */
200 virtual double getPz()=0;
202 /** Returns the energy component of the four vector */
203 virtual double getE()=0;
205 /** Get the invariant mass from the event record*/
206 virtual double getMass() = 0;
208 /** Set the px component of the four vector */
209 virtual void setPx( double px )=0;
211 /** Set the px component of the four vector */
212 virtual void setPy( double py )=0;
214 /** Set the pz component of the four vector */
215 virtual void setPz( double pz )=0;
217 /** Set the energy component of the four vector */
218 virtual void setE( double e )=0;
220 /** Set the mothers of this particle via a vector of PhotosParticle */
221 virtual void setMothers(std::vector<PhotosParticle*> mothers)=0;
223 /** Set the daughters of this particle via a vector of PhotosParticle */
224 virtual void setDaughters(std::vector<PhotosParticle*> daughters)=0;
226 /** Add a new daughter to this particle */
227 virtual void addDaughter(PhotosParticle* daughter)=0;
229 /** Returns the mothers of this particle via a vector of PhotosParticle */
230 virtual std::vector<PhotosParticle*> getMothers()=0;
232 /** Returns the daughters of this particle via a vector of PhotosParticle */
233 virtual std::vector<PhotosParticle*> getDaughters()=0;
235 /** Returns all particles in the decay tree of this particle
236 via a vector of PhotosParticle */
237 virtual std::vector<PhotosParticle*> getAllDecayProducts()=0;
239 /** Set the PDG ID code of this particle */
240 virtual void setPdgID(int pdg_id)=0;
242 /** Set the mass of this particle */
243 virtual void setMass(double mass)=0;
245 /** Set the status of this particle */
246 virtual void setStatus(int status)=0;
248 /** Get the PDG ID code of this particle */
249 virtual int getPdgID()=0;
251 /** Get the status of this particle */
252 virtual int getStatus()=0;
254 /** Get the barcode of this particle */
255 virtual int getBarcode()=0;
257 /** Create a new particle of the same type, with the given
258 properties. The new particle bares no relations to this
259 particle, but it provides a way of creating a intance of
260 the derived class. eg. createNewParticle() is used inside
261 filhep_() so that an eg. PhotosHepMCParticle is created without
262 the method having explicit knowledge of the PhotosHepMCParticle
264 virtual PhotosParticle * createNewParticle(int pdg_id, int status,
265 double mass, double px,
266 double py, double pz,
269 /** Create history entry of this particle before modifications
270 of PHOTOS. Implementation of this method depends strongly
271 on the event record. */
272 virtual void createHistoryEntry()=0;
274 /** Create a self-decay vertex for this particle
275 with 'out' being the outgoing particle in new vertex */
276 virtual void createSelfDecayVertex(PhotosParticle *out)=0;
278 /** Print some information about this particle to standard output */
279 virtual void print()=0;
282 } // namespace Photospp