00001 #ifndef _TauolaHEPEVTParticle_h_included_ 00002 #define _TauolaHEPEVTParticle_h_included_ 00003 00004 /** 00005 * @class TauolaHEPEVTParticle 00006 * 00007 * @brief Single particle of HEPEVT event record 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 information stored in HEPEVT event record. 00013 * 00014 * @author Tomasz Przedzinski 00015 * @date 24 November 2011 00016 */ 00017 00018 #include <iostream> 00019 #include <vector> 00020 00021 #include "f_Decay.h" 00022 #include "TauolaParticle.h" 00023 #include "TauolaHEPEVTEvent.h" 00024 00025 namespace Tauolapp 00026 { 00027 00028 class TauolaHEPEVTEvent; 00029 00030 class TauolaHEPEVTParticle: public TauolaParticle { 00031 00032 public: 00033 /** Default destructor */ 00034 ~TauolaHEPEVTParticle(); 00035 00036 /** Default constructor */ 00037 TauolaHEPEVTParticle(int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de); 00038 00039 /** Remove the decay branch from the event record and reset the particle status code to stable. 00040 WARNING: not implemented for HEPEVT. */ 00041 void undecay(); 00042 00043 /** Set the mothers of this particle via a vector of TauolaParticle*/ 00044 void setMothers(std::vector<TauolaParticle*> mothers); 00045 00046 /** Set the daughters of this particle via a vector of TauolaParticle*/ 00047 void setDaughters(std::vector<TauolaParticle*> daughters); 00048 00049 /** Returns the mothers of this particle via a vector of TauolaParticle */ 00050 std::vector<TauolaParticle*> getMothers(); 00051 00052 /** Returns the daughters of this particle via a vector of TauolaParticle */ 00053 std::vector<TauolaParticle*> getDaughters(); 00054 00055 /** Check that the 4 momentum in conserved in the decay of this particle */ 00056 void checkMomentumConservation(); 00057 00058 /** Creates a new particle of type TauolaHEPEVTParticle, with the given 00059 properties. The new particle bares no relations to this 00060 particle, but `this particle' provides only a way of creating an instance of 00061 this derived class. eg. createNewParticle() is used inside 00062 filhep_() so that a TauolaHEPEVTParticle can be created without 00063 the method having explicit knowledge of the TauolaHEPEVTParticle 00064 class */ 00065 TauolaHEPEVTParticle * createNewParticle(int pdg_id, int status, double mass, 00066 double px, double py, 00067 double pz, double e); 00068 00069 /** Check if particle 'p' is daughter of this particle */ 00070 bool isDaughterOf(TauolaHEPEVTParticle *p); 00071 00072 /** Check if particle 'p' is mother of this particle */ 00073 bool isMotherOf (TauolaHEPEVTParticle *p); 00074 00075 /** Print information on this particle into standard output */ 00076 void print(); 00077 00078 /** Set the PDG ID code of this particle */ 00079 void setPdgID(int pdg_id); 00080 00081 /** Set the status of this particle */ 00082 void setStatus(int statu); 00083 00084 /** Set the mass of this particle */ 00085 void setMass(double mass); 00086 00087 /** Get the PDG ID code of this particle */ 00088 int getPdgID(); 00089 00090 /** Get the status of this particle */ 00091 int getStatus(); 00092 00093 /** Get the mass stored (i.e. not calculated from four vector) at generation step */ 00094 double getMass(); 00095 00096 /** Returns the px component of the four vector*/ 00097 double getPx(); 00098 00099 /** Returns the py component of the four vector */ 00100 double getPy(); 00101 00102 /** Returns the pz component of the four vector */ 00103 double getPz(); 00104 00105 /** Returns the energy component of the four vector */ 00106 double getE(); 00107 00108 /** Set the px component of the four vector */ 00109 void setPx( double px ); 00110 00111 /** Set the px component of the four vector */ 00112 void setPy( double py ); 00113 00114 /** Set the pz component of the four vector */ 00115 void setPz( double pz ); 00116 00117 /** Set the energy component of the four vector */ 00118 void setE( double e ); 00119 00120 /** Get the barcode (position in list) of this particle */ 00121 int getBarcode(); 00122 00123 /** Set barcode (position in list) of this particle */ 00124 void setBarcode(int barcode); 00125 00126 /** Set event of this particle */ 00127 void setEvent(TauolaHEPEVTEvent *event); 00128 00129 /** Get index of first mother */ 00130 int getFirstMotherIndex(); 00131 00132 /** Get index of second mother */ 00133 int getSecondMotherIndex(); 00134 00135 /** Get index of first daughter */ 00136 int getDaughterRangeStart(); 00137 00138 /** Get index of last daughter */ 00139 int getDaughterRangeEnd(); 00140 00141 private: 00142 00143 /** Event from which this particle is taken */ 00144 TauolaHEPEVTEvent *m_event; 00145 00146 /** Position in the event record */ 00147 int m_barcode; 00148 00149 /** Indexes of mothers (-1 if do not have mothers) */ 00150 int m_first_mother, m_second_mother; 00151 00152 /** Range of indexes of daughters (-1 if do not have daughters) */ 00153 int m_daughter_start, m_daughter_end; 00154 00155 /** PDG ID */ 00156 int m_pdgid; 00157 00158 /** Status (stable, decayed) */ 00159 int m_status; 00160 00161 /** Momentum */ 00162 double m_px, m_py, m_pz, m_e; 00163 00164 /** Mass saved at generation step */ 00165 double m_generated_mass; 00166 00167 /** List of created particles - if they are not in the event, they 00168 will be deleted when no longer needed */ 00169 vector<TauolaHEPEVTParticle*> cache; 00170 }; 00171 00172 } // namespace Tauolapp 00173 #endif 00174