ATLAS Offline Software
Loading...
Searching...
No Matches
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
30namespace 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
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
std::vector< size_t > vec
An STL vector of pointers that by default owns its pointed-to elements.
#define DATAVECTOR_BASE(T, BASE)
Declare base class info to DataVector.
Definition DataVector.h:649
ParticleType
Definition TruthClasses.h:8
MomentType
Enums to identify different moments.
Class providing the definition of the 4-vector interface.
IParticle()=default
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Class describing a particle flow object.
Definition PFO_v1.h:35
bool setTrackLink(const ElementLink< xAOD::TrackParticleContainer > &theTrack)
Set a track constituent - does NOT append to existing container.
Definition PFO_v1.cxx:543
unsigned int nCaloCluster() const
Find out how many CaloCluster are linked.
Definition PFO_v1.cxx:659
virtual double ptEM() const
get EM scale pt
Definition PFO_v1.cxx:204
bool attribute(PFODetails::PFOAttributes AttributeType, T &anAttribute) const
get a PFO Variable via enum
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector version.
Definition PFO_v1.cxx:101
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
bool addClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Add a cluster constituent appends to existing container.
Definition PFO_v1.cxx:555
void setAttribute(PFODetails::PFOAttributes AttributeType, const T &anAttribute)
Set a PFO Variable via enum - overwrite is allowed.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector version)
Definition PFO_v1.h:71
bool getClusterMoment(float &theMoment, xAOD::CaloCluster::MomentType momentType) const
Accessor for cluster moments.
Definition PFO_v1.cxx:402
PFO_v1()
Default constructor.
Definition PFO_v1.cxx:44
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition PFO_v1.cxx:90
bool isCharged() const
is a charged PFO
Definition PFO_v1.cxx:251
bool attribute(const std::string &AttributeType, T &anAttribute) const
Get a PFO Variable via string.
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
TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct 4-vector to point at a vertex.
Definition PFO_v1.cxx:722
bool setClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Set a cluster constituent - does NOT append to existing container.
Definition PFO_v1.cxx:549
float centerMag() const
get CenterMag moment needed for vertex correction
static const int s_floatCompressionFactor
this defines the factor to compress floats by
Definition PFO_v1.h:203
FourMom_t p4EM() const
get EM scale 4-vector
Definition PFO_v1.cxx:144
GenVecFourMom_t genvecP4EM() const
get EM scale 4-vector
Definition PFO_v1.cxx:160
virtual double eEM() const
get EM scale energy
Definition PFO_v1.cxx:233
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
void setCenterMag(float CenterMag)
set CenterMag moment needed for vertex correction
bool isJetETMissFloatForCompression(xAOD::PFODetails::PFOAttributes AttributeType) const
Performs a check as to whether a variable should be compressed.
Definition PFO_v1.cxx:312
float bdtPi0Score() const
get BDT Score used to classify clusters as Pi0 like or not
void VertexCorrectTheFourVector(const TVector3 &vertexToCorrectTo, TLorentzVector &theFourVector) const
This does the vertex correction of neutral PFO.
Definition PFO_v1.cxx:752
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?
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
virtual double etaEM() const
get EM scale eta
Definition PFO_v1.cxx:215
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition PFO_v1.cxx:95
void setP4(const FourMom_t &vec)
set the 4-vec
Definition PFO_v1.cxx:107
void setBDTPi0Score(float BDTPi0Score)
set BDT Score used to classify clusters as Pi0 like or not
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition PFO_v1.cxx:60
TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct EM scale 4-vector to point at a vertex.
Definition PFO_v1.cxx:737
PFO_v1 & operator=(const PFO_v1 &other)=default
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
void toPersistent()
prepare all links for persistification
Definition PFO_v1.cxx:774
void setAttribute(const std::string &AttributeType, const T &anAttribute)
Set a PFO Variable via string - overwrite is allowed.
virtual double m() const
The invariant mass of the particle.
Definition PFO_v1.cxx:74
void setP4EM(const FourMom_t &p4EM)
set EM scale 4-vector
Definition PFO_v1.cxx:173
const xAOD::Vertex * vertex() const
Retrieve a const pointer to the xAOD::Vertex a charged PFO is associated to.
Definition PFO_v1.cxx:712
bool addAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
Add an IParticle constituent via enum - appends to existing container.
Definition PFO_v1.cxx:571
virtual double phiEM() const
get EM scale phi
Definition PFO_v1.cxx:220
void setCharge(float charge)
set charge of PFO
virtual double e() const
The total energy of the particle.
Definition PFO_v1.cxx:81
float charge() const
get charge of PFO
virtual double mEM() const
get EM scale mass
Definition PFO_v1.cxx:224
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition PFO_v1.cxx:67
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition PFO_v1.cxx:140
bool setVertexLink(const ElementLink< xAOD::VertexContainer > &theVertexLink)
Set a vertex link.
Definition PFO_v1.cxx:536
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition PFO_v1.cxx:52
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
Definition PFO_v1.cxx:669
Definition index.py:1
PFOParticleType
This enum is used to label the associated particles to the PFO object.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
IParticleLink_v1 IParticleLink
Define the latest version of the IParticleLink class.