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)
using TypelessConstAccessor = ConstAuxElement::TypelessConstAccessor
template<class T, class ALLOC = AuxAllocator_t<T>>
using ConstAccessor = SG::ConstAccessor<T, ALLOC>
template<class T, class ALLOC = AuxAllocator_t<T>>
using Decorator = SG::Decorator<T, ALLOC>
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
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type auxdata (const std::string &name)
 Fetch an aux data variable, as a non-const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdata (const std::string &name) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="")
 Check if an aux variable is available for writing.
void assign (const AuxElement &other, bool warnUnlocked=false)
 Assignment.
const SG::AuxVectorDatacontainer () const
 Return the container holding this element.
SG::AuxVectorDatacontainer ()
 Return the container holding this element.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst (const std::string &name) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst (const std::string &name, const std::string &clsname) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritableAsDecoration (const std::string &name, const std::string &clsname="") const
 Check if an aux variable is available for writing as a decoration.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor (const std::string &name) const
 Fetch an aux decoration, as a non-const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor (const std::string &name, const std::string &clsname) const
 Fetch an aux decoration, as a non-const reference.
void makePrivateStore ()
 Create a new (empty) private store for this object.
template<class U1>
void makePrivateStore (const U1 &other, bool warnUnlocked=false)
 Create a new private store for this object and copy aux data.
template<class U1>
void makePrivateStore (const U1 *other, bool warnUnlocked=false)
 Create a new private store for this object and copy aux data.
void releasePrivateStore ()
 Release and free any private store associated with this object.
void setStore (const SG::IConstAuxStore *store)
 Set the store associated with this object.
void setStore (SG::IAuxStore *store)
 Set the store associated with this object.
void setStore (const DataLink< SG::IConstAuxStore > &store)
 Set the store associated with this object.
void setConstStore (const SG::IConstAuxStore *store)
 Synonym for setStore with IConstAuxStore.
void setNonConstStore (SG::IAuxStore *store)
 Synonym for setStore with IAuxStore.
bool usingPrivateStore () const
 Test to see if this object is currently using a private store.
bool usingStandaloneStore () const
 Test to see if this object is currently using a standalone store.
void clearCache ()
 Clear the cached aux data pointers.
const SG::auxid_set_tgetAuxIDs () const
 Return a set of identifiers for existing data items for this object.
const SG::auxid_set_tgetDecorIDs () const
 Return a set of identifiers for decorations for this object.
bool hasStore () const
 Return true if this object has an associated store.
bool hasNonConstStore () const
 Return true if this object has an associated non-const store.
bool clearDecorations () const
 Clear all decorations.
bool trackIndices () const
 Return true if index tracking is enabled for this object.
size_t index () const
 Return the index of this element within its container.
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.

Static Public Attributes

static constexpr bool supportsThinning = true
 Mark that this type supports thinning operations.

Protected Types

template<class T, class ALLOC = AuxAllocator_t<T>>
using Accessor

Protected Member Functions

const SG::IConstAuxStoregetConstStore () const
 Return the current store, as a const interface.
SG::IAuxStoregetStore () const
 Return the current store, as a non-const interface.
bool noPrivateData () const
 True if this element has no private data.
bool havePrivateData () const
 True if this element currently has private data.
bool hadPrivateData () const
 True if this element had private data before it was added to its current container.

Private Types

enum class  PrivateStoreState : uint8_t { NO_PRIVATE = 0 , HAVE_PRIVATE = 1 , HAD_PRIVATE = 2 }
 The current private data state. More...

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.
void releasePrivateStoreForDtor ()
 Out-of-line portion of destructor.
void setIndex (size_t index, SG::AuxVectorData *container)
 Set the index/container for this element.
bool setIndexPrivate (size_t index, SG::AuxVectorData *container)
 Set the index/container for this element.
void makePrivateStore1 (const void *other, bool warnUnlocked)
 Create a new private store for this object and copy aux data.
void makePrivateStore1 (const AuxElement *other, bool warnUnlocked)
 Create a new private store for this object and copy aux data.
