00001 // -*- C++ -*- 00002 // $Id: TruthVertex_v1.h 624338 2014-10-27 15:08:55Z krasznaa $ 00003 #ifndef XAODTRUTH_VERSIONS_TRUTHVERTEX_V1_H 00004 #define XAODTRUTH_VERSIONS_TRUTHVERTEX_V1_H 00005 00006 // ROOT include(s): 00007 #include <TLorentzVector.h> 00008 00009 // EDM include(s): 00010 #include "AthContainers/AuxElement.h" 00011 #include "AthLinks/ElementLink.h" 00012 00013 // xAOD include(s): 00014 #include "xAODBase/ObjectType.h" 00015 00016 // Local include(s): 00017 #include "xAODTruth/TruthParticleContainerFwd.h" 00018 00019 namespace xAOD { 00020 00033 class TruthVertex_v1 : public SG::AuxElement { 00034 00035 public: 00037 TruthVertex_v1(); 00038 00041 00043 void setId( int value ); 00045 int id() const; 00046 00048 void setBarcode( int value ); 00050 int barcode() const; 00051 00053 00056 00058 typedef ElementLink< TruthParticleContainer > TPLink_t; 00060 typedef std::vector< TPLink_t > TPLinks_t; 00061 00063 const TPLinks_t& incomingParticleLinks() const; 00065 void setIncomingParticleLinks( const TPLinks_t& links ); 00067 size_t nIncomingParticles() const; 00069 const TruthParticle_v1* incomingParticle( size_t index ) const; 00071 void addIncomingParticleLink( const TPLink_t& link ); 00073 void clearIncomingParticleLinks(); 00074 00076 const TPLinks_t& outgoingParticleLinks() const; 00078 void setOutgoingParticleLinks( const TPLinks_t& links ); 00080 size_t nOutgoingParticles() const; 00082 const TruthParticle_v1* outgoingParticle( size_t index ) const; 00084 void addOutgoingParticleLink( const TPLink_t& link ); 00086 void clearOutgoingParticleLinks(); 00087 00089 00092 00094 float x() const; 00096 void setX( float value ); 00097 00099 float y() const; 00101 void setY( float value ); 00102 00104 float z() const; 00106 void setZ( float value ); 00107 00109 float perp() const; 00111 float eta() const; 00113 float phi() const; 00114 00116 float t() const; 00118 void setT( float value ); 00119 00121 typedef TLorentzVector FourVec_t; 00122 00124 const FourVec_t& v4() const; 00125 00127 00129 Type::ObjectType type() const; 00130 00132 void toPersistent(); 00133 00134 private: 00136 mutable FourVec_t m_v4; 00138 mutable bool m_v4Cached; 00139 00140 }; // class TruthVertex_v1 00141 00142 } // namespace xAOD 00143 00144 // Declare the inheritance of the type to StoreGate: 00145 #include "xAODCore/BaseInfo.h" 00146 SG_BASE( xAOD::TruthVertex_v1, SG::AuxElement ); 00147 00148 #endif // XAODTRUTH_VERSIONS_TRUTHVERTEX_V1_H