00001 #ifndef _TauolaParticle_h_included_ 00002 #define _TauolaParticle_h_included_ 00003 00004 /** 00005 * @class TauolaParticle 00006 * 00007 * @brief Abstract base class for particle in the event. This class also 00008 * handles boosting. 00009 * 00010 * TauolaParticle is a Tauola representation of a particle. It has virtual 00011 * getter and setter methods that need to be implemented by a derived class. 00012 * An example of this is TauolaHepMCParticle. In this way it provides an 00013 * interface to the information in the Event Record. 00014 * 00015 * The class is also responsible for decays and contains the polarimetric 00016 * vector returned from tauola. All boosting is also done here. 00017 * 00018 * @author Nadia Davidson 00019 * @date 16 June 2008 00020 */ 00021 00022 #include <iostream> 00023 #include <math.h> 00024 #include <vector> 00025 00026 #include "DecayList.h" 00027 #include "Tauola.h" 00028 #include "f_Decay.h" 00029 00030 namespace Tauolapp 00031 { 00032 00033 class TauolaParticle{ 00034 00035 public: 00036 00037 virtual ~TauolaParticle(){}; 00038 00039 /** The same sign as decaying particle pdg ID code 00040 given to Tauola object (only meaningful for taus). */ 00041 static const int SAME_SIGN=1; 00042 00043 /** The opposite sign to decaying particle pdg ID code 00044 given to Tauola object (only meaningful for taus). */ 00045 static const int OPPOSITE_SIGN=2; 00046 00047 /** Sign type is not applicable for this particle 00048 (probably it's not a tau). */ 00049 static const int NA_SIGN=3; 00050 00051 /** Stable particle status */ 00052 static const int STABLE=1; 00053 00054 /** Decayed particle status */ 00055 static const int DECAYED=2; 00056 00057 /** History particle status */ 00058 static const int HISTORY=3; 00059 00060 /** X Axis */ 00061 static const int X_AXIS=1; 00062 00063 /** Y Axis */ 00064 static const int Y_AXIS=2; 00065 00066 /** Z Axis */ 00067 static const int Z_AXIS=3; 00068 00069 /** Z0 particle */ 00070 static const int Z0 = 23; 00071 00072 /** H particle */ 00073 static const int HIGGS = 25; 00074 00075 /** A0 particle */ 00076 static const int HIGGS_A = 36; 00077 00078 /** H+ particle */ 00079 static const int HIGGS_PLUS = 37; 00080 00081 /** H- particle */ 00082 static const int HIGGS_MINUS = -37; 00083 00084 00085 /** W+ particle */ 00086 static const int W_PLUS = 24; 00087 00088 /** W- particle */ 00089 static const int W_MINUS = -24; 00090 00091 /** photon */ 00092 static const int GAMMA = 22; 00093 00094 /** tau+ particle */ 00095 static const int TAU_PLUS = -15; 00096 00097 /** tau- particle */ 00098 static const int TAU_MINUS = 15; 00099 00100 /** tau neutrino particle */ 00101 static const int TAU_NEUTRINO = 16; 00102 00103 /** tau antineutrino particle */ 00104 static const int TAU_ANTINEUTRINO = -16; 00105 00106 00107 /** muon+ particle */ 00108 static const int MUON_PLUS = -13; 00109 00110 /** muon- particle */ 00111 static const int MUON_MINUS = 13; 00112 00113 /** muon neutrino particle */ 00114 static const int MUON_NEUTRINO = 14; 00115 00116 /** muon antineutrino particle */ 00117 static const int MUON_ANTINEUTRINO = -14; 00118 00119 00120 /** e+ particle */ 00121 static const int POSITRON = -11; 00122 00123 /** e- particle */ 00124 static const int ELECTRON = 11; 00125 00126 /** e neutrino particle */ 00127 static const int ELECTRON_NEUTRINO = 12; 00128 00129 /** e antineutrino particle */ 00130 static const int ELECTRON_ANTINEUTRINO = -12; 00131 00132 /** up quark */ 00133 static const int UP = 2; 00134 00135 /** anti-up quark */ 00136 static const int ANTIUP = -2; 00137 00138 /** down quark */ 00139 static const int DOWN = 1; 00140 00141 /** anti-down quark */ 00142 static const int ANTIDOWN = -1; 00143 00144 static const int GLUON = 21; 00145 static const int CHARM = 4; 00146 static const int TOP = 6; 00147 static const int STRANGE = 3; 00148 static const int BOTTOM = 5; 00149 00150 /** All other particle types*/ 00151 static const int OTHER = 0; 00152 00153 /** Create a new particle with the same properties as this one. 00154 Mothers and daughters will not be linked. */ 00155 TauolaParticle * clone(); 00156 00157 /** Get the angle between this particle and another particle */ 00158 double getAngle(TauolaParticle *); 00159 00160 /** Add the 4 momentum of another particle to this particle */ 00161 void add(TauolaParticle *); 00162 00163 /** Subtract the 4 momentum of another particle from this particle */ 00164 void subtract(TauolaParticle *); 00165 00166 /** Decay the particle. This calls the decay methods in the 00167 interface to (FORTRAN) tauola. */ 00168 void decay(); 00169 00170 /** Invokes TAUOLA FORTRAN routine DEKAY retrieving the daughters of 00171 decayed tau. */ 00172 void addDecayToEventRecord(); 00173 00174 /** Get whether this particle has the same or opposite sign 00175 to the pdg code given to the Tauola object. (Only relevant 00176 for tau particles).*/ 00177 int getSign(); 00178 00179 /** Get the polarimetric vector of this particle in the direction X. 00180 (Only relevant for tau particles).*/ 00181 double getPolarimetricX(); 00182 00183 /** Get the polarimetric vector of this particle in the direction Y. 00184 (Only relevant for tau particles).*/ 00185 double getPolarimetricY(); 00186 00187 /** Get the polarimetric vector of this particle in the direction Z. 00188 (Only relevant for tau particles).*/ 00189 double getPolarimetricZ(); 00190 00191 /** Return whether the particle has any chidren */ 00192 bool hasDaughters(); 00193 00194 /** Traverse the event structure and find the final version 00195 of this particle which does not have a particle of it's own type 00196 as it's daughter. eg. Generally the final stable copy */ 00197 TauolaParticle * findLastSelf(); 00198 00199 /** Traverse the event structure and find the first set of mothers 00200 which are not of the same type as this particle. */ 00201 std::vector<TauolaParticle *> findProductionMothers(); 00202 00203 /** Transform this particles four momentum from the lab frome 00204 into the rest frame of the paramter TauolaParticle. **/ 00205 void boostToRestFrame(TauolaParticle * boost); 00206 00207 /** Transform the four momentum of all the daughters recursively 00208 into the frame of the "particle" TauolaParticle. **/ 00209 void boostDaughtersToRestFrame(TauolaParticle * boost); 00210 00211 00212 /** Transform this particles four momentum from the rest frame of 00213 the paramter TauolaParticle, back into the lab frame. **/ 00214 void boostFromRestFrame(TauolaParticle * boost); 00215 00216 void boostDaughtersFromRestFrame(TauolaParticle * boost); 00217 00218 /** Do a Lorenz transformation along the Z axis. */ 00219 void boostAlongZ(double pz, double e); 00220 00221 /** rotate this particles 4-momentum by an angle phi from 00222 the axisis "axis" towards the axis "second_axis". */ 00223 void rotate(int axis, double phi, int second_axis=Z_AXIS); 00224 00225 void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS); 00226 00227 /** Returns the angle around the axis "axis" needed to rotate 00228 the four momenum is such a way that the non-Z component 00229 disappears and Z>0. This is used to rotating the coordinate 00230 system into a frame with only a Z component before calling 00231 boostAlongZ().*/ 00232 double getRotationAngle(int axis, int second_axis=Z_AXIS); 00233 00234 /** Get scalar momentum */ 00235 double getP(); 00236 00237 /** Get momentum component in the direction of "axis" (x,y,z) */ 00238 double getP(int axis); 00239 00240 /** Set momentum component in the direction of "axis" (x,y,z) */ 00241 void setP(int axis, double p_component); 00242 00243 /** Get the invariant mass from the four momentum*/ 00244 double getMass(); 00245 00246 00247 00248 /********************************************** 00249 Beginning of virtual methods 00250 00251 ********************************************/ 00252 00253 /** remove the ougoing branch from this particles and reset its status to stable */ 00254 virtual void undecay(){}; 00255 00256 /** check that the 4 momentum in conserved at the vertices producing 00257 and ending this particle */ 00258 virtual void checkMomentumConservation(){}; 00259 00260 /** Optional. Modify particle or decay tree if needed. */ 00261 virtual void decayEndgame(){}; 00262 00263 /** Returns the px component of the four vector*/ 00264 virtual double getPx()=0; 00265 00266 /** Returns the py component of the four vector */ 00267 virtual double getPy()=0; 00268 00269 /** Returns the pz component of the four vector */ 00270 virtual double getPz()=0; 00271 00272 /** Returns the energy component of the four vector */ 00273 virtual double getE()=0; 00274 00275 /** Set the px component of the four vector */ 00276 virtual void setPx( double px )=0; 00277 00278 /** Set the px component of the four vector */ 00279 virtual void setPy( double py )=0; 00280 00281 /** Set the pz component of the four vector */ 00282 virtual void setPz( double pz )=0; 00283 00284 /** Set the energy component of the four vector */ 00285 virtual void setE( double e )=0; 00286 00287 /** Set the mothers of this particle via a vector of TauolaParticle */ 00288 virtual void setMothers(std::vector<TauolaParticle*> mothers)=0; 00289 00290 /** Set the daughters of this particle via a vector of TauolaParticle */ 00291 virtual void setDaughters(std::vector<TauolaParticle*> daughters)=0; 00292 00293 /** Returns the mothers of this particle via a vector of TauolaParticle */ 00294 virtual std::vector<TauolaParticle*> getMothers()=0; 00295 00296 /** Returns the daughters of this particle via a vector of TauolaParticle */ 00297 virtual std::vector<TauolaParticle*> getDaughters()=0; 00298 00299 /** Set the PDG ID code of this particle */ 00300 virtual void setPdgID(int pdg_id)=0; 00301 00302 /** Set the mass of this particle */ 00303 virtual void setMass(double mass)=0; 00304 00305 /** Set the status of this particle */ 00306 virtual void setStatus(int status)=0; 00307 00308 /** Get the PDG ID code of this particle */ 00309 virtual int getPdgID()=0; 00310 00311 /** Get the status of this particle */ 00312 virtual int getStatus()=0; 00313 00314 /** Get the barcode of this particle */ 00315 virtual int getBarcode()=0; 00316 00317 /** Create a new particle of the same type, with the given 00318 properties. The new particle bares no relations to this 00319 particle, but it provides a way of creating a intance of 00320 the derived class. eg. createNewParticle() is used inside 00321 filhep_() so that an eg. TauolaHepMCParticle is created without 00322 the method having explicit knowledge of the TauolaHepMCParticle 00323 class */ 00324 virtual TauolaParticle * createNewParticle(int pdg_id, int status, 00325 double mass, double px, 00326 double py, double pz, 00327 double e)=0; 00328 00329 /** Print some information about this particle to standard output */ 00330 virtual void print()=0; 00331 00332 private: 00333 00334 /** The polarimetric vector of this particle in the direction X. 00335 (Only relevant for tau particles). */ 00336 double m_pol_x; 00337 00338 /** The polarimetric vector of this particle in the direction Y. 00339 (Only relevant for tau particles). */ 00340 double m_pol_y; 00341 00342 /** The polarimetric vector of this particle in the direction Z. 00343 (Only relevant for tau particles). */ 00344 double m_pol_z; 00345 00346 /** Fourth component of the polarimetric vector. Should be the 00347 normalisation (1). (Only relevant for tau particles). */ 00348 double m_pol_n; 00349 }; 00350 00351 } // namespace Tauolapp 00352 #endif 00353