AuxElementStandaloneData * setStore1 (const SG::IConstAuxStore *store)
 Set the store associated with this object.
void clearAux ()
 Clear all aux data associated with this element.
void copyAux (const ConstAuxElement &other, bool warnUnlocked=false)
 Copy aux data from another object.
void setNoPrivateData ()
 Record that this element does not have private data.
void setHavePrivateData ()
 Record that this element currently has private data.
void setHadPrivateData ()
 Record that this element used to have private data.

Static Private Member Functions

static void clearAuxHelper (AuxVectorData &container, size_t index)
 Clear all aux data associated with an element.
static void copyAuxHelper (AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
 Copy aux data from another object.

Private Attributes

const SG::AuxVectorDatam_container
 The container of which this object is an element.
size_t m_index
 The index of this element within its container.
PrivateStoreState m_privateStoreState

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

◆ Accessor

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::Accessor
protectedinherited

Definition at line 572 of file AuxElement.h.

◆ ConstAccessor

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::ConstAccessor = SG::ConstAccessor<T, ALLOC>
inherited

Definition at line 569 of file AuxElement.h.

◆ Decorator

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::Decorator = SG::Decorator<T, ALLOC>
inherited

Definition at line 575 of file AuxElement.h.

◆ 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.

◆ TypelessConstAccessor

using SG::AuxElement::TypelessConstAccessor = ConstAuxElement::TypelessConstAccessor
inherited

Definition at line 566 of file AuxElement.h.

Member Enumeration Documentation

◆ PrivateStoreState

enum class SG::IAuxElement::PrivateStoreState : uint8_t
strongprivateinherited

The current private data state.

Enumerator
NO_PRIVATE 
HAVE_PRIVATE 
HAD_PRIVATE 

Definition at line 131 of file IAuxElement.h.

132 {
133 NO_PRIVATE = 0,
134 HAVE_PRIVATE = 1,
135 HAD_PRIVATE = 2,
136 };

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
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
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
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 {
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

◆ assign()

void SG::AuxElement::assign ( const AuxElement & other,
bool warnUnlocked = false )
inherited

Assignment.

Parameters
otherThe object from which we're assigning.
warnUnlockedIf true, then warn when we skip unlocked decorations.

We don't copy container/index, as assignment doesn't change where this object is. However, if we have aux data, then we copy aux data if we're copying from an object that also has it; otherwise, if we're copying from an object with no aux data, then we clear ours.

◆ 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 {
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 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Helper class to provide type-safe access to aux data.
Definition AuxElement.h:131

◆ 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
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 isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
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{
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/4]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type SG::AuxElement::auxdata ( const std::string & name)
inherited

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

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ auxdata() [2/4]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdata ( const std::string & name) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor or ConstAccessor classes.

◆ auxdata() [3/4]

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 }

◆ auxdata() [4/4]

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 }

◆ auxdataConst() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdataConst ( const std::string & name) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the ConstAccessor class.

◆ auxdataConst() [2/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdataConst ( const std::string & name,
const std::string & clsname ) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the ConstAccessor class.

◆ auxdecor() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type SG::AuxElement::auxdecor ( const std::string & name) const
inherited

Fetch an aux decoration, as a non-const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

If the container is locked, this will allow fetching only variables that do not yet exist (in which case they will be marked as decorations) or variables already marked as decorations.

◆ auxdecor() [2/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type SG::AuxElement::auxdecor ( const std::string & name,
const std::string & clsname ) const
inherited

Fetch an aux decoration, as a non-const reference.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

If the container is locked, this will allow fetching only variables that do not yet exist (in which case they will be marked as decorations) or variables already marked as decorations.

◆ 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

◆ clearAux()

void SG::AuxElement::clearAux ( )
privateinherited

Clear all aux data associated with this element.

If this object has no associated store, this does nothing. If the associated aux data is const, this throws ExcConstAuxData.

Definition at line 580 of file AuxElement.cxx.

581{
582 if (!m_container) return;
584}
static void clearAuxHelper(AuxVectorData &container, size_t index)
Clear all aux data associated with an element.
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t index() const
Return the index of this element within its container.
const SG::AuxVectorData * m_container
The container of which this object is an element.
Definition AuxElement.h:335

◆ clearAuxHelper()

void SG::AuxElement::clearAuxHelper ( AuxVectorData & container,
size_t index )
staticprivateinherited

Clear all aux data associated with an element.

Parameters
containerContainer of the element.
indexIndex of this element within the container.

If the associated aux data is const, this throws ExcConstAuxData.

Definition at line 639 of file AuxElement.cxx.

640{
641 if (!container.hasStore()) return;
642 if (!container.hasNonConstStore()) {
643 throw SG::ExcConstAuxData ("clearAux", SG::null_auxid);
644 }
645
646 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
647 for (SG::auxid_t auxid : container.getWritableAuxIDs()) {
648 r.clear (auxid, container, index, 1);
649 }
650}
static AuxTypeRegistry & instance()
Return the singleton registry instance.
int r
Definition globals.cxx:22
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

◆ clearCache()

void SG::AuxElement::clearCache ( )
inherited

Clear the cached aux data pointers.

You should call this any time something changes in the aux store that could invalidate the vector pointers.

Definition at line 339 of file AuxElement.cxx.

340{
341 if (container())
343}
void clearCache()
Clear the cached aux data pointers.

◆ clearDecorations()

bool SG::AuxElement::clearDecorations ( ) const
inherited

Clear all decorations.

Erase all decorations from an associated store, restoring the state to when lock was called.

Returns true if there were any decorations that were cleared, false if the store did not contain any decorations.

Definition at line 428 of file AuxElement.cxx.

429{
430 if (havePrivateData())
431 return m_container->clearDecorations();
432 return false;
433}
bool havePrivateData() const
True if this element currently has private data.

◆ 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
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 }
size_t index() const
Return the index of this element within its container.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ container() [1/2]

SG::AuxVectorData * SG::AuxElement::container ( )
inherited

Return the container holding this element.

◆ container() [2/2]

const SG::AuxVectorData * SG::AuxElement::container ( ) const
inherited

Return the container holding this element.

◆ 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?

◆ copyAux()

void SG::AuxElement::copyAux ( const ConstAuxElement & other,
bool warnUnlocked = false )
privateinherited

Copy aux data from another object.

Parameters
otherThe object from which to copy.
warnUnlockedIf true, then warn when we skip unlocked decorations.

If this object has no associated store, this does nothing. If the associated aux data is const, this throws ExcConstAuxData.

All aux data items from other are copied to this object. Any aux data items associated with this object that are not present in other are cleared. (If other has no aux data, then all aux data items for this object are cleared.)

Definition at line 600 of file AuxElement.cxx.

602{
603 if (!m_container) return;
604 copyAuxHelper (*container(), index(), other, warnUnlocked);
605}
static void copyAuxHelper(AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
Copy aux data from another object.

◆ copyAuxHelper()

void SG::AuxElement::copyAuxHelper ( AuxVectorData & container,
size_t index,
const ConstAuxElement & other,
bool warnUnlocked )
staticprivateinherited

Copy aux data from another object.

Parameters
containerContainer of the element.
indexIndex of this element within the container.
otherThe object from which to copy.
warnUnlockedIf true, then warn when we skip unlocked decorations.

If the associated aux data is const, this throws ExcConstAuxData.

All aux data items from other are copied to this object. Any aux data items associated with this object that are not present in other are cleared. (If other has no aux data, then all aux data items for this object are cleared.)

Definition at line 667 of file AuxElement.cxx.

671{
672 if (!container.hasStore()) return;
673 if (!container.hasNonConstStore())
674 throw SG::ExcConstAuxData ("copyAux");
675
676 const SG::AuxVectorData* ocont = other.container();
677
678 if (!ocont || !ocont->hasStore()) {
680 return;
681 }
682
683#ifndef XAOD_STANDALONE
684 const SG::auxid_set_t& other_decors = ocont->getDecorIDs();
685#endif
686 SG::auxid_set_t other_ids = ocont->getAuxIDs();
687
688 size_t oindex = other.index();
689 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
690
691 for (SG::auxid_t auxid : other_ids) {
692#ifndef XAOD_STANDALONE
693 if (other_decors.test (auxid)) {
694 // Don't copy decorations --- another thread may be modifying them.
695 other_ids.reset (auxid);
696 // Warn if we skip a decoration (except for mcEventWeights,
697 // for which this is expected).
698 if (warnUnlocked && r.getName(auxid) != "mcEventWeights") {
699 std::ostringstream ss;
700 ss << "skipped unlocked decoration " << r.getName(auxid)
701 << " (" << auxid << ")";
702 ATHCONTAINERS_WARNING("copyAux", ss.str());
703 }
704 }
705 else
706#endif
707 if (!r.isLinked (auxid)) {
708 r.copy (auxid, container, index, *ocont, oindex, 1);
709 }
710 }
711
712 for (SG::auxid_t auxid : container.getWritableAuxIDs()) {
713 if (!other_ids.test (auxid)) {
714 r.clear (auxid, container, index, 1);
715 }
716 }
717}
static Double_t ss
bool test(bit_t bit) const
Test to see if a bit is set.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
bool hasStore() const
Return true if this object has an associated store.
#define ATHCONTAINERS_WARNING(ctx, msg)
Definition error.h:57

◆ 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.

◆ getAuxIDs()

const SG::auxid_set_t & SG::AuxElement::getAuxIDs ( ) const
inherited

Return a set of identifiers for existing data items for this object.

If this object has a private or standalone store, then information from that will be returned. Otherwise, if this element is part of a container, then information for the container will be returned. Otherwise, return an empty set.

Definition at line 355 of file AuxElement.cxx.

356{
357#ifdef ATHCONTAINERS_R21_COMPAT
358 if (havePrivateData())
359 return m_container->getConstStore()->getAuxIDs();
360 if (container())
361 return container()->getAuxIDs();
362 static const SG::auxid_set_t null_set;
363 return null_set;
364#else
366#endif
367}
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.

◆ 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

◆ getConstStore()

const SG::IConstAuxStore * SG::AuxElement::getConstStore ( ) const
protectedinherited

Return the current store, as a const interface.

This will be non-zero if either a const or non-const store is associated with this object. This will fetch either a private or standalone store.

Definition at line 869 of file AuxElement.cxx.

305{
306 if (havePrivateData()) {
307 return m_container->getConstStore();
308 }
309 return 0;
310}

◆ getDecorIDs()

const SG::auxid_set_t & SG::AuxElement::getDecorIDs ( ) const
inherited

Return a set of identifiers for decorations for this object.

   If this object has a private or standalone store, then information
   from that will be returned.  Otherwise, if this element
   is part of a container, then information for the container
   will be returned.  Otherwise, return an empty set.

Definition at line 378 of file AuxElement.cxx.

379{
380#ifdef ATHCONTAINERS_R21_COMPAT
381 if (havePrivateData())
382 return m_container->getConstStore()->getDecorIDs();
383 if (container())
384 return container()->getDecorIDs();
385 static const SG::auxid_set_t null_set;
386 return null_set;
387#else
389#endif
390}
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.

◆ getStore()

SG::IAuxStore * SG::AuxElement::getStore ( ) const
protectedinherited

Return the current store, as a non-const interface.

This will be non-zero if a non-const store is associated with this object. This will fetch either a private or standalone store.

Definition at line 878 of file AuxElement.cxx.

320{
321 if (havePrivateData()) {
322#ifdef ATHCONTAINERS_R21_COMPAT
323 SG::AuxVectorData* container_nc ATLAS_THREAD_SAFE = m_container;
324#else
325 SG::AuxVectorData* container_nc ATLAS_THREAD_SAFE = const_cast<SG::AuxVectorData*>(container());
326#endif
327 return container_nc->getStore();
328 }
329 return 0;
330}
#define ATLAS_THREAD_SAFE

◆ 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

◆ hadPrivateData()

bool SG::IAuxElement::hadPrivateData ( ) const
protectedinherited

True if this element had private data before it was added to its current container.

◆ hasNonConstStore()

bool SG::AuxElement::hasNonConstStore ( ) const
inherited

Return true if this object has an associated non-const store.

This will be true for either a private or standalone store.

Definition at line 411 of file AuxElement.cxx.

412{
413 if (havePrivateData())
414 return m_container->hasNonConstStore();
415 return false;
416}

◆ hasStore()

bool SG::AuxElement::hasStore ( ) const
inherited

Return true if this object has an associated store.

This will be true for either a private or standalone store.

Definition at line 398 of file AuxElement.cxx.

399{
400 if (havePrivateData())
401 return m_container->hasStore();
402 return false;
403}

◆ havePrivateData()

bool SG::IAuxElement::havePrivateData ( ) const
protectedinherited

True if this element currently has private data.

◆ index()

size_t SG::IAuxElement::index ( ) const
inherited

Return the index of this element within its container.

Inherited from IAuxElement.

◆ 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 }

◆ isAvailableWritable() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool SG::AuxElement::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" )
inherited

Check if an aux variable is available for writing.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ isAvailableWritable() [2/2]

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 }

◆ isAvailableWritableAsDecoration()

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool SG::AuxElement::isAvailableWritableAsDecoration ( const std::string & name,
const std::string & clsname = "" ) const
inherited

Check if an aux variable is available for writing as a decoration.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ 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 }

◆ makePrivateStore() [1/3]

void SG::AuxElement::makePrivateStore ( )
inherited

Create a new (empty) private store for this object.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

Definition at line 192 of file AuxElement.cxx.

193{
194 if (m_container) {
195 throw SG::ExcBadPrivateStore ("store already exists");
196 }
197
198 m_container = new SG::AuxElementPrivateData;
201}
void setIndex(size_t index)
Set the index of this element within its container.
void setHavePrivateData()
Record that this element currently has private data.

◆ makePrivateStore() [2/3]

template<class U1>
void SG::AuxElement::makePrivateStore ( const U1 & other,
bool warnUnlocked = false )
inherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

If other is an object that has aux data, then those data will be copied; otherwise, nothing will be done.

◆ makePrivateStore() [3/3]

template<class U1>
void SG::AuxElement::makePrivateStore ( const U1 * other,
bool warnUnlocked = false )
inherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

If other is an object that has aux data, then those data will be copied; otherwise, nothing will be done.

◆ makePrivateStore1() [1/2]

void SG::AuxElement::makePrivateStore1 ( const AuxElement * other,
bool warnUnlocked )
privateinherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

This overload handles the case where other does have aux data.

Definition at line 565 of file AuxElement.cxx.

567{
569 if (other)
570 this->copyAux (*other, warnUnlocked);
571}
void copyAux(const ConstAuxElement &other, bool warnUnlocked=false)
Copy aux data from another object.

◆ makePrivateStore1() [2/2]

void SG::AuxElement::makePrivateStore1 ( const void * other,
bool warnUnlocked )
privateinherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

This overload handles the case where other does not have aux data.

◆ 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 {
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 }

◆ noPrivateData()

bool SG::IAuxElement::noPrivateData ( ) const
protectedinherited

True if this element has no private data.

◆ 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 }

◆ releasePrivateStore()

void SG::AuxElement::releasePrivateStore ( )
inherited

Release and free any private store associated with this object.

ExcBadPrivateStore will be thrown if this object does not have a private store.

Definition at line 210 of file AuxElement.cxx.

211{
212 if (hadPrivateData()) {
213 // We had a private store, but it was released because this object
214 // was added to a container. Just forget about it.
216 return;
217 }
218
219 if (!havePrivateData() ||
220 !m_container ||
221 typeid(*m_container) != typeid(AuxElementPrivateData))
222 {
223 throw SG::ExcBadPrivateStore ("no private store exists");
224 }
225
228 delete m_container;
229 m_container = 0;
230}
bool hadPrivateData() const
True if this element had private data before it was added to its current container.
void setNoPrivateData()
Record that this element does not have private data.

◆ releasePrivateStoreForDtor()

void SG::AuxElement::releasePrivateStoreForDtor ( )
privateinherited

