ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::PFO_v1 Class Reference

Class describing a particle flow object. More...

#include <PFO_v1.h>

Inheritance diagram for xAOD::PFO_v1:
Collaboration diagram for xAOD::PFO_v1:

Public Types

typedef ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
 Base 4 Momentum type (GenVector version).
Functions describing the 4-momentum of the object
typedef TLorentzVector FourMom_t
 Definition of the 4-momentum type.

Public Member Functions

 PFO_v1 ()
 Default constructor.
 PFO_v1 (const PFO_v1 &other)
 Copy Constructor.
PFO_v1operator= (const PFO_v1 &other)=default
GenVecFourMom_t genvecP4 () const
 The full 4-momentum of the particle : GenVector version.
void setP4 (const FourMom_t &vec)
 set the 4-vec
void setP4 (float pt, float eta, float phi, float m=0.0)
 set the 4-vec
FourMom_t p4EM () const
 get EM scale 4-vector
GenVecFourMom_t genvecP4EM () const
 get EM scale 4-vector
void setP4EM (const FourMom_t &p4EM)
 set EM scale 4-vector
void setP4EM (float pt, float eta, float phi, float m)
 set EM scale 4-vector
virtual double ptEM () const
 get EM scale pt
virtual double etaEM () const
 get EM scale eta
virtual double phiEM () const
 get EM scale phi
virtual double mEM () const
 get EM scale mass
virtual double eEM () const
 get EM scale energy
float bdtPi0Score () const
 get BDT Score used to classify clusters as Pi0 like or not
void setBDTPi0Score (float BDTPi0Score)
 set BDT Score used to classify clusters as Pi0 like or not
float centerMag () const
 get CenterMag moment needed for vertex correction
void setCenterMag (float CenterMag)
 set CenterMag moment needed for vertex correction
bool isCharged () const
 is a charged PFO
float charge () const
 get charge of PFO
void setCharge (float charge)
 set charge of PFO
template<class T>
void setAttribute (PFODetails::PFOAttributes AttributeType, const T &anAttribute)
 Set a PFO Variable via enum - overwrite is allowed.
template<class T>
bool attribute (PFODetails::PFOAttributes AttributeType, T &anAttribute) const
 get a PFO Variable via enum
template<class T>
void setAttribute (const std::string &AttributeType, const T &anAttribute)
 Set a PFO Variable via string - overwrite is allowed.
template<class T>
bool attribute (const std::string &AttributeType, T &anAttribute) const
 Get a PFO Variable via string.
bool getClusterMoment (float &theMoment, xAOD::CaloCluster::MomentType momentType) const
 Accessor for cluster moments.
unsigned int nCaloCluster () const
 Find out how many CaloCluster are linked.
const CaloClustercluster (unsigned int index) const
 Retrieve a const pointer to a CaloCluster.
const TrackParticletrack (unsigned int index) const
 Retrieve a const pointer to a Rec::TrackParticle.
const xAOD::Vertexvertex () const
 Retrieve a const pointer to the xAOD::Vertex a charged PFO is associated to.
bool setVertexLink (const ElementLink< xAOD::VertexContainer > &theVertexLink)
 Set a vertex link.
template<class T>
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 setTrackLink (const ElementLink< xAOD::TrackParticleContainer > &theTrack)
 Set a track constituent - does NOT append to existing container.
bool setClusterLink (const ElementLink< xAOD::CaloClusterContainer > &theCluster)
 Set a cluster constituent - does NOT append to existing container.
bool addClusterLink (const ElementLink< xAOD::CaloClusterContainer > &theCluster)
 Add a cluster constituent appends to existing container.
bool setAssociatedParticleLink (PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
 Set an IParticle constituent via enum - does NOT append to existing container.
void setAssociatedParticleLink (const std::string &ParticleType, const ElementLink< IParticleContainer > &theParticle)
 Set an IParticle constituent via string - does NOT append to existing container.
bool addAssociatedParticleLink (PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
 Add an IParticle constituent via enum - appends to existing container.
void addAssociatedParticleLink (const std::string &ParticleType, const ElementLink< IParticleContainer > &theParticle)
 Add an IParticle constituent via enum - appends to existing container.
bool setAssociatedParticleLinks (PFODetails::PFOParticleType ParticleType, const std::vector< ElementLink< IParticleContainer > > &theParticles)
 Set a vector of PFO constituent particle types via enum - overwrite is allowed.
bool associatedParticles (PFODetails::PFOParticleType ParticleType, std::vector< const IParticle * > &theParticles) const
 get a vector of PFO constituent particle types via enum
void setAssociatedParticleLinks (const std::string &ParticleType, const std::vector< ElementLink< IParticleContainer > > &theParticles)
 Set a vector of PFO constituent particle types via string - overwrite is allowed.
bool associatedParticles (const std::string &ParticleType, std::vector< const IParticle * > &theParticles) const
 get a vector of PFO constituent particle types via string
TLorentzVector GetVertexCorrectedFourVec (const xAOD::Vertex &vertexToCorrectTo) const
 Correct 4-vector to point at a vertex.
TLorentzVector GetVertexCorrectedFourVec (const TVector3 &vertexToCorrectTo) const
 Correct 4-vector to point at a vertex.
TLorentzVector GetVertexCorrectedEMFourVec (const xAOD::Vertex &vertexToCorrectTo) const
 Correct EM scale 4-vector to point at a vertex.
TLorentzVector GetVertexCorrectedEMFourVec (const TVector3 &vertexToCorrectTo) const
 Correct EM scale 4-vector to point at a vertex.
void toPersistent ()
 prepare all links for persistification
template<>
void setAttribute (const std::string &AttributeType, const xAOD::PFODetails::PFOLeptonType &anAttribute)
 specaial implementations for floats, for eflowRec JetETMiss variables, to reduce disk space usage
template<>
bool attribute (const std::string &AttributeType, xAOD::PFODetails::PFOLeptonType &anAttribute) const
template<>
void setAttribute (PFODetails::PFOAttributes AttributeType, const float &anAttribute)
template<>
bool attribute (PFODetails::PFOAttributes AttributeType, float &anAttribute) const
template<>
void setAttribute (PFODetails::PFOAttributes AttributeType, const double &anAttribute)
 special implementations for doubles to prevent user from putting doubles in the aux store - convert to float in this case
template<>
bool attribute (PFODetails::PFOAttributes AttributeType, double &anAttribute) const
template<>
void setAttribute (const std::string &AttributeType, const double &anAttribute)
template<>
bool attribute (const std::string &AttributeType, double &anAttribute) const
xAOD::IParticle functions
virtual double pt () const
 The transverse momentum ( \(p_T\)) of the particle.
virtual double eta () const
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const
 The azimuthal angle ( \(\phi\)) of the particle.
virtual double m () const
 The invariant mass of the particle.
virtual double e () const
 The total energy of the particle.
virtual double rapidity () const
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const
 The full 4-momentum of the particle.
virtual Type::ObjectType type () const
 The type of the object as a simple enumeration.
Functions for getting and setting user properties
template<class T>
XAOD_AUXDATA_DEPRECATED T & auxdata (const std::string &name, const std::string &clsname="")
 Fetch an aux data variable, as a non-const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED const T & auxdata (const std::string &name, const std::string &clsname="") const
 Fetch an aux data variable, as a const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for reading or not.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for writing or not.

Private Member Functions

bool getClusterMomentFromPFO (float &theMoment, xAOD::CaloCluster::MomentType momentType) const
 Gives access to cluster moments direct from the PFO - getClusterMoment calls this, if needed.
void VertexCorrectTheFourVector (const TVector3 &vertexToCorrectTo, TLorentzVector &theFourVector) const
 This does the vertex correction of neutral PFO.
bool getAttributeName_FromClusterMoment (xAOD::PFODetails::PFOAttributes &myAttribute, xAOD::CaloCluster::MomentType &momentType) const
 Map from cluster moment name onto PFOAttribute name.
bool isJetETMissFloatForCompression (xAOD::PFODetails::PFOAttributes AttributeType) const
 Performs a check as to whether a variable should be compressed.

Static Private Attributes

static const int s_floatCompressionFactor = 1000
 this defines the factor to compress floats by

Detailed Description

Class describing a particle flow object.

Definition at line 35 of file PFO_v1.h.

Member Typedef Documentation

◆ FourMom_t

typedef TLorentzVector xAOD::IParticle::FourMom_t
inherited

Definition of the 4-momentum type.

Definition at line 69 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

◆ GenVecFourMom_t

typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > xAOD::PFO_v1::GenVecFourMom_t

Base 4 Momentum type (GenVector version).

Definition at line 71 of file PFO_v1.h.

Constructor & Destructor Documentation

◆ PFO_v1() [1/2]

xAOD::PFO_v1::PFO_v1 ( )

Default constructor.

Definition at line 44 of file PFO_v1.cxx.

44 : IParticle() {
45 }
IParticle()=default

◆ PFO_v1() [2/2]

xAOD::PFO_v1::PFO_v1 ( const PFO_v1 & other)

Copy Constructor.

Definition at line 47 of file PFO_v1.cxx.

49 }
void makePrivateStore()
Create a new (empty) private store for this object.

Member Function Documentation

◆ addAssociatedParticleLink() [1/2]

void xAOD::PFO_v1::addAssociatedParticleLink ( const std::string & ParticleType,
const ElementLink< IParticleContainer > & theParticle )

Add an IParticle constituent via enum - appends to existing container.

Definition at line 585 of file PFO_v1.cxx.

585 {
586
587 const static Accessor<std::vector<ElementLink<IParticleContainer > > > acc(ParticleType);
588 std::vector<ElementLink<IParticleContainer> > storedContainer = acc(*this);
589
590 ElementLink<xAOD::IParticleContainer> newLink;
591 newLink.setElement(*theParticle);
592 newLink.setStorableObject(theParticle.getStorableObjectRef());
593 newLink.toPersistent();
594 storedContainer.push_back(newLink);
595
596 acc(*this) = storedContainer;
597
598 }
ParticleType
Definition TruthClasses.h:8
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ addAssociatedParticleLink() [2/2]

bool xAOD::PFO_v1::addAssociatedParticleLink ( PFODetails::PFOParticleType ParticleType,
const ElementLink< IParticleContainer > & theParticle )

Add an IParticle constituent via enum - appends to existing container.

Definition at line 571 of file PFO_v1.cxx.

571 {
572 const Accessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(ParticleType);
573 if (!p_acc) return false;
574 else{
575 if (!p_acc->isAvailable(*this)) return false;
576 else{
577 std::vector<ElementLink<IParticleContainer> > storedContainer = (*p_acc)(*this);
578 storedContainer.push_back(theParticle);
579 (*p_acc)(*this) = storedContainer;
580 return true;
581 }
582 }
583 }
static const SG::AuxElement::Accessor< std::vector< ElementLink< IParticleContainer > > > * getAccessor(PFODetails::PFOParticleType type)
Definition PFO_v1.cxx:17

◆ addClusterLink()

bool xAOD::PFO_v1::addClusterLink ( const ElementLink< xAOD::CaloClusterContainer > & theCluster)

Add a cluster constituent appends to existing container.

Definition at line 555 of file PFO_v1.cxx.

555 {
556 ElementLink< xAOD::IParticleContainer > myClusterLink;
557 this->convertLink(myClusterLink,theCluster);
558 return this->addAssociatedParticleLink(PFODetails::CaloCluster, myClusterLink);
559 }
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 addAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
Add an IParticle constituent via enum - appends to existing container.
Definition PFO_v1.cxx:571

◆ associatedParticles() [1/2]

bool xAOD::PFO_v1::associatedParticles ( const std::string & ParticleType,
std::vector< const IParticle * > & theParticles ) const

get a vector of PFO constituent particle types via string

Definition at line 645 of file PFO_v1.cxx.

645 {
646 const static ConstAccessor<std::vector<ElementLink<IParticleContainer > > > acc(ParticleType);
647 if (!acc.isAvailable(*this)) return false;
648 else{
649 const std::vector<ElementLink<IParticleContainer> >& theLinks = acc(*this);
650 std::vector<ElementLink<IParticleContainer> >::const_iterator firstLink = theLinks.begin();
651 for (; firstLink != theLinks.end(); ++firstLink) {
652 if ( (*firstLink).isValid()) theParticles.push_back(**firstLink);
653 else theParticles.push_back(nullptr);
654 }
655 return true;
656 }
657 }

◆ associatedParticles() [2/2]

bool xAOD::PFO_v1::associatedParticles ( PFODetails::PFOParticleType ParticleType,
std::vector< const IParticle * > & theParticles ) const

get a vector of PFO constituent particle types via enum

Definition at line 610 of file PFO_v1.cxx.

610 {
611
612 const ConstAccessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(ParticleType);
613 if (!p_acc) return false;
614 else{
615 if (!p_acc->isAvailable(*this)) return false;
616 else{
617 const std::vector<ElementLink<IParticleContainer> >& theLinks = (*p_acc)(*this);
618 std::vector<ElementLink<IParticleContainer> >::const_iterator firstLink = theLinks.begin();
619 for (; firstLink != theLinks.end(); ++firstLink) {
620 if ( (*firstLink).isValid()) theParticles.push_back(**firstLink);
621 else theParticles.push_back(nullptr);
622 }
623 return true;
624 }
625 }
626
627 }

◆ attribute() [1/6]

template<>
bool xAOD::PFO_v1::attribute ( const std::string & AttributeType,
double & anAttribute ) const

Definition at line 393 of file PFO_v1.cxx.

393 {
394
395 float internalAttribute;
396 bool isValid = attribute<float>(AttributeType,internalAttribute);
397 if (isValid) anAttribute = static_cast<float>(internalAttribute);
398 return isValid;
399
400 }
bool attribute(PFODetails::PFOAttributes AttributeType, T &anAttribute) const
get a PFO Variable via enum

◆ attribute() [2/6]

template<class T>
bool xAOD::PFO_v1::attribute ( const std::string & AttributeType,
T & anAttribute ) const

Get a PFO Variable via string.

◆ attribute() [3/6]

template<>
bool xAOD::PFO_v1::attribute ( const std::string & AttributeType,
xAOD::PFODetails::PFOLeptonType & anAttribute ) const

Definition at line 262 of file PFO_v1.cxx.

262 {
263 bool isValid = false;
264 uint16_t internalAttribute;
265 isValid = attribute<uint16_t>(AttributeType,internalAttribute);
266 if (!isValid) return false;
267 else{
268 anAttribute = static_cast<xAOD::PFODetails::PFOLeptonType>(internalAttribute);
269 return true;
270 }
271
272 }
PFOLeptonType
This enum is used to label the lepton type of the neutral PFO.
setWord1 uint16_t

◆ attribute() [4/6]

template<>
bool xAOD::PFO_v1::attribute ( PFODetails::PFOAttributes AttributeType,
double & anAttribute ) const

Definition at line 377 of file PFO_v1.cxx.

377 {
378
379 float internalAttribute;
380 bool isValid = attribute<float>(AttributeType,internalAttribute);
381 if (isValid) anAttribute = static_cast<double>(internalAttribute);
382 return isValid;
383
384 }

◆ attribute() [5/6]

template<>
bool xAOD::PFO_v1::attribute ( PFODetails::PFOAttributes AttributeType,
float & anAttribute ) const

Definition at line 289 of file PFO_v1.cxx.

289 {
290 bool isValid = false;
291 if (this->isJetETMissFloatForCompression(AttributeType)){
292 int internalAttribute;
293 isValid = attribute<int>(AttributeType,internalAttribute);
294 if (isValid && 0 != internalAttribute) anAttribute = static_cast<float>(internalAttribute)/s_floatCompressionFactor;
295 else anAttribute = 0.0;
296 return isValid;
297 }
298 else{
299 const ConstAccessor<float>* p_acc = PFOAttributesAccessor_v1<float>::constAccessor(AttributeType);
300 //check if accessor pointer is NULL
301 if( ! p_acc ) { return false ;}
302 //check if variable is avaialable
303 if( ! p_acc->isAvailable( *this ) ) return false;
304 //set variable and return true
305 anAttribute =( *p_acc )( *this );
306 return true;
307
308 }
309 return isValid;
310 }
static const int s_floatCompressionFactor
this defines the factor to compress floats by
Definition PFO_v1.h:203
bool isJetETMissFloatForCompression(xAOD::PFODetails::PFOAttributes AttributeType) const
Performs a check as to whether a variable should be compressed.
Definition PFO_v1.cxx:312
static const SG::AuxElement::Accessor< T > * constAccessor(xAOD::PFODetails::PFOAttributes variable)

◆ attribute() [6/6]

template<class T>
bool xAOD::PFO_v1::attribute ( PFODetails::PFOAttributes AttributeType,
T & anAttribute ) const

get a PFO Variable via enum

◆ auxdata() [1/2]

template<class T>
XAOD_AUXDATA_DEPRECATED T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" )
inlineinherited

Fetch an aux data variable, as a non-const reference.

This function provides an easy way for users to decorate objects with auxiliary data.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A modifiable reference to the decoration

Definition at line 98 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

99 {
100
101 return SG::Accessor< T >(name, clsname)(*this);
102 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ auxdata() [2/2]

template<class T>
XAOD_AUXDATA_DEPRECATED const T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Fetch an aux data variable, as a const reference.

This function provides an easy way for users to retrieve auxiliary decorations from an object.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A constant reference to the decoration

Definition at line 118 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

119 {
120
121 return SG::ConstAccessor< T >( name, clsname )( *this );
122 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570

◆ bdtPi0Score()

float xAOD::PFO_v1::bdtPi0Score ( ) const

get BDT Score used to classify clusters as Pi0 like or not

◆ centerMag()

float xAOD::PFO_v1::centerMag ( ) const

get CenterMag moment needed for vertex correction

◆ charge()

float xAOD::PFO_v1::charge ( ) const

get charge of PFO

◆ cluster()

const CaloCluster * xAOD::PFO_v1::cluster ( unsigned int index) const

Retrieve a const pointer to a CaloCluster.

Definition at line 669 of file PFO_v1.cxx.

669 {
670
671 const ConstAccessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(PFODetails::CaloCluster);
672 if (!p_acc) return nullptr;
673 else if (!p_acc->isAvailable(*this)) {return nullptr;}
674 else {
675 const std::vector<ElementLink<IParticleContainer> >& theLinks = (*p_acc)(*this);
676 if(index<theLinks.size()) {
677 ElementLink<IParticleContainer> theLink = theLinks[index];
678 if (theLink.isValid()){
679 const IParticle *theParticle = *theLink;
680 if (nullptr == theParticle) return nullptr;
681 else if (Type::CaloCluster == theParticle->type()) return static_cast<const CaloCluster*>(theParticle);
682 else return nullptr;
683 }
684 else return nullptr;
685 }
686 else return nullptr;
687 }
688
689 }
str index
Definition DeMoScan.py:362
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ convertLink()

template<class T>
void xAOD::PFO_v1::convertLink ( ElementLink< IParticleContainer > & IParticleLink,
const ElementLink< T > & templateLink )

Convert a generic link to an IParticleLink - perhaps this will go in a dedicated helper tool?

◆ e()

double xAOD::PFO_v1::e ( ) const
virtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 81 of file PFO_v1.cxx.

81 {
82
83 const static ConstAccessor<float> accPt("pt");
84 float pt = accPt(*this);
85
86 if (pt < 0.0) return -genvecP4().E();
87 else return genvecP4().E();
88 }
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector version.
Definition PFO_v1.cxx:101
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition PFO_v1.cxx:52

◆ eEM()

double xAOD::PFO_v1::eEM ( ) const
virtual

get EM scale energy

Definition at line 233 of file PFO_v1.cxx.

233 {
234
235 if (this->isCharged()) return this->e();
236
237 const static ConstAccessor<float> accPt("ptEM");
238 float pt = accPt(*this);
239
240 if (pt < 0.0) return -p4EM().E();
241 else return p4EM().E();
242 }
bool isCharged() const
is a charged PFO
Definition PFO_v1.cxx:251
FourMom_t p4EM() const
get EM scale 4-vector
Definition PFO_v1.cxx:144
virtual double e() const
The total energy of the particle.
Definition PFO_v1.cxx:81

◆ eta()

double xAOD::PFO_v1::eta ( ) const
virtual

The pseudorapidity ( \(\eta\)) of the particle.

Implements xAOD::IParticle.

Definition at line 60 of file PFO_v1.cxx.

60 {
61
62 const static ConstAccessor<float> accEta("eta");
63 float eta = accEta(*this);
64 return eta;
65 }
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition PFO_v1.cxx:60

◆ etaEM()

double xAOD::PFO_v1::etaEM ( ) const
virtual

get EM scale eta

Definition at line 215 of file PFO_v1.cxx.

215 {
216 return eta();
217 }

◆ genvecP4()

PFO_v1::GenVecFourMom_t xAOD::PFO_v1::genvecP4 ( ) const

The full 4-momentum of the particle : GenVector version.

Definition at line 101 of file PFO_v1.cxx.

101 {
102 return GenVecFourMom_t( pt(), eta(), phi(),m());
103 }
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector version).
Definition PFO_v1.h:71
virtual double m() const
The invariant mass of the particle.
Definition PFO_v1.cxx:74
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition PFO_v1.cxx:67

◆ genvecP4EM()

PFO_v1::GenVecFourMom_t xAOD::PFO_v1::genvecP4EM ( ) const

get EM scale 4-vector

Definition at line 160 of file PFO_v1.cxx.

160 {
161
162 if (this->isCharged()) return genvecP4();
163
164 //change to use pt, eta, phi ,e
165 const static ConstAccessor<float> accPt("ptEM");
166 const static ConstAccessor<float> accEta("eta");
167 const static ConstAccessor<float> accPhi("phi");
168 const static ConstAccessor<float> accM("mEM");
169
170 return GenVecFourMom_t(accPt(*this), accEta(*this), accPhi(*this), accM(*this));
171 }

◆ getAttributeName_FromClusterMoment()

bool xAOD::PFO_v1::getAttributeName_FromClusterMoment ( xAOD::PFODetails::PFOAttributes & myAttribute,
xAOD::CaloCluster::MomentType & momentType ) const
private

Map from cluster moment name onto PFOAttribute name.

Definition at line 433 of file PFO_v1.cxx.

433 {
434
435 if (momentType == xAOD::CaloCluster::ENG_FRAC_CORE) {
437 return true;
438 }
439 else if (momentType == xAOD::CaloCluster::FIRST_ENG_DENS) {
441 return true;
442 }
443 else if (momentType == xAOD::CaloCluster::CENTER_LAMBDA) {
445 return true;
446 }
447 else if (momentType == xAOD::CaloCluster::SECOND_R) {
449 return true;
450 }
451 else if (momentType == xAOD::CaloCluster::DELTA_ALPHA) {
453 return true;
454 }
455 else if (momentType == xAOD::CaloCluster::LATERAL) {
457 return true;
458 }
459 else if (momentType == xAOD::CaloCluster::LONGITUDINAL) {
461 return true;
462 }
463 else if (momentType == xAOD::CaloCluster::SECOND_LAMBDA) {
465 return true;
466 }
467 else if (momentType == xAOD::CaloCluster::ISOLATION) {
469 return true;
470 }
471 else if (momentType == xAOD::CaloCluster::ENG_FRAC_MAX) {
473 return true;
474 }
475 else if (momentType == xAOD::CaloCluster::ENG_BAD_CELLS) {
477 return true;
478 }
479 else if (momentType == xAOD::CaloCluster::N_BAD_CELLS) {
481 return true;
482 }
483 else if (momentType == xAOD::CaloCluster::BADLARQ_FRAC) {
485 return true;
486 }
487 else if (momentType == xAOD::CaloCluster::ENG_POS) {
489 return true;
490 }
491 else if (momentType == xAOD::CaloCluster::SIGNIFICANCE) {
493 return true;
494 }
495 else if (momentType == xAOD::CaloCluster::CELL_SIGNIFICANCE) {
497 return true;
498 }
499 else if (momentType == xAOD::CaloCluster::CELL_SIG_SAMPLING) {
501 return true;
502 }
503 else if (momentType == xAOD::CaloCluster::AVG_LAR_Q) {
505 return true;
506 }
507 else if (momentType == xAOD::CaloCluster::AVG_TILE_Q) {
509 return true;
510 }
511 else if (momentType == xAOD::CaloCluster::EM_PROBABILITY){
513 return true;
514 }
515 else if (momentType == xAOD::CaloCluster::ENG_CALIB_TOT){
517 return true;
518 }
519 else if (momentType == xAOD::CaloCluster::ENG_CALIB_FRAC_EM){
521 return true;
522 }
523 else if (momentType == xAOD::CaloCluster::ENG_CALIB_FRAC_HAD){
525 return true;
526 }
527 else if (momentType == xAOD::CaloCluster::ENG_CALIB_FRAC_REST){
529 return true;
530 }
531
532 else return false;
533
534 }
@ DELTA_ALPHA
Angular shower axis deviation ( ) from IP-to-Center.
@ AVG_TILE_Q
Sum(E_cell_Tile^2 Q_cell_Tile)/Sum(E_cell_Tile^2).
@ SECOND_LAMBDA
Second Moment in .
@ CELL_SIGNIFICANCE
Cell significance = E/sig of the cell with the largest |E|/sig.
@ CELL_SIG_SAMPLING
CaloSample of the cell with the largest |E|/sig.
@ EM_PROBABILITY
Classification probability to be em-like.
@ LATERAL
Normalized lateral moment.
@ N_BAD_CELLS
number of bad cells
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ AVG_LAR_Q
Sum(E_cell_LAr^2 Q_cell_LAr)/Sum(E_cell_LAr^2).
@ SECOND_R
Second Moment in .
@ FIRST_ENG_DENS
First Moment in E/V.
@ ENG_FRAC_CORE
Energy fraction of the sum of the hottest cells in each sampling.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ SIGNIFICANCE
Cluster significance.
@ ENG_CALIB_FRAC_REST
Calibration Hit energy inside the cluster caused by other particles.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ ENG_CALIB_FRAC_HAD
Calibration Hit energy inside the cluster caused by charged pi+ and pi-.
@ ENG_POS
Total positive Energy of this cluster.
@ BADLARQ_FRAC
Energy fraction of LAr cells with quality larger than a given cut.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.

◆ getClusterMoment()

bool xAOD::PFO_v1::getClusterMoment ( float & theMoment,
xAOD::CaloCluster::MomentType momentType ) const

Accessor for cluster moments.

Definition at line 402 of file PFO_v1.cxx.

402 {
403
404 const xAOD::CaloCluster *theCluster = this->cluster(0);
405
406 double myMoment = -99.0;
407
408 if (theCluster){
409 bool gotMoment = theCluster->retrieveMoment( momentType, myMoment);
410 //if cluster does not have the moment, check if the PFO stored it - this can happen due to the way we redirect the ElementLinks to clusters in PFONeutralCreatorAlgorithm
411 if (!gotMoment) return getClusterMomentFromPFO(theMoment,momentType);
412 else if (gotMoment) {
413 theMoment = static_cast<float>(myMoment);
414 return true;
415 }
416 }
417 else return getClusterMomentFromPFO(theMoment,momentType);
418
419 return false;
420
421 }
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
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
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
Definition PFO_v1.cxx:669

◆ getClusterMomentFromPFO()

bool xAOD::PFO_v1::getClusterMomentFromPFO ( float & theMoment,
xAOD::CaloCluster::MomentType momentType ) const
private

Gives access to cluster moments direct from the PFO - getClusterMoment calls this, if needed.

Definition at line 423 of file PFO_v1.cxx.

423 {
425 bool haveGotAttributeInMap = this->getAttributeName_FromClusterMoment(myAttribute,momentType);
426 if (!haveGotAttributeInMap) return false;
427 else {
428 bool isRetrieved = this->attribute(myAttribute, theMoment);
429 return isRetrieved;
430 }
431 }
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

◆ GetVertexCorrectedEMFourVec() [1/2]

TLorentzVector xAOD::PFO_v1::GetVertexCorrectedEMFourVec ( const TVector3 & vertexToCorrectTo) const

Correct EM scale 4-vector to point at a vertex.

Definition at line 742 of file PFO_v1.cxx.

742 {
743
744 TLorentzVector theNewVector(0.0,0.0,0.0,0.0);
745 theNewVector.SetPtEtaPhiM(this->ptEM(), this->etaEM(), this->phiEM(), this->mEM());
746
747 this->VertexCorrectTheFourVector(vertexToCorrectTo,theNewVector);
748 return theNewVector;
749
750 }
virtual double ptEM() const
get EM scale pt
Definition PFO_v1.cxx:204
void VertexCorrectTheFourVector(const TVector3 &vertexToCorrectTo, TLorentzVector &theFourVector) const
This does the vertex correction of neutral PFO.
Definition PFO_v1.cxx:752
virtual double etaEM() const
get EM scale eta
Definition PFO_v1.cxx:215
virtual double phiEM() const
get EM scale phi
Definition PFO_v1.cxx:220
virtual double mEM() const
get EM scale mass
Definition PFO_v1.cxx:224

◆ GetVertexCorrectedEMFourVec() [2/2]

TLorentzVector xAOD::PFO_v1::GetVertexCorrectedEMFourVec ( const xAOD::Vertex & vertexToCorrectTo) const

Correct EM scale 4-vector to point at a vertex.

Definition at line 737 of file PFO_v1.cxx.

737 {
738 TVector3 theVertexVector(vertexToCorrectTo.x(), vertexToCorrectTo.y(), vertexToCorrectTo.z());
739 return GetVertexCorrectedEMFourVec(theVertexVector);
740 }
TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct EM scale 4-vector to point at a vertex.
Definition PFO_v1.cxx:737
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.

◆ GetVertexCorrectedFourVec() [1/2]

TLorentzVector xAOD::PFO_v1::GetVertexCorrectedFourVec ( const TVector3 & vertexToCorrectTo) const

Correct 4-vector to point at a vertex.

Definition at line 727 of file PFO_v1.cxx.

727 {
728
729 TLorentzVector theNewVector(0.0,0.0,0.0,0.0);
730 theNewVector.SetPtEtaPhiM(this->pt(), this->eta(), this->phi(), this->m());
731
732 this->VertexCorrectTheFourVector(vertexToCorrectTo,theNewVector);
733 return theNewVector;
734
735 }

◆ GetVertexCorrectedFourVec() [2/2]

TLorentzVector xAOD::PFO_v1::GetVertexCorrectedFourVec ( const xAOD::Vertex & vertexToCorrectTo) const

Correct 4-vector to point at a vertex.

Definition at line 722 of file PFO_v1.cxx.

722 {
723 TVector3 theVertexVector(vertexToCorrectTo.x(), vertexToCorrectTo.y(), vertexToCorrectTo.z());
724 return GetVertexCorrectedFourVec(theVertexVector);
725 }
TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct 4-vector to point at a vertex.
Definition PFO_v1.cxx:722

◆ isAvailable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for reading or not.

This function should be used to check if a user property which may or may not exist, is set on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration exists or not

Definition at line 135 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

136 {
137
138 return SG::ConstAccessor< T >(name, clsname).isAvailable(*this);
139 }
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.

◆ isAvailableWritable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for writing or not.

This function can be used to check whether it will be possible to set a user property on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration is possible to set

Definition at line 152 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

153 {
154
155 return SG::Accessor< T >(name, clsname).isAvailableWritable(*this);
156 }
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.

◆ isCharged()

bool xAOD::PFO_v1::isCharged ( ) const

is a charged PFO

Definition at line 251 of file PFO_v1.cxx.

251 {
252 return (fabs(this->charge())>1e-6);
253 }
float charge() const
get charge of PFO

◆ isJetETMissFloatForCompression()

bool xAOD::PFO_v1::isJetETMissFloatForCompression ( xAOD::PFODetails::PFOAttributes AttributeType) const
private

Performs a check as to whether a variable should be compressed.

Definition at line 312 of file PFO_v1.cxx.

312 {
313 switch (AttributeType) {
314 case PFODetails::PFOAttributes::eflowRec_LATERAL:
315 case PFODetails::PFOAttributes::eflowRec_LONGITUDINAL:
316 case PFODetails::PFOAttributes::eflowRec_SECOND_R:
317 case PFODetails::PFOAttributes::eflowRec_CENTER_LAMBDA:
318 case PFODetails::PFOAttributes::eflowRec_FIRST_ENG_DENS:
319 case PFODetails::PFOAttributes::eflowRec_ENG_FRAC_MAX:
320 case PFODetails::PFOAttributes::eflowRec_ISOLATION:
321 case PFODetails::PFOAttributes::eflowRec_ENG_BAD_CELLS:
322 case PFODetails::PFOAttributes::eflowRec_N_BAD_CELLS:
323 case PFODetails::PFOAttributes::eflowRec_BADLARQ_FRAC:
324 case PFODetails::PFOAttributes::eflowRec_ENG_POS:
325 case PFODetails::PFOAttributes::eflowRec_SIGNIFICANCE:
326 case PFODetails::PFOAttributes::eflowRec_AVG_LAR_Q:
327 case PFODetails::PFOAttributes::eflowRec_AVG_TILE_Q:
328 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EM:
329 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EM3:
330 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_HEC0:
331 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_HEC:
332 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_Tile0:
333 case PFODetails::PFOAttributes::eflowRec_TIMING:
334 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_PreSamplerB:
335 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EMB1:
336 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EMB2:
337 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EMB3:
338 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_PreSamplerE:
339 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EME1:
340 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EME2:
341 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_EME3:
342 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_HEC1:
343 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_HEC2:
344 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_HEC3:
345 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileBar0:
346 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileBar1:
347 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileBar2:
348 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileGap1:
349 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileGap2:
350 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileGap3:
351 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileExt0:
352 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileExt1:
353 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_TileExt2:
354 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_FCAL0:
355 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_FCAL1:
356 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_FCAL2:
357 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_MINIFCAL0:
358 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_MINIFCAL1:
359 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_MINIFCAL2:
360 case PFODetails::PFOAttributes::eflowRec_LAYERENERGY_MINIFCAL3:
361 return true;
362 default:
363 return false;
364 }
365 }

◆ m()

double xAOD::PFO_v1::m ( ) const
virtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 74 of file PFO_v1.cxx.

74 {
75
76 const static ConstAccessor<float> accM("m");
77 float M = accM(*this);
78 return M;
79 }

◆ mEM()

double xAOD::PFO_v1::mEM ( ) const
virtual

get EM scale mass

Definition at line 224 of file PFO_v1.cxx.

224 {
225
226 if (this->isCharged()) return this->m();
227 const static ConstAccessor<float> accM("mEM");
228 float M = accM(*this);
229
230 return M;
231 }

◆ nCaloCluster()

unsigned int xAOD::PFO_v1::nCaloCluster ( ) const

Find out how many CaloCluster are linked.

Definition at line 659 of file PFO_v1.cxx.

659 {
660 const ConstAccessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(PFODetails::CaloCluster);
661 if (!p_acc) return 0;
662 else if (!p_acc->isAvailable(*this)) {return 0;}
663 else{
664 const std::vector<ElementLink<IParticleContainer> >& theLinks = (*p_acc)(*this);
665 return theLinks.size();
666 }
667 }

◆ operator=()

PFO_v1 & xAOD::PFO_v1::operator= ( const PFO_v1 & other)
default

◆ p4()

PFO_v1::FourMom_t xAOD::PFO_v1::p4 ( ) const
virtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 95 of file PFO_v1.cxx.

95 {
97 p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
98 return p4;
99 }
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition PFO_v1.cxx:95

◆ p4EM()

PFO_v1::FourMom_t xAOD::PFO_v1::p4EM ( ) const

get EM scale 4-vector

Definition at line 144 of file PFO_v1.cxx.

144 {
145
146 if (this->isCharged()) return p4();
147
149
150 //change to use pt, eta, phi ,e
151 const static ConstAccessor<float> accPt("ptEM");
152 const static ConstAccessor<float> accEta("eta");
153 const static ConstAccessor<float> accPhi("phi");
154 const static ConstAccessor<float> accM("mEM");
155
156 p4EM.SetPtEtaPhiM(accPt(*this), accEta(*this), accPhi(*this), accM(*this));
157 return p4EM;
158 }

◆ phi()

double xAOD::PFO_v1::phi ( ) const
virtual

The azimuthal angle ( \(\phi\)) of the particle.

Implements xAOD::IParticle.

Definition at line 67 of file PFO_v1.cxx.

67 {
68
69 const static ConstAccessor<float> accPhi("phi");
70 float phi = accPhi(*this);
71 return phi;
72 }

◆ phiEM()

double xAOD::PFO_v1::phiEM ( ) const
virtual

get EM scale phi

Definition at line 220 of file PFO_v1.cxx.

220 {
221 return phi();
222 }

◆ pt()

double xAOD::PFO_v1::pt ( ) const
virtual

The transverse momentum ( \(p_T\)) of the particle.

Implements xAOD::IParticle.

Definition at line 52 of file PFO_v1.cxx.

52 {
53
54 const static ConstAccessor<float> accPt("pt");
55 float pt = accPt(*this);
56
57 return pt;
58 }

◆ ptEM()

double xAOD::PFO_v1::ptEM ( ) const
virtual

get EM scale pt

Definition at line 204 of file PFO_v1.cxx.

204 {
205
206 if (this->isCharged()) return this->pt();
207
208 const static ConstAccessor<float> accPt("ptEM");
209 float pt = accPt(*this);
210
211 return pt;
212 }

◆ rapidity()

double xAOD::PFO_v1::rapidity ( ) const
virtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 90 of file PFO_v1.cxx.

90 {
91
92 return genvecP4().Rapidity();
93 }

◆ setAssociatedParticleLink() [1/2]

void xAOD::PFO_v1::setAssociatedParticleLink ( const std::string & ParticleType,
const ElementLink< IParticleContainer > & theParticle )

Set an IParticle constituent via string - does NOT append to existing container.

Definition at line 566 of file PFO_v1.cxx.

566 {
567 std::vector<ElementLink<xAOD::IParticleContainer> > theLinks(1,theParticle);
569 }
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

◆ setAssociatedParticleLink() [2/2]

bool xAOD::PFO_v1::setAssociatedParticleLink ( PFODetails::PFOParticleType ParticleType,
const ElementLink< IParticleContainer > & theParticle )

Set an IParticle constituent via enum - does NOT append to existing container.

Definition at line 561 of file PFO_v1.cxx.

561 {
562 std::vector<ElementLink<xAOD::IParticleContainer> > theLinks(1,theParticle);
563 return this->setAssociatedParticleLinks(ParticleType,theLinks);
564 }

◆ setAssociatedParticleLinks() [1/2]

void xAOD::PFO_v1::setAssociatedParticleLinks ( const std::string & ParticleType,
const std::vector< ElementLink< IParticleContainer > > & theParticles )

Set a vector of PFO constituent particle types via string - overwrite is allowed.

Definition at line 629 of file PFO_v1.cxx.

629 {
630
631 //Given we do not know in advance in the POOL convertors about these containers, we set toPersistent() internally here.
632
633 std::vector<ElementLink<IParticleContainer> > storedContainer;
634 std::vector<ElementLink<IParticleContainer> >::const_iterator firstParticle = theParticles.begin();
635 for (; firstParticle != theParticles.end(); ++firstParticle){
636 ElementLink<xAOD::IParticleContainer> myLink = *firstParticle;
637 myLink.toPersistent();
638 storedContainer.push_back( myLink );
639 }
640
641 const static Accessor<std::vector<ElementLink<IParticleContainer > > > acc(ParticleType);
642 acc(*this) = storedContainer;
643 }

◆ setAssociatedParticleLinks() [2/2]

bool xAOD::PFO_v1::setAssociatedParticleLinks ( PFODetails::PFOParticleType ParticleType,
const std::vector< ElementLink< IParticleContainer > > & theParticles )

Set a vector of PFO constituent particle types via enum - overwrite is allowed.

Definition at line 600 of file PFO_v1.cxx.

600 {
601
602 const Accessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(ParticleType);
603 if (!p_acc) return false;
604 else{
605 (*p_acc)(*this) = theParticles;
606 return true;
607 }
608 }

◆ setAttribute() [1/6]

template<>
void xAOD::PFO_v1::setAttribute ( const std::string & AttributeType,
const double & anAttribute )

Definition at line 386 of file PFO_v1.cxx.

386 {
387
388 float internalAttribute = static_cast<float>(anAttribute);
389 setAttribute<float>(AttributeType, internalAttribute);
390
391 }
void setAttribute(PFODetails::PFOAttributes AttributeType, const T &anAttribute)
Set a PFO Variable via enum - overwrite is allowed.

◆ setAttribute() [2/6]

template<class T>
void xAOD::PFO_v1::setAttribute ( const std::string & AttributeType,
const T & anAttribute )

Set a PFO Variable via string - overwrite is allowed.

◆ setAttribute() [3/6]

template<>
void xAOD::PFO_v1::setAttribute ( const std::string & AttributeType,
const xAOD::PFODetails::PFOLeptonType & anAttribute )

specaial implementations for floats, for eflowRec JetETMiss variables, to reduce disk space usage

Definition at line 257 of file PFO_v1.cxx.

257 {
258 uint16_t uint16_variable = static_cast<uint16_t>(anAttribute);
259 this->setAttribute<uint16_t>(AttributeType, uint16_variable);
260 }

◆ setAttribute() [4/6]

template<>
void xAOD::PFO_v1::setAttribute ( PFODetails::PFOAttributes AttributeType,
const double & anAttribute )

special implementations for doubles to prevent user from putting doubles in the aux store - convert to float in this case

Definition at line 372 of file PFO_v1.cxx.

372 {
373 float internalAttribute = static_cast<float>(anAttribute);
374 setAttribute<float>(AttributeType, internalAttribute);
375 }

◆ setAttribute() [5/6]

template<>
void xAOD::PFO_v1::setAttribute ( PFODetails::PFOAttributes AttributeType,
const float & anAttribute )

Definition at line 274 of file PFO_v1.cxx.

274 {
275 if (this->isJetETMissFloatForCompression(AttributeType)){
276 float dummy = anAttribute*s_floatCompressionFactor;
277 const static int maxIntSize = 1000000000;
278 int internalAttribute = maxIntSize;
279 if (dummy < 0) internalAttribute *= -1;//if we had a large -ve energy, then we should set the max size to a -ve value
280 if (dummy < maxIntSize && dummy > -maxIntSize) internalAttribute = static_cast<int>(dummy);
281 setAttribute<int>(AttributeType, internalAttribute);
282 }
283 else {
284 float internalAttribute = anAttribute;
285 (*(PFOAttributesAccessor_v1<float>::constAccessor(AttributeType)))(*this) = internalAttribute;
286 }
287 }

◆ setAttribute() [6/6]

template<class T>
void xAOD::PFO_v1::setAttribute ( PFODetails::PFOAttributes AttributeType,
const T & anAttribute )

Set a PFO Variable via enum - overwrite is allowed.

◆ setBDTPi0Score()

void xAOD::PFO_v1::setBDTPi0Score ( float BDTPi0Score)

set BDT Score used to classify clusters as Pi0 like or not

◆ setCenterMag()

void xAOD::PFO_v1::setCenterMag ( float CenterMag)

set CenterMag moment needed for vertex correction

◆ setCharge()

void xAOD::PFO_v1::setCharge ( float charge)

set charge of PFO

◆ setClusterLink()

bool xAOD::PFO_v1::setClusterLink ( const ElementLink< xAOD::CaloClusterContainer > & theCluster)

Set a cluster constituent - does NOT append to existing container.

Definition at line 549 of file PFO_v1.cxx.

549 {
550 ElementLink< xAOD::IParticleContainer > myClusterLink;
551 this->convertLink(myClusterLink,theCluster);
552 return this->setAssociatedParticleLink(PFODetails::CaloCluster, myClusterLink);
553 }
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

◆ setP4() [1/2]

void xAOD::PFO_v1::setP4 ( const FourMom_t & vec)

set the 4-vec

Definition at line 107 of file PFO_v1.cxx.

107 {
108
109 const static Accessor<float> accPt("pt");
110 accPt(*this) = vec.Pt();
111
112 const static Accessor<float> accEta("eta");
113 accEta(*this) = vec.Eta();
114
115 const static Accessor<float> accPhi("phi");
116 accPhi(*this) = vec.Phi();
117
118 const static Accessor<float> accM("m");
119 accM(*this) = vec.M();
120
121 }
std::vector< size_t > vec

◆ setP4() [2/2]

void xAOD::PFO_v1::setP4 ( float pt,
float eta,
float phi,
float m = 0.0 )

set the 4-vec

Definition at line 124 of file PFO_v1.cxx.

124 {
125
126 const static Accessor<float> accPt("pt");
127 accPt(*this) = pt;
128
129 const static Accessor<float> accEta("eta");
130 accEta(*this) = eta;
131
132 const static Accessor<float> accPhi("phi");
133 accPhi(*this) = phi;
134
135 const static Accessor<float> accM("m");
136 accM(*this) = m;
137 }

◆ setP4EM() [1/2]

void xAOD::PFO_v1::setP4EM ( const FourMom_t & p4EM)

set EM scale 4-vector

Definition at line 173 of file PFO_v1.cxx.

173 {
174 const static Accessor<float> accPt("ptEM");
175 accPt(*this) = p4EM.Pt();
176
177 const static Accessor<float> accEta("eta");
178 accEta(*this) = p4EM.Eta();
179
180 const static Accessor<float> accPhi("phi");
181 accPhi(*this) = p4EM.Phi();
182
183 const static Accessor<float> accM("mEM");
184 accM(*this) = p4EM.M();
185
186 }

◆ setP4EM() [2/2]

void xAOD::PFO_v1::setP4EM ( float pt,
float eta,
float phi,
float m )

set EM scale 4-vector

Definition at line 188 of file PFO_v1.cxx.

188 {
189
190 const static Accessor<float> accPt("ptEM");
191 accPt(*this) = pt;
192
193 const static Accessor<float> accEta("eta");
194 accEta(*this) = eta;
195
196 const static Accessor<float> accPhi("phi");
197 accPhi(*this) = phi;
198
199 const static Accessor<float> accM("mEM");
200 accM(*this) = m;
201
202 }

◆ setTrackLink()

bool xAOD::PFO_v1::setTrackLink ( const ElementLink< xAOD::TrackParticleContainer > & theTrack)

Set a track constituent - does NOT append to existing container.

Definition at line 543 of file PFO_v1.cxx.

543 {
544 ElementLink< xAOD::IParticleContainer > myTrackLink;
545 this->convertLink(myTrackLink,theTrack);
546 return this->setAssociatedParticleLink(PFODetails::Track, myTrackLink);
547 }

◆ setVertexLink()

bool xAOD::PFO_v1::setVertexLink ( const ElementLink< xAOD::VertexContainer > & theVertexLink)

Set a vertex link.

Definition at line 536 of file PFO_v1.cxx.

536 {
537 const static Accessor<ElementLink<xAOD::VertexContainer> > acc("pfo_vertex");
538 acc(*this) = theVertexLink;
539 acc(*this).toPersistent();
540 return true;
541 }

◆ toPersistent()

void xAOD::PFO_v1::toPersistent ( )

prepare all links for persistification

Definition at line 774 of file PFO_v1.cxx.

774 {
775
776 //setup known links for persistification, if they exist
777 //if you added your own consituents the links will not be correctly persistified
778
779 //clusters
780 const Accessor<std::vector<ElementLink<IParticleContainer > > >* p_accClusters = PFOParticleTypeMapper_temp::getAccessor(PFODetails::CaloCluster);
781 if (p_accClusters){
782 const Accessor<std::vector<ElementLink<IParticleContainer > > >& accClusters = *p_accClusters;
783 if ( accClusters.isAvailableWritable(*this) ){
784 std::vector<ElementLink<IParticleContainer> >& theClusterLinks = accClusters(*this);
785 std::vector< ElementLink< IParticleContainer > >::iterator firstClus = theClusterLinks.begin();
786 std::vector< ElementLink< IParticleContainer > >::iterator lastClus = theClusterLinks.end();
787 for (; firstClus != lastClus; ++firstClus) firstClus->toPersistent();
788 }
789 }
790
791 //tracks
792 const Accessor<std::vector<ElementLink<IParticleContainer > > >* p_accTracks = PFOParticleTypeMapper_temp::getAccessor(PFODetails::Track);
793 if (p_accTracks){
794 const Accessor<std::vector<ElementLink<IParticleContainer > > >& accTracks = *p_accTracks;
795 if ( accTracks.isAvailableWritable(*this) ){
796 std::vector<ElementLink<IParticleContainer> >& theTrackLinks = accTracks(*this);
797 std::vector< ElementLink< IParticleContainer > >::iterator firstTrack = theTrackLinks.begin();
798 std::vector< ElementLink< IParticleContainer > >::iterator lastTrack = theTrackLinks.end();
799 for (; firstTrack != lastTrack; ++firstTrack) firstTrack->toPersistent();
800
801 }
802 }
803
804 //shots
805 const Accessor<std::vector<ElementLink<IParticleContainer > > >* p_accShots = PFOParticleTypeMapper_temp::getAccessor(PFODetails::TauShot);
806 if (p_accShots){
807 const Accessor<std::vector<ElementLink<IParticleContainer > > >& accShots = *p_accShots;
808 if ( accShots.isAvailableWritable(*this) ){
809 std::vector<ElementLink<IParticleContainer> >& theShotLinks = accShots(*this);
810 std::vector< ElementLink< IParticleContainer > >::iterator firstShot = theShotLinks.begin();
811 std::vector< ElementLink< IParticleContainer > >::iterator lastShot = theShotLinks.end();
812 for (; firstShot != lastShot; ++firstShot) firstShot->toPersistent();
813 }
814 }
815
816 }
JetConstituentVector::iterator iterator

◆ track()

const TrackParticle * xAOD::PFO_v1::track ( unsigned int index) const

Retrieve a const pointer to a Rec::TrackParticle.

Definition at line 691 of file PFO_v1.cxx.

691 {
692
693 const ConstAccessor<std::vector<ElementLink<IParticleContainer > > >* p_acc = PFOParticleTypeMapper_temp::getAccessor(PFODetails::Track);
694 if (!p_acc) return nullptr;
695 else if (!p_acc->isAvailable(*this)) {return nullptr;}
696 else {
697 const std::vector<ElementLink<IParticleContainer> >& theLinks = (*p_acc)(*this);
698 if(index<theLinks.size()) {
699 ElementLink<IParticleContainer> theLink = theLinks[index];
700 if (theLink.isValid()){
701 const IParticle *theParticle = *theLinks[index];
702 if (nullptr == theParticle) return nullptr;
703 else if (Type::TrackParticle == theParticle->type()) return static_cast<const TrackParticle*>(theParticle);
704 else return nullptr;
705 }
706 else return nullptr;
707 }
708 else return nullptr;
709 }
710 }
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ type()

Type::ObjectType xAOD::PFO_v1::type ( ) const
virtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 140 of file PFO_v1.cxx.

140 {
141 return Type::ParticleFlow;
142 }

◆ vertex()

const xAOD::Vertex * xAOD::PFO_v1::vertex ( ) const

Retrieve a const pointer to the xAOD::Vertex a charged PFO is associated to.

Definition at line 712 of file PFO_v1.cxx.

712 {
713 const static ConstAccessor<ElementLink<xAOD::VertexContainer> > acc("pfo_vertex");
714 if (!acc.isAvailable(*this)) return nullptr;
715 else{
716 const ElementLink<xAOD::VertexContainer>& tempVertexLink = acc(*this);
717 if (tempVertexLink.isValid()) return *acc(*this);
718 else return nullptr;
719 }
720 }

◆ VertexCorrectTheFourVector()

void xAOD::PFO_v1::VertexCorrectTheFourVector ( const TVector3 & vertexToCorrectTo,
TLorentzVector & theFourVector ) const
private

This does the vertex correction of neutral PFO.

Definition at line 752 of file PFO_v1.cxx.

752 {
753
754 float clusterEta = theFourVector.Eta();
755 float centerMag = this->centerMag();
756
757 float radius = centerMag/cosh(clusterEta);
758
759 float EtaVertexCorrection = 0.0, PhiVertexCorrection = 0.0;
760 float clusterPhi = theFourVector.Phi();
761
762 if (radius > 1.0 && centerMag > 1e-3){
763 EtaVertexCorrection = (-vertexToCorrectTo.Z()/cosh(clusterEta) + (vertexToCorrectTo.X()*cos(clusterPhi) + vertexToCorrectTo.Y()*sin(clusterPhi))*tanh(clusterEta))/radius;
764 PhiVertexCorrection = (vertexToCorrectTo.X()*sin(clusterPhi) - vertexToCorrectTo.Y()*cos(clusterPhi))/radius;
765 }
766
767 float etaVertexCorrected = clusterEta + EtaVertexCorrection;
768 float p = std::sqrt(theFourVector.E()*theFourVector.E()-theFourVector.M()*theFourVector.M());
769 float ptVertexCorrected = p/cosh(etaVertexCorrected);
770 theFourVector.SetPtEtaPhiM(ptVertexCorrected, etaVertexCorrected, clusterPhi + PhiVertexCorrection, theFourVector.M());
771
772 }
float centerMag() const
get CenterMag moment needed for vertex correction

Member Data Documentation

◆ s_floatCompressionFactor

const int xAOD::PFO_v1::s_floatCompressionFactor = 1000
staticprivate

this defines the factor to compress floats by

Definition at line 203 of file PFO_v1.h.


The documentation for this class was generated from the following files: