ATLAS Offline Software
PFO_v1.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: PFO_v1.h 783497 2016-11-10 15:00:53Z mhodgkin $
8 #ifndef XAODPFLOW_VERSIONS_PFO_V1_H
9 #define XAODPFLOW_VERSIONS_PFO_V1_H
10 
11 //Author Mark Hodgkinson and Michel Janus
12 
13 // Core include(s):
14 #include "AthLinks/ElementLink.h"
15 
16 // xAOD include(s):
17 #include "xAODBase/IParticle.h"
19 #include "xAODPFlow/PFODefs.h"
25 
26 //ROOT includes
27 #include "TVector3.h"
28 #include "Math/Vector4D.h"
29 
30 namespace xAOD {
31 
32 
35  class PFO_v1 : public IParticle {
36 
37  public:
39  PFO_v1();
41  PFO_v1(const PFO_v1& other);
42 
43  PFO_v1& operator=(const PFO_v1& other) = default;
44 
45 
48 
50  virtual double pt() const;
52  virtual double eta() const;
54  virtual double phi() const;
56  virtual double m() const;
58  virtual double e() const;
60  virtual double rapidity() const;
61 
63  virtual FourMom_t p4() const;
64 
66  virtual Type::ObjectType type() const;
67 
69 
71  typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > GenVecFourMom_t;
72 
74  GenVecFourMom_t genvecP4() const;
75 
77  void setP4(const FourMom_t& vec);
78 
80  void setP4(float pt, float eta, float phi, float m=0.0);
81 
83  FourMom_t p4EM() const;
87  void setP4EM(const FourMom_t& p4EM);
89  void setP4EM(float pt, float eta, float phi, float m);
90 
92  virtual double ptEM() const;
94  virtual double etaEM() const;
96  virtual double phiEM() const;
98  virtual double mEM() const;
100  virtual double eEM() const;
101 
102 
103 
105  float bdtPi0Score() const;
107  void setBDTPi0Score(float BDTPi0Score);
108 
110  float centerMag() const;
112  void setCenterMag(float CenterMag);
113 
115  bool isCharged() const;
117  float charge() const;
119  void setCharge(float charge);
120 
122  template<class T> void setAttribute(PFODetails::PFOAttributes AttributeType, const T& anAttribute) ;
124  template<class T> bool attribute(PFODetails::PFOAttributes AttributeType, T& anAttribute) const;
125 
127  template<class T> void setAttribute(const std::string& AttributeType, const T& anAttribute) ;
129  template<class T> bool attribute(const std::string& AttributeType, T& anAttribute) const;
130 
132  bool getClusterMoment(float& theMoment, xAOD::CaloCluster::MomentType momentType) const;
133 
135  unsigned int nCaloCluster() const;
136 
138  const CaloCluster* cluster(unsigned int index) const;
140  const TrackParticle* track(unsigned int index) const;
142  const xAOD::Vertex* vertex() const;
143 
145  bool setVertexLink(const ElementLink< xAOD::VertexContainer>& theVertexLink);
146 
148  template<class T> void convertLink(ElementLink<IParticleContainer>& IParticleLink, const ElementLink<T>& templateLink);
149 
159  void setAssociatedParticleLink(const std::string& ParticleType, const ElementLink<IParticleContainer>& theParticle);
163  void addAssociatedParticleLink(const std::string& ParticleType, const ElementLink<IParticleContainer>& theParticle);
164 
165  //switch to elementlinkvector
169  bool associatedParticles(PFODetails::PFOParticleType ParticleType, std::vector<const IParticle*>& theParticles ) const;
171  void setAssociatedParticleLinks(const std::string& ParticleType, const std::vector<ElementLink<IParticleContainer> >& theParticles) ;
173  bool associatedParticles(const std::string& ParticleType, std::vector<const IParticle*>& theParticles ) const;
174 
176  TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex& vertexToCorrectTo) const;
178  TLorentzVector GetVertexCorrectedFourVec(const TVector3& vertexToCorrectTo) const;
179 
181  TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex& vertexToCorrectTo) const;
183  TLorentzVector GetVertexCorrectedEMFourVec(const TVector3& vertexToCorrectTo) const;
184 
186  void toPersistent();
187 
188  private:
189 
191  bool getClusterMomentFromPFO(float& theMoment, xAOD::CaloCluster::MomentType momentType) const;
192 
194  void VertexCorrectTheFourVector(const TVector3& vertexToCorrectTo, TLorentzVector& theFourVector) const;
195 
198 
201 
203  const static int s_floatCompressionFactor = 1000;
204 
205  }; // class PFO
206 
207 } // namespace xAOD
208 
209 // Declare IParticle as a base class of PFO_v1:
212 
214 
215 #endif // XAODPFLOW_VERSIONS_PFO_V1_H
PFO_v1.icc
xAOD::PFO_v1::getClusterMomentFromPFO
bool getClusterMomentFromPFO(float &theMoment, xAOD::CaloCluster::MomentType momentType) const
Gives access to cluster moments direct from the PFO - getClusterMoment calls this,...
Definition: PFO_v1.cxx:423
xAOD::PFO_v1::GenVecFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector version)
Definition: PFO_v1.h:71
xAOD::PFO_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: PFO_v1.cxx:52
xAOD::PFO_v1::convertLink
void convertLink(ElementLink< IParticleContainer > &IParticleLink, const ElementLink< T > &templateLink)
Convert a generic link to an IParticleLink - perhaps this will go in a dedicated helper tool?
IParticle.h
xAOD::PFODetails::PFOAttributes
PFOAttributes
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:28
xAOD::PFO_v1::genvecP4
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector version.
Definition: PFO_v1.cxx:101
index
Definition: index.py:1
xAOD::PFO_v1::track
const TrackParticle * track(unsigned int index) const
Retrieve a const pointer to a Rec::TrackParticle.
Definition: PFO_v1.cxx:691
xAOD::PFO_v1::setP4EM
void setP4EM(const FourMom_t &p4EM)
set EM scale 4-vector
Definition: PFO_v1.cxx:173
xAOD::PFO_v1::phiEM
virtual double phiEM() const
get EM scale phi
Definition: PFO_v1.cxx:220
xAOD::PFO_v1::attribute
bool attribute(PFODetails::PFOAttributes AttributeType, T &anAttribute) const
get a PFO Variable via enum
xAOD::PFO_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: PFO_v1.cxx:60
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
xAOD::PFODetails::PFOParticleType
PFOParticleType
This enum is used to label the associated particles to the PFO object.
Definition: Event/xAOD/xAODPFlow/xAODPFlow/PFODefs.h:168
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
xAOD::PFO_v1::addClusterLink
bool addClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Add a cluster constituent appends to existing container.
Definition: PFO_v1.cxx:555
xAOD::PFO_v1::associatedParticles
bool associatedParticles(PFODetails::PFOParticleType ParticleType, std::vector< const IParticle * > &theParticles) const
get a vector of PFO constituent particle types via enum
Definition: PFO_v1.cxx:610
xAOD::PFO_v1::setAssociatedParticleLinks
bool setAssociatedParticleLinks(PFODetails::PFOParticleType ParticleType, const std::vector< ElementLink< IParticleContainer > > &theParticles)
Set a vector of PFO constituent particle types via enum - overwrite is allowed.
Definition: PFO_v1.cxx:600
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::PFO_v1::GetVertexCorrectedFourVec
TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct 4-vector to point at a vertex.
Definition: PFO_v1.cxx:722
xAOD::PFO_v1::s_floatCompressionFactor
static const int s_floatCompressionFactor
this defines the factor to compress floats by
Definition: PFO_v1.h:203
xAOD::PFO_v1::ptEM
virtual double ptEM() const
get EM scale pt
Definition: PFO_v1.cxx:204
xAOD::PFO_v1::p4EM
FourMom_t p4EM() const
get EM scale 4-vector
Definition: PFO_v1.cxx:144
xAOD::PFO_v1::getAttributeName_FromClusterMoment
bool getAttributeName_FromClusterMoment(xAOD::PFODetails::PFOAttributes &myAttribute, xAOD::CaloCluster::MomentType &momentType) const
Map from cluster moment name onto PFOAttribute name.
Definition: PFO_v1.cxx:433
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:68
xAOD::CaloCluster_v1::MomentType
MomentType
Enums to identify different moments.
Definition: CaloCluster_v1.h:120
xAOD::PFO_v1::setClusterLink
bool setClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Set a cluster constituent - does NOT append to existing container
Definition: PFO_v1.cxx:549
xAOD::PFO_v1::type
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition: PFO_v1.cxx:140
xAOD::PFO_v1::e
virtual double e() const
The total energy of the particle.
Definition: PFO_v1.cxx:81
xAOD::PFO_v1::setVertexLink
bool setVertexLink(const ElementLink< xAOD::VertexContainer > &theVertexLink)
Set a vertex link.
Definition: PFO_v1.cxx:536
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::PFO_v1::nCaloCluster
unsigned int nCaloCluster() const
Find out how many CaloCluster are linked.
Definition: PFO_v1.cxx:659
CaloCluster.h
xAOD::PFO_v1::setTrackLink
bool setTrackLink(const ElementLink< xAOD::TrackParticleContainer > &theTrack)
Set a track constituent - does NOT append to existing container
Definition: PFO_v1.cxx:543
IParticleContainer.h
xAOD::PFO_v1::charge
float charge() const
get charge of PFO
xAOD::PFO_v1::setAttribute
void setAttribute(const std::string &AttributeType, const T &anAttribute)
Set a PFO Variable via string - overwrite is allowed.
xAOD::PFO_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: PFO_v1.cxx:95
xAOD::PFO_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: PFO_v1.cxx:67
xAOD::PFO_v1::genvecP4EM
GenVecFourMom_t genvecP4EM() const
get EM scale 4-vector
Definition: PFO_v1.cxx:160
xAOD::PFO_v1::mEM
virtual double mEM() const
get EM scale mass
Definition: PFO_v1.cxx:224
xAOD::PFO_v1::setBDTPi0Score
void setBDTPi0Score(float BDTPi0Score)
set BDT Score used to classify clusters as Pi0 like or not
xAOD::PFO_v1::bdtPi0Score
float bdtPi0Score() const
get BDT Score used to classify clusters as Pi0 like or not
xAOD::PFO_v1::isCharged
bool isCharged() const
is a charged PFO
Definition: PFO_v1.cxx:251
xAOD::PFO_v1::eEM
virtual double eEM() const
get EM scale energy
Definition: PFO_v1.cxx:233
xAOD::PFO_v1
Class describing a particle flow object.
Definition: PFO_v1.h:35
xAOD::PFO_v1::PFO_v1
PFO_v1()
Default constructor.
Definition: PFO_v1.cxx:44
xAOD::PFO_v1::addAssociatedParticleLink
bool addAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
Add an IParticle constituent via enum - appends to existing container.
Definition: PFO_v1.cxx:571
xAOD::PFO_v1::etaEM
virtual double etaEM() const
get EM scale eta
Definition: PFO_v1.cxx:215
xAOD::PFO_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: PFO_v1.cxx:74
xAOD::PFO_v1::setAssociatedParticleLink
bool setAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
Set an IParticle constituent via enum - does NOT append to existing container.
Definition: PFO_v1.cxx:561
TrackParticle.h
xAOD::PFO_v1::VertexCorrectTheFourVector
void VertexCorrectTheFourVector(const TVector3 &vertexToCorrectTo, TLorentzVector &theFourVector) const
This does the vertex correction of neutral PFO.
Definition: PFO_v1.cxx:752
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
xAOD::PFO_v1::setP4
void setP4(const FourMom_t &vec)
set the 4-vec
Definition: PFO_v1.cxx:107
xAOD::PFO_v1::vertex
const xAOD::Vertex * vertex() const
Retrieve a const pointer to the xAOD::Vertex a charged PFO is associated to.
Definition: PFO_v1.cxx:712
xAOD::PFO_v1::setCharge
void setCharge(float charge)
set charge of PFO
VertexContainer.h
xAOD::PFO_v1::getClusterMoment
bool getClusterMoment(float &theMoment, xAOD::CaloCluster::MomentType momentType) const
Accessor for cluster moments.
Definition: PFO_v1.cxx:402
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
DATAVECTOR_BASE
DATAVECTOR_BASE(xAOD::PFO_v1, xAOD::IParticle)
xAOD::PFO_v1::isJetETMissFloatForCompression
bool isJetETMissFloatForCompression(xAOD::PFODetails::PFOAttributes AttributeType) const
Performs a check as to whether a variable should be compressed.
Definition: PFO_v1.cxx:312
CaloClusterContainer.h
PFODefs.h
xAOD::PFO_v1::cluster
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
Definition: PFO_v1.cxx:669
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::PFO_v1::rapidity
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition: PFO_v1.cxx:90
xAODType::ObjectType
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition: ObjectType.h:32
xAOD::PFO_v1::setAttribute
void setAttribute(PFODetails::PFOAttributes AttributeType, const T &anAttribute)
Set a PFO Variable via enum - overwrite is allowed.
xAOD::PFO_v1::GetVertexCorrectedEMFourVec
TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct EM scale 4-vector to point at a vertex.
Definition: PFO_v1.cxx:737
xAOD::PFO_v1::operator=
PFO_v1 & operator=(const PFO_v1 &other)=default
ParticleType
ParticleType
Definition: TruthClasses.h:8
xAOD::PFO_v1::toPersistent
void toPersistent()
prepare all links for persistification
Definition: PFO_v1.cxx:774
xAOD::PFO_v1::attribute
bool attribute(const std::string &AttributeType, T &anAttribute) const
Get a PFO Variable via string.
xAOD::PFO_v1::centerMag
float centerMag() const
get CenterMag moment needed for vertex correction
TrackParticleContainer.h
xAOD::PFO_v1::setCenterMag
void setCenterMag(float CenterMag)
set CenterMag moment needed for vertex correction