00001 #ifndef _TauolaHepMCParticle_h_included_ 00002 #define _TauolaHepMCParticle_h_included_ 00003 00004 /** 00005 * @class TauolaHepMCParticle 00006 * 00007 * @brief Interface to HepMC::GenParticle objects 00008 * 00009 * This class implements the virtual methods of 00010 * TauolaParticle. In this way it provides an 00011 * interface between the generic TauolaParticle class 00012 * and a HepMC::GenParticle object. 00013 * 00014 * @author Nadia Davidson 00015 * @date 17 June 2008 00016 * 00017 * This code is licensed under GNU General Public Licence. 00018 * For more informations, see: http://www.gnu.org/licenses/ 00019 */ 00020 00021 #include <iostream> 00022 #include <vector> 00023 00024 #include "HepMC/GenParticle.h" 00025 #include "HepMC/SimpleVector.h" 00026 #include "HepMC/GenEvent.h" 00027 00028 //#include "DecayList.h" 00029 #include "TauolaParticle.h" 00030 #include "f_Decay.h" 00031 00032 namespace Tauolapp 00033 { 00034 00035 class TauolaHepMCParticle: public TauolaParticle{ 00036 00037 public: 00038 /** General constructor */ 00039 TauolaHepMCParticle(); 00040 00041 ~TauolaHepMCParticle(); 00042 00043 /** Constructor which keeps a pointer to the HepMC::GenParticle*/ 00044 TauolaHepMCParticle(HepMC::GenParticle * particle); 00045 00046 /** Constructor which creates a new HepMC::GenParticle and 00047 sets the properties pdg_id, statu and mass. */ 00048 TauolaHepMCParticle(int pdg_id, int status, double mass); 00049 00050 /** Returns the HepMC::GenParticle */ 00051 HepMC::GenParticle * getHepMC(); 00052 00053 /** Remove the decay branch from the event record and reset the particle status code to stable. */ 00054 void undecay(); 00055 00056 /** Set the mothers of this particle via a vector of TauolaParticle*/ 00057 void setMothers(std::vector<TauolaParticle*> mothers); 00058 00059 /** Set the daughters of this particle via a vector of TauolaParticle*/ 00060 void setDaughters(std::vector<TauolaParticle*> daughters); 00061 00062 /** Returns the mothers of this particle via a vector of TauolaParticle */ 00063 std::vector<TauolaParticle*> getMothers(); 00064 00065 /** Returns the daughters of this particle via a vector of TauolaParticle */ 00066 std::vector<TauolaParticle*> getDaughters(); 00067 00068 /** Set the PDG ID code of this particle */ 00069 void setPdgID(int pdg_id); 00070 00071 /** Set the status of this particle */ 00072 void setStatus(int statu); 00073 00074 /** Set the mass of this particle */ 00075 void setMass(double mass); 00076 00077 /** Get the PDG ID code of this particle */ 00078 int getPdgID(); 00079 00080 /** Get the status of this particle */ 00081 int getStatus(); 00082 00083 /** Get the barcode of this particle */ 00084 int getBarcode(); 00085 00086 /** Check that the 4 momentum in conserved at the vertices producing 00087 and ending this particle */ 00088 void checkMomentumConservation(); 00089 00090 /** Overriding of TauolaParticle decayEndgame method. 00091 Converts the momentum and length units 00092 and sets the vector (X,T) position */ 00093 void decayEndgame(); 00094 00095 /** Create a new particle of type TauolaHepMCParticle, with the given 00096 properties. The new particle bares no relations to this 00097 particle, but it provides a way of creating a instance of 00098 this derived class. eg. createNewParticle() is used inside 00099 filhep_() so that a TauolaHepMCParticle can be created without 00100 the method having explicit knowledge of the TauolaHepMCParticle 00101 class */ 00102 TauolaHepMCParticle * createNewParticle(int pdg_id, int status, double mass, 00103 double px, double py, 00104 double pz, double e); 00105 00106 /** Print some information about this particle to standard output */ 00107 void print(); 00108 00109 /** Returns the px component of the four vector*/ 00110 double getPx(); 00111 00112 /** Returns the py component of the four vector */ 00113 double getPy(); 00114 00115 /** Returns the pz component of the four vector */ 00116 double getPz(); 00117 00118 /** Returns the energy component of the four vector */ 00119 double getE(); 00120 00121 /** Set the px component of the four vector */ 00122 void setPx( double px ); 00123 00124 /** Set the px component of the four vector */ 00125 void setPy( double py ); 00126 00127 /** Set the pz component of the four vector */ 00128 void setPz( double pz ); 00129 00130 /** Set the energy component of the four vector */ 00131 void setE( double e ); 00132 00133 00134 private: 00135 00136 /** Sets the position for whole decay tree starting from given particle */ 00137 void recursiveSetPosition(HepMC::GenParticle *p,HepMC::FourVector pos); 00138 00139 /** A pointer to the HepMC::GenParticle particle */ 00140 HepMC::GenParticle * m_particle; 00141 00142 /** A list of mothers */ 00143 std::vector<TauolaParticle*> m_mothers; 00144 00145 /** A list of daughters */ 00146 std::vector<TauolaParticle*> m_daughters; 00147 00148 /** List to keep track of new particles which have been 00149 created from this one, so we can call their destructor later */ 00150 std::vector<TauolaParticle*> m_created_particles; 00151 00152 }; 00153 00154 } // namespace Tauolapp 00155 #endif 00156