]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/Tauola/TauolaHepMCParticle.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TEvtGen / Tauola / TauolaHepMCParticle.h
1 #ifndef _TauolaHepMCParticle_h_included_
2 #define _TauolaHepMCParticle_h_included_
3
4 /**
5  * @class TauolaHepMCParticle
6  *
7  * @brief Interface to HepMC::GenParticle objects
8  *
9  * This class implements the virtual methods of
10  * TauolaParticle. In this way it provides an
11  * interface between the generic TauolaParticle class
12  * and a HepMC::GenParticle object.
13  *
14  * @author Nadia Davidson
15  * @date 17 June 2008
16  *
17  * This code is licensed under GNU General Public Licence.
18  * For more informations, see: http://www.gnu.org/licenses/
19  */
20
21 #include <iostream>
22 #include <vector>
23
24 #include "HepMC/GenParticle.h"
25 #include "HepMC/SimpleVector.h"
26 #include "HepMC/GenEvent.h"
27
28 //#include "DecayList.h"
29 #include "TauolaParticle.h"
30 #include "f_Decay.h"
31
32 namespace Tauolapp
33 {
34
35 class TauolaHepMCParticle: public TauolaParticle{
36
37  public:
38   /** General constructor */
39   TauolaHepMCParticle();
40
41   ~TauolaHepMCParticle();
42
43   /** Constructor which keeps a pointer to the HepMC::GenParticle*/
44   TauolaHepMCParticle(HepMC::GenParticle * particle); 
45
46   /** Constructor which creates a new HepMC::GenParticle and
47        sets the properties pdg_id, statu and mass. */
48   TauolaHepMCParticle(int pdg_id, int status, double mass);
49   
50   /** Returns the HepMC::GenParticle */
51   HepMC::GenParticle * getHepMC();
52
53   /** Remove the decay branch from the event record and reset the particle status code to stable. */
54   void undecay();
55
56   /** Set the mothers of this particle via a vector of TauolaParticle*/
57   void setMothers(std::vector<TauolaParticle*> mothers);
58
59   /** Set the daughters of this particle via a vector of TauolaParticle*/
60   void setDaughters(std::vector<TauolaParticle*> daughters);
61
62   /** Returns the mothers of this particle via a vector of TauolaParticle */
63   std::vector<TauolaParticle*> getMothers();
64
65   /** Returns the daughters of this particle via a vector of TauolaParticle */
66   std::vector<TauolaParticle*> getDaughters();
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 */
88   void checkMomentumConservation();
89
90   /** Overriding of TauolaParticle decayEndgame method.
91       Converts the momentum and length units
92       and sets the vector (X,T) position */
93   void decayEndgame();
94
95   /** Create a new particle of type TauolaHepMCParticle, with the given
96       properties. The new particle bares no relations to this
97       particle, but it provides a way of creating a instance of
98       this derived class. eg. createNewParticle() is used inside
99       filhep_() so that a TauolaHepMCParticle can be created without
100       the method having explicit knowledge of the TauolaHepMCParticle 
101       class */
102   TauolaHepMCParticle * createNewParticle(int pdg_id, int status, double mass,
103                                           double px, double py,
104                                           double pz, double e);
105
106   /** Print some information about this particle to standard output */
107   void print();
108
109   /** Returns the px component of the four vector*/
110   double getPx();
111
112   /** Returns the py component of the four vector */
113   double getPy();
114
115   /** Returns the pz component of the four vector */
116   double getPz();
117
118   /** Returns the energy component of the four vector */
119   double getE();
120
121   /** Set the px component of the four vector */
122   void setPx( double px );
123
124   /** Set the px component of the four vector */
125   void setPy( double py );
126
127   /** Set the pz component of the four vector */
128   void setPz( double pz );
129
130   /** Set the energy component of the four vector */
131   void setE( double e );
132
133
134 private:
135
136   /** Sets the position for whole decay tree starting from given particle */
137   void recursiveSetPosition(HepMC::GenParticle *p,HepMC::FourVector pos);
138
139   /** A pointer to the HepMC::GenParticle particle */
140   HepMC::GenParticle * m_particle;
141
142   /** A list of mothers */
143   std::vector<TauolaParticle*> m_mothers;
144
145   /** A list of daughters */
146   std::vector<TauolaParticle*> m_daughters;
147
148   /** List to keep track of new particles which have been
149       created from this one, so we can call their destructor later */
150   std::vector<TauolaParticle*> m_created_particles;
151
152 };
153
154 } // namespace Tauolapp
155 #endif  
156