00001
00002
00003 #ifndef XAODPFLOW_VERSIONS_PFO_V1_H
00004 #define XAODPFLOW_VERSIONS_PFO_V1_H
00005
00006
00007
00008
00009 #include "AthLinks/ElementLink.h"
00010 #include "AthLinks/ElementLinkVector.h"
00011
00012
00013 #include "xAODBase/IParticle.h"
00014 #include "xAODBase/IParticleContainer.h"
00015 #include "xAODPFlow/PFODefs.h"
00016 #include "xAODCaloEvent/CaloCluster.h"
00017 #include "xAODCaloEvent/CaloClusterContainer.h"
00018 #include "xAODTracking/VertexContainer.h"
00019 #include "xAODTracking/TrackParticle.h"
00020 #include "xAODTracking/TrackParticleContainer.h"
00021
00022
00023 #include "TVector3.h"
00024
00025 namespace xAOD {
00026
00027
00030 class PFO_v1 : public IParticle {
00031
00032 public:
00034 PFO_v1();
00036 PFO_v1(const PFO_v1& other);
00037
00038
00041
00043 virtual double pt() const;
00045 virtual double eta() const;
00047 virtual double phi() const;
00049 virtual double m() const;
00051 virtual double e() const;
00053 virtual double rapidity() const;
00054
00056 virtual const FourMom_t& p4() const;
00057
00059 virtual Type::ObjectType type() const;
00060
00062
00064 void setP4(const FourMom_t& vec);
00065
00067 void setP4(float pt, float eta, float phi, float m=0.0);
00068
00070 const FourMom_t& p4EM() const;
00072 void setP4EM(const FourMom_t& p4EM);
00074 void setP4EM(float pt, float eta, float phi, float m);
00075
00077 virtual double ptEM() const;
00079 virtual double etaEM() const;
00081 virtual double phiEM() const;
00083 virtual double mEM() const;
00085 virtual double eEM() const;
00086
00087
00088
00090 float bdtPi0Score() const;
00092 void setBDTPi0Score(float BDTPi0Score);
00093
00095 float centerMag() const;
00097 void setCenterMag(float CenterMag);
00098
00100 float charge() const;
00102 void setCharge(float charge);
00103
00105 template<class T> void setAttribute(PFODetails::PFOAttributes AttributeType, const T& anAttribute) ;
00107 template<class T> bool attribute(PFODetails::PFOAttributes AttributeType, T& anAttribute) const;
00108
00110 template<class T> void setAttribute(const std::string& AttributeType, const T& anAttribute) ;
00112 template<class T> bool attribute(const std::string& AttributeType, T& anAttribute) const;
00113
00115 bool getClusterMoment(float& theMoment, xAOD::CaloCluster::MomentType momentType) const;
00116
00118 const CaloCluster* cluster(unsigned int index) const;
00120 const TrackParticle* track(unsigned int index) const;
00122 const xAOD::Vertex* vertex() const;
00123
00125 bool setVertexLink(const ElementLink< xAOD::VertexContainer>& theVertexLink);
00126
00128 bool setTrackLink(const ElementLink<xAOD::TrackParticleContainer>& theTrack);
00130 bool setClusterLink(const ElementLink<xAOD::CaloClusterContainer>& theCluster);
00132 bool setAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink<IParticleContainer>& theParticle);
00134 void setAssociatedParticleLink(const std::string& ParticleType, const ElementLink<IParticleContainer>& theParticle);
00135
00136
00138 bool setAssociatedParticleLinks(PFODetails::PFOParticleType ParticleType, const std::vector<ElementLink<IParticleContainer> >& theParticles) ;
00140 bool associatedParticles(PFODetails::PFOParticleType ParticleType, std::vector<const IParticle*>& theParticles ) const;
00142 void setAssociatedParticleLinks(const std::string& ParticleType, const std::vector<ElementLink<IParticleContainer> >& theParticles) ;
00144 bool associatedParticles(const std::string& ParticleType, std::vector<const IParticle*>& theParticles ) const;
00145
00147 TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex& vertexToCorrectTo) const;
00149 TLorentzVector GetVertexCorrectedFourVec(const TVector3& vertexToCorrectTo) const;
00150
00152 TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex& vertexToCorrectTo) const;
00154 TLorentzVector GetVertexCorrectedEMFourVec(const TVector3& vertexToCorrectTo) const;
00155
00157 void toPersistent();
00158
00159 private:
00160
00162 void VertexCorrectTheFourVector(const TVector3& vertexToCorrectTo, TLorentzVector& theFourVector) const;
00163
00165 bool getAttributeName_FromClusterMoment(xAOD::PFODetails::PFOAttributes& myAttribute, xAOD::CaloCluster::MomentType& momentType) const;
00166
00168 bool isJetETMissFloatForCompression(xAOD::PFODetails::PFOAttributes AttributeType) const;
00169
00171 mutable FourMom_t m_p4;
00173 mutable bool m_p4Cached;
00175 mutable FourMom_t m_p4EM;
00177 mutable bool m_p4EMCached;
00179 int m_floatCompressionFactor;
00180
00181 };
00182
00183 }
00184
00185
00186 #include "AthContainers/DataVector.h"
00187 DATAVECTOR_BASE( xAOD::PFO_v1, xAOD::IParticle );
00188
00189 #include "xAODPFlow/versions/PFO_v1.icc"
00190
00191 #endif // XAODPFLOW_VERSIONS_PFO_V1_H