00001 // -*- C++ -*- 00002 // $Id: TruthParticle_v1.h 624338 2014-10-27 15:08:55Z krasznaa $ 00003 #ifndef XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H 00004 #define XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H 00005 00006 // EDM include(s): 00007 #include "AthLinks/ElementLink.h" 00008 00009 // xAOD include(s): 00010 #include "xAODBase/IParticle.h" 00011 #include "xAODBase/ObjectType.h" 00012 00013 // Local include(s): 00014 #include "xAODTruth/TruthVertexContainerFwd.h" 00015 00016 namespace xAOD { 00017 00031 class TruthParticle_v1 : public IParticle { 00032 00033 public: 00035 TruthParticle_v1(); 00036 00039 00041 void setPdgId( int pid ); 00043 int pdgId() const; 00045 int absPdgId() const; 00046 00049 int barcode() const; 00051 void setBarcode( int value ); 00052 00054 int status() const; 00056 void setStatus( int value ); 00057 00059 00062 00064 bool hasProdVtx() const; 00066 const TruthVertex_v1* prodVtx() const; 00068 const ElementLink< TruthVertexContainer >& prodVtxLink() const; 00070 void setProdVtxLink( const ElementLink< TruthVertexContainer >& link ); 00071 00073 bool hasDecayVtx() const; 00075 const TruthVertex_v1* decayVtx() const; 00077 const ElementLink< TruthVertexContainer >& decayVtxLink() const; 00079 void setDecayVtxLink( const ElementLink< TruthVertexContainer >& link ); 00080 00082 00085 00087 size_t nParents() const; 00088 00090 const TruthParticle_v1* parent( size_t i = 0 ) const; 00091 00093 size_t nChildren() const; 00094 00096 const TruthParticle_v1* child( size_t i = 0 ) const; 00097 00101 00103 00105 00108 00110 virtual double pt() const; 00112 virtual double eta() const; 00114 virtual double phi() const; 00119 virtual double m() const; 00121 virtual double e() const; 00123 virtual double rapidity() const; 00124 00126 typedef IParticle::FourMom_t FourMom_t; 00127 00133 virtual const FourMom_t& p4() const; 00134 00136 virtual Type::ObjectType type() const; 00137 00139 00142 00145 double abseta() const; 00148 double absrapidity() const; 00149 00151 float px() const; 00153 void setPx( float value ); 00154 00156 float py() const; 00158 void setPy( float value ); 00159 00161 float pz() const; 00163 void setPz( float value ); 00164 00166 void setE( float value ); 00167 00169 void setM( float value ); 00170 00172 00179 00181 double charge() const; 00183 int threeCharge() const; 00184 00186 bool isCharged() const; 00188 bool isNeutral() const; 00189 00191 bool isPhoton() const; 00193 bool isLepton() const; 00195 bool isChLepton() const; 00197 bool isElectron() const; 00199 bool isMuon() const; 00201 bool isTau() const; 00203 bool isNeutrino() const; 00204 00206 bool isHadron() const; 00208 bool isMeson() const; 00210 bool isBaryon() const; 00211 00213 bool hasStrange() const; 00215 bool hasCharm() const; 00217 bool hasBottom() const; 00218 00220 bool isLightMeson() const; 00222 bool isLightBaryon() const; 00224 bool isLightHadron() const; 00225 00227 bool isHeavyMeson() const; 00229 bool isHeavyBaryon() const; 00231 bool isHeavyHadron() const; 00232 00234 bool isBottomMeson() const; 00236 bool isBottomBaryon() const; 00238 bool isBottomHadron() const; 00239 00245 bool isCharmMeson() const; 00252 bool isCharmBaryon() const; 00254 bool isCharmHadron() const; 00255 00257 bool isStrangeMeson() const; 00259 bool isStrangeBaryon() const; 00261 bool isStrangeHadron() const; 00262 00264 bool isQuark() const; 00266 bool isParton() const; 00268 bool isTop() const; 00270 bool isW() const; 00272 bool isZ() const; 00274 bool isHiggs() const; 00276 bool isResonance() const; 00278 bool isGenSpecific() const; 00279 00281 00284 00286 enum PolParam { 00287 polarizationPhi = 0, 00288 polarizationTheta = 1 00289 }; 00290 00303 bool polarizationParameter( float& value, PolParam parameter ) const; 00304 00317 bool setPolarizationParameter( float value, PolParam parameter ); 00318 00329 float polarizationPatameter( PolParam parameter ) const; 00330 00336 struct Polarization { 00337 00340 Polarization() 00341 : phi( -1.0 ), theta( -1.0 ) {} 00342 00344 bool valid() const { 00345 return ( ( phi > 0.0 ) && ( theta > 0.0 ) ); 00346 } 00347 00348 float phi; 00349 float theta; 00350 00351 }; // struct Polarization 00352 00359 Polarization polarization() const; 00360 00362 00364 void toPersistent(); 00365 00366 private: 00368 mutable FourMom_t m_p4; 00370 mutable bool m_p4Cached; 00371 00372 }; // class TruthParticle_v1 00373 00374 } // namespace xAOD 00375 00376 #endif // XAODTRUTH_VERSIONS_TRUTHPARTICLE_V1_H