Belle II Software  release-06-01-15
PhotosParticle.h
1 #ifndef _PhotosParticle_h_included_
2 #define _PhotosParticle_h_included_
3 
19 #include <vector>
20 #include "Photos.h"
21 
22 namespace Photospp {
23 
25  public:
27  static const int STABLE = 1;
28 
30  static const int DECAYED = 2;
31 
33  static const int HISTORY = 3;
34 
36  static const int X_AXIS = 1;
37 
39  static const int Y_AXIS = 2;
40 
42  static const int Z_AXIS = 3;
43 
45  static const int Z0 = 23;
46 
48  static const int HIGGS = 25;
49 
51  static const int HIGGS_H = 35;
52 
54  static const int HIGGS_A = 36;
55 
57  static const int HIGGS_PLUS = 37;
58 
60  static const int HIGGS_MINUS = -37;
61 
63  static const int W_PLUS = 24;
64 
66  static const int W_MINUS = -24;
67 
69  static const int GAMMA = 22;
70 
72  static const int TAU_PLUS = -15;
73 
75  static const int TAU_MINUS = 15;
76 
78  static const int TAU_NEUTRINO = 16;
79 
81  static const int TAU_ANTINEUTRINO = -16;
82 
84  static const int MUON_PLUS = -13;
85 
87  static const int MUON_MINUS = 13;
88 
90  static const int MUON_NEUTRINO = 14;
91 
93  static const int MUON_ANTINEUTRINO = -14;
94 
96  static const int POSITRON = -11;
97 
99  static const int ELECTRON = 11;
100 
102  static const int ELECTRON_NEUTRINO = 12;
103 
105  static const int ELECTRON_ANTINEUTRINO = -12;
106 
108  static const int UP = 2;
109 
111  static const int ANTIUP = -2;
112 
114  static const int DOWN = 1;
115 
117  static const int ANTIDOWN = -1;
118 
120  static const int OTHER = 0;
121 
122  public:
123  virtual ~PhotosParticle() {};
124 
126  bool hasDaughters();
127 
132 
135  std::vector<PhotosParticle*> findProductionMothers();
136 
138  std::vector<PhotosParticle*> getDecayTree();
139 
142  void boostToRestFrame(PhotosParticle* boost);
143 
147 
150  void boostFromRestFrame(PhotosParticle* boost);
151 
155 
157  void boostAlongZ(double pz, double e);
158 
161  void rotate(int axis, double phi, int second_axis = Z_AXIS);
162 
165  void rotateDaughters(int axis, double phi, int second_axis = Z_AXIS);
166 
172  double getRotationAngle(int axis, int second_axis = Z_AXIS);
173 
175  double getP();
176 
178  double getP(int axis);
179 
181  void setP(int axis, double p_component);
182 
184  virtual double getVirtuality();
185 
186  public:
189  virtual bool checkMomentumConservation() = 0;
190 
192  virtual double getPx() = 0;
193 
195  virtual double getPy() = 0;
196 
198  virtual double getPz() = 0;
199 
201  virtual double getE() = 0;
202 
204  virtual double getMass() = 0;
205 
207  virtual void setPx(double px) = 0;
208 
210  virtual void setPy(double py) = 0;
211 
213  virtual void setPz(double pz) = 0;
214 
216  virtual void setE(double e) = 0;
217 
219  virtual void setMothers(std::vector<PhotosParticle*> mothers) = 0;
220 
222  virtual void setDaughters(std::vector<PhotosParticle*> daughters) = 0;
223 
225  virtual void addDaughter(PhotosParticle* daughter) = 0;
226 
228  virtual std::vector<PhotosParticle*> getMothers() = 0;
229 
231  virtual std::vector<PhotosParticle*> getDaughters() = 0;
232 
235  virtual std::vector<PhotosParticle*> getAllDecayProducts() = 0;
236 
238  virtual void setPdgID(int pdg_id) = 0;
239 
241  virtual void setMass(double mass) = 0;
242 
244  virtual void setStatus(int status) = 0;
245 
247  virtual int getPdgID() = 0;
248 
250  virtual int getStatus() = 0;
251 
253  virtual int getBarcode() = 0;
254 
262  virtual PhotosParticle* createNewParticle(int pdg_id, int status,
263  double mass, double px,
264  double py, double pz,
265  double e) = 0;
266 
270  virtual void createHistoryEntry() = 0;
271 
274  virtual void createSelfDecayVertex(PhotosParticle* out) = 0;
275 
277  virtual void print() = 0;
278  };
279 
280 } // namespace Photospp
281 #endif
virtual void print()=0
Print some information about this particle to standard output.
static const int TAU_PLUS
tau+ particle
virtual void setDaughters(std::vector< PhotosParticle * > daughters)=0
Set the daughters of this particle via a vector of PhotosParticle.
static const int GAMMA
photon
virtual void setE(double e)=0
Set the energy component of the four vector.
static const int HIGGS_H
H0 particle.
static const int MUON_NEUTRINO
muon neutrino particle
static const int MUON_MINUS
muon- particle
static const int STABLE
Stable particle status.
void rotate(int axis, double phi, int second_axis=Z_AXIS)
rotate this particles 4-momentum by an angle phi from the axisis "axis" towards the axis "second_axis...
static const int Y_AXIS
Y Axis.
static const int W_MINUS
W- particle.
virtual void setMothers(std::vector< PhotosParticle * > mothers)=0
Set the mothers of this particle via a vector of PhotosParticle.
static const int TAU_ANTINEUTRINO
tau antineutrino particle
virtual void setStatus(int status)=0
Set the status of this particle.
static const int DOWN
down quark
static const int ELECTRON
e- particle
static const int HIGGS_PLUS
H+ particle.
static const int ELECTRON_NEUTRINO
e neutrino particle
PhotosParticle * findLastSelf()
Traverse the event structure and find the final version of this particle which does not have a partic...
virtual bool checkMomentumConservation()=0
check that the 4 momentum in conserved at the vertices producing and ending this particle
void boostToRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the lab frome into the rest frame of the paramter PhotosP...
virtual int getBarcode()=0
Get the barcode of this particle.
virtual void setPy(double py)=0
Set the px component of the four vector.
virtual int getPdgID()=0
Get the PDG ID code of this particle.
static const int DECAYED
Decayed particle status.
void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS)
rotate 4-momentum of daughters of this particle by an angle phi from the axisis "axis" towards the ax...
virtual double getPz()=0
Returns the pz component of the four vector.
static const int POSITRON
e+ particle
virtual double getE()=0
Returns the energy component of the four vector.
virtual double getPy()=0
Returns the py component of the four vector.
static const int TAU_MINUS
tau- particle
static const int ANTIUP
anti-up quark
virtual double getPx()=0
Returns the px component of the four vector.
virtual void setMass(double mass)=0
Set the mass of this particle.
void setP(int axis, double p_component)
Set momentum component in the direction of "axis" (x,y,z)
virtual void setPdgID(int pdg_id)=0
Set the PDG ID code of this particle.
static const int MUON_ANTINEUTRINO
muon antineutrino particle
virtual void createHistoryEntry()=0
Create history entry of this particle before modifications of PHOTOS.
std::vector< PhotosParticle * > getDecayTree()
Return whole decay tree starting from this particle.
virtual std::vector< PhotosParticle * > getDaughters()=0
Returns the daughters of this particle via a vector of PhotosParticle.
static const int ANTIDOWN
anti-down quark
virtual std::vector< PhotosParticle * > getMothers()=0
Returns the mothers of this particle via a vector of PhotosParticle.
virtual double getVirtuality()
Get sqrt(e^2-p^2)
static const int ELECTRON_ANTINEUTRINO
e antineutrino particle
std::vector< PhotosParticle * > findProductionMothers()
Traverse the event structure and find the first set of mothers which are not of the same type as this...
static const int TAU_NEUTRINO
tau neutrino particle
virtual void setPx(double px)=0
Set the px component of the four vector.
static const int Z0
Z0 particle.
static const int Z_AXIS
Z Axis.
bool hasDaughters()
Return whether the particle has any chidren.
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
Returns all particles in the decay tree of this particle via a vector of PhotosParticle.
void boostAlongZ(double pz, double e)
Do a Lorenz transformation along the Z axis.
static const int HIGGS_A
A0 particle.
virtual int getStatus()=0
Get the status of this particle.
static const int MUON_PLUS
muon+ particle
static const int UP
up quark
double getP()
Get scalar momentum.
virtual void setPz(double pz)=0
Set the pz component of the four vector.
static const int W_PLUS
W+ particle.
double getRotationAngle(int axis, int second_axis=Z_AXIS)
Returns the angle around the axis "axis" needed to rotate the four momenum is such a way that the non...
static const int HISTORY
History particle status.
virtual PhotosParticle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)=0
Create a new particle of the same type, with the given properties.
virtual void addDaughter(PhotosParticle *daughter)=0
Add a new daughter to this particle.
virtual void createSelfDecayVertex(PhotosParticle *out)=0
Create a self-decay vertex for this particle with 'out' being the outgoing particle in new vertex.
virtual double getMass()=0
Get the invariant mass from the event record.
static const int X_AXIS
X Axis.
void boostDaughtersFromRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the lab frame to the rest frame of the parameter PhotosPa...
static const int HIGGS
H particle.
static const int HIGGS_MINUS
H- particle.
void boostFromRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the rest frame of the paramter PhotosParticle,...
void boostDaughtersToRestFrame(PhotosParticle *boost)
Transform the four momentum of all the daughters recursively into the frame of the "particle" PhotosP...
static const int OTHER
All other particle types.