Out-of-line portion of destructor.

Delete a private store if we have one.

Definition at line 441 of file AuxElement.cxx.

442{
443#ifdef ATHCONTAINERS_R21_COMPAT
444 if (havePrivateData()) {
445 delete m_container;
446 }
447#else
449#endif
450}
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.

◆ 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
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
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

◆ setConstStore()

void SG::AuxElement::setConstStore ( const SG::IConstAuxStore * store)
inherited

Synonym for setStore with IConstAuxStore.

Parameters
storeThe new store.

◆ setHadPrivateData()

void SG::IAuxElement::setHadPrivateData ( )
privateinherited

Record that this element used to have private data.

◆ setHavePrivateData()

void SG::IAuxElement::setHavePrivateData ( )
privateinherited

Record that this element currently has private data.

◆ setIndex()

void SG::AuxElement::setIndex ( size_t index,
SG::AuxVectorData * container )
privateinherited

Set the index/container for this element.

Parameters
indexThe index of this object within the container.
containerThe container holding this object. May be null if this object is being removed from a container.

Usually this simply sets the index and container members of this object. However, in the case where this object has an associated private store, then we need to deal with releasing the store if the object is being added to a container, or making a new store if the object is being removed from a container.

◆ setIndexPrivate()

bool SG::AuxElement::setIndexPrivate ( size_t index,
SG::AuxVectorData * container )
privateinherited

Set the index/container for this element.

Parameters
indexThe index of this object within the container.
containerThe container holding this object. May be null if this object is being removed from a container.

This is called from setIndex when we have a private store to deal with.

Definition at line 505 of file AuxElement.cxx.

506{
507#ifdef ATHCONTAINERS_R21_COMPAT
508 if (hadPrivateData()) {
509 // We had a private store, but it was released because we were added
510 // to a container.
511
512 if (container == 0) {
513 // We're being moved out of the container. Make a new private
514 // store, copy the data, and switch to it.
515 auto privateData = new SG::AuxElementPrivateData;
516 AuxElement to (privateData, 0);
517 to.copyAux (*this);
520 m_container = privateData;
521 return true;
522 }
523 }
524 else if (havePrivateData() &&
525 typeid(*m_container) == typeid(AuxElementPrivateData))
526 {
527 // We currently have a private store.
528
529 if (container != 0 && container != m_container) {
530 // We're being added to a container.
531 // Aux data has already been copied.
532 // Release private store.
535 delete m_container;
537 return false;
538 }
539 }
540 else {
541 // We have a standalone store.
542 throw SG::ExcBadPrivateStore ("Attempt to add/remove a standalone object "
543 "from a container.");
544 }
545
548 return false;
549#else
551#endif
552}
AuxElement()
Default constructor.
bool setIndexPrivate(size_t index, const SG::AuxVectorData *container)
Set the index/container for this element.
void setHadPrivateData()
Record that this element used to have private data.
CONT to(RANGE &&r)
Definition ranges.h:39

◆ setNonConstStore()

void SG::AuxElement::setNonConstStore ( SG::IAuxStore * store)
inherited

Synonym for setStore with IAuxStore.

Parameters
storeThe new store.

◆ setNoPrivateData()

void SG::IAuxElement::setNoPrivateData ( )
privateinherited

Record that this element does not have private data.

◆ 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 }

◆ setStore() [1/3]

void SG::AuxElement::setStore ( const DataLink< SG::IConstAuxStore > & store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Parameters
storeLink to the new store.

Definition at line 269 of file AuxElement.cxx.

270{
271 AuxElementStandaloneData* data = setStore1 (store);
272 if (store)
273 data->setStore (store);
274}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
AuxElementStandaloneData * setStore1(const SG::IConstAuxStore *store)
Set the store associated with this object.

◆ setStore() [2/3]

void SG::AuxElement::setStore ( const SG::IConstAuxStore * store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Definition at line 241 of file AuxElement.cxx.

242{
243 AuxElementStandaloneData* data = setStore1 (store);
244 if (store)
245 data->setStore (store);
246}

◆ setStore() [3/3]

void SG::AuxElement::setStore ( SG::IAuxStore * store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Definition at line 257 of file AuxElement.cxx.

258{
259 AuxElementStandaloneData* data = setStore1 (store);
260 if (store)
261 data->setStore (store);
262}

◆ setStore1()

AuxElementStandaloneData * SG::AuxElement::setStore1 ( const SG::IConstAuxStore * store)
privateinherited

Set the store associated with this object.

Parameters
storeThe new store.

Helper for setStore. Creates the AuxElementStandaloneData object if needed and returns it.

Parameters
storeThe new store.

Helper for setStore. Creates the @x AuxElementStandaloneData object if needed and returns it.

Definition at line 461 of file AuxElement.cxx.

462{
463 if (store) {
464 // Want this object be standalone.
465 if (!m_container) {
466 // Not in a container (and no private store). Make a new object.
467 AuxElementStandaloneData* data = new AuxElementStandaloneData;
470 return data;
471 }
472 if (usingStandaloneStore()) {
473 // Standalone --- return existing object.
474 return static_cast<AuxElementStandaloneData*> (container());
475 }
476 // Otherwise, it's an error.
477 throw ExcBadPrivateStore ("Attempt to attach a standalone store to an "
478 "object in a container or with a private store.");
479 }
480
481 else {
482 // Getting rid of a standalone store.
483 if (usingStandaloneStore()) {
485 delete m_container;
486 m_container = 0;
487 }
488 else if (m_container != 0)
489 throw ExcBadPrivateStore ("Attempt to remove a standalone store from an "
490 "object in a container or with a private store.");
491 return 0;
492 }
493}
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.

◆ 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
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
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
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
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:

◆ trackIndices()

bool SG::AuxElement::trackIndices ( ) const
inherited

Return true if index tracking is enabled for this object.

Always returns true. Included here to be consistent with AuxVectorBase when standalone objects may be used as template parameters.

◆ 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 }

◆ usingPrivateStore()

bool SG::AuxElement::usingPrivateStore ( ) const
inherited

Test to see if this object is currently using a private store.

Definition at line 280 of file AuxElement.cxx.

281{
282 return havePrivateData() &&
283 typeid(*m_container) == typeid(AuxElementPrivateData);
284}

◆ usingStandaloneStore()

bool SG::AuxElement::usingStandaloneStore ( ) const
inherited

Test to see if this object is currently using a standalone store.

Test to see if this object is currently using a private store.

Definition at line 290 of file AuxElement.cxx.

291{
292 return havePrivateData() &&
293 typeid(*m_container) == typeid(AuxElementStandaloneData);
294}

◆ 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

◆ m_container

const SG::AuxVectorData* SG::ConstAuxElement::m_container
privateinherited

The container of which this object is an element.

Should be null if this object is not within a container, except that it may also point at a private store.

Definition at line 335 of file AuxElement.h.

◆ m_index

size_t SG::IAuxElement::m_index
privateinherited

The index of this element within its container.

Should be 0 if this object is not within a container.

Definition at line 128 of file IAuxElement.h.

◆ m_privateStoreState

PrivateStoreState SG::IAuxElement::m_privateStoreState
privateinherited

Definition at line 137 of file IAuxElement.h.

◆ 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.

◆ supportsThinning

bool SG::AuxElement::supportsThinning = true
staticconstexprinherited

Mark that this type supports thinning operations.

See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.

Definition at line 959 of file AuxElement.h.


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