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

A detector object made of other lower level object(s). More...

#include <FlowElement_v1.h>

Inheritance diagram for xAOD::FlowElement_v1:
Collaboration diagram for xAOD::FlowElement_v1:

Public Types

enum  SignalType {
  Neutral = 0x1000 , Charged = 0x2000 , Combined = 0x4000 , CaloCluster = Neutral | 0x0100 ,
  Track = Charged | 0x0200 , Muon = Charged | 0x0400 , PFlow = 0x0010 , NeutralPFlow = Neutral | PFlow ,
  ChargedPFlow = Charged | PFlow , TCC = 0x0020 , NeutralTCC = Neutral | TCC , ChargedTCC = Charged | TCC ,
  UFO = 0x0001 , NeutralUFO = Neutral | UFO , ChargedUFO = Charged | UFO , Unknown = 0x0000
}
 Enum to encode the nature of the object this FlowElement represents. More...
enum  MatchedPVType { Undefined = 0x00 , HardScatter = 0x10 , Pileup = 0x20 , PileupSideBand = 0x21 }
 Enum to encode high-level information on the vertex associated to this FlowElement. More...
typedef unsigned long signal_t
typedef short vertex_t
typedef TLorentzVector FourMom_t
 Definition of the 4-momentum type.

Public Member Functions

 IParticle ()=default
 IParticle (const IParticle &)=default
 IParticle (IParticle &&)=delete
virtual double pt () const override
virtual double eta () const override
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const override
 The azimuthal angle ( \(\phi\)) of the particle.
virtual double m () const override
 The invariant mass of the particle.
virtual double e () const override
 The total energy of the particle.
virtual double rapidity () const override
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const override
 The full 4-momentum of the particle.
virtual Type::ObjectType type () const override
 The type of the object as a simple enumeration.
void setP4 (float pt, float eta, float phi, float m)
void setP4 (const FourMom_t &p4)
signal_t signalType () const
void setSignalType (signal_t t)
bool isMatchedToPV (MatchedPVType vxtype=HardScatter) const
vertex_t vertexType () const
void setVertexType (vertex_t t)
bool isCharged () const
float charge () const
void setCharge (float c)
std::vector< const xAOD::IParticle * > chargedObjects () const
std::vector< std::pair< const xAOD::IParticle *, float > > chargedObjectsAndWeights () const
std::size_t nChargedObjects () const
const xAOD::IParticlechargedObject (std::size_t i) const
std::pair< const xAOD::IParticle *, floatchargedObjectAndWeight (std::size_t i) const
const std::vector< ElementLink< IParticleContainer > > & chargedObjectLinks () const
 Access to the EL.
const std::vector< float > & chargedObjectWeights () const
void setChargedObjectLinks (const std::vector< ElementLink< IParticleContainer > > &elV)
void setChargedObjectLinks (const std::vector< ElementLink< IParticleContainer > > &elV, const std::vector< float > &wV)
std::vector< const xAOD::IParticle * > otherObjects () const
std::vector< std::pair< const xAOD::IParticle *, float > > otherObjectsAndWeights () const
std::size_t nOtherObjects () const
const xAOD::IParticleotherObject (std::size_t i) const
std::pair< const xAOD::IParticle *, floatotherObjectAndWeight (std::size_t i) const
const std::vector< ElementLink< IParticleContainer > > & otherObjectLinks () const
const std::vector< float > & otherObjectWeights () const
void setOtherObjectLinks (const std::vector< ElementLink< IParticleContainer > > &elV)
void setOtherObjectLinks (const std::vector< ElementLink< IParticleContainer > > &elV, const std::vector< float > &wV)
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.

Detailed Description

A detector object made of other lower level object(s).

This class is intended to describe reconstruction objects coumpound of lower level detector objects. Typically it provides links to tracks and calo clusters such as is needed for particle flow objects.

The class is kept minimal and very generic so it can cover many use cases, including a generic type to describe jet constituents.

Definition at line 25 of file FlowElement_v1.h.

Member Typedef Documentation

◆ FourMom_t

typedef TLorentzVector xAOD::IParticle::FourMom_t

Definition of the 4-momentum type.

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

◆ signal_t

Definition at line 30 of file FlowElement_v1.h.

◆ vertex_t

Definition at line 31 of file FlowElement_v1.h.

Member Enumeration Documentation

◆ MatchedPVType

Enum to encode high-level information on the vertex associated to this FlowElement.

Enumerator
Undefined 
HardScatter 
Pileup 
PileupSideBand 

Definition at line 62 of file FlowElement_v1.h.

◆ SignalType

Enum to encode the nature of the object this FlowElement represents.

Enumerator
Neutral 
Charged 
Combined 
CaloCluster 
Track 
Muon 
PFlow 
NeutralPFlow 
ChargedPFlow 
TCC 
NeutralTCC 
ChargedTCC 
UFO 
NeutralUFO 
ChargedUFO 
Unknown 

Definition at line 35 of file FlowElement_v1.h.

35 {
36 // global characteristics
37 Neutral = 0x1000,
38 Charged = 0x2000,
39 Combined = 0x4000, //needed??
40
41 // detector level signals and flow objects
42 CaloCluster = Neutral | 0x0100,
43 Track = Charged | 0x0200,
44 Muon = Charged | 0x0400,
45 PFlow = 0x0010,
48
49 // higher level flow objects
50 TCC = 0x0020,
53 UFO = 0x0001,
56
57 // unknown
58 Unknown = 0x0000
59 };

Member Function Documentation

◆ 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

◆ charge()

float xAOD::FlowElement_v1::charge ( ) const

◆ chargedObject()

const xAOD::IParticle * xAOD::FlowElement_v1::chargedObject ( std::size_t i) const

Definition at line 127 of file FlowElement_v1.cxx.

127 {
128 const auto & elV = chargedObjectLinks();
129 // should we check if i >= size() and throw ourselves ? or trust the user ?
130 return elV[i].isValid()? *(elV[i]) : nullptr ;
131 }
const std::vector< ElementLink< IParticleContainer > > & chargedObjectLinks() const
Access to the EL.

◆ chargedObjectAndWeight()

std::pair< const xAOD::IParticle *, float > xAOD::FlowElement_v1::chargedObjectAndWeight ( std::size_t i) const

Definition at line 133 of file FlowElement_v1.cxx.

133 {
134 const auto & elV = chargedObjectLinks();
135 const std::vector<float> & wV = chargedObjectWeights();
136
137 if( elV[i].isValid() ) return { *(elV[i]), wV[i] } ;
138 else return {nullptr, wV[i] } ;
139 }
const std::vector< float > & chargedObjectWeights() const

◆ chargedObjectLinks()

const std::vector< ElementLink< IParticleContainer > > & xAOD::FlowElement_v1::chargedObjectLinks ( ) const

Access to the EL.

◆ chargedObjects()

std::vector< const xAOD::IParticle * > xAOD::FlowElement_v1::chargedObjects ( ) const

Access directly the charged underlying IParticle (typically : TrackParticle) nullptr are returned if the ElementLink to the IParticle are invalid (ex: after thinning)

Definition at line 94 of file FlowElement_v1.cxx.

94 {
95 const auto & elV = chargedObjectLinks();
96 std::vector<const xAOD::IParticle*> result;
97 result.reserve( elV.size() );
98 for(const auto& el: elV ){
99 result.push_back( el.isValid() ? *el : nullptr ) ;
100 }
101 return result;
102 }

◆ chargedObjectsAndWeights()

std::vector< std::pair< const xAOD::IParticle *, float > > xAOD::FlowElement_v1::chargedObjectsAndWeights ( ) const

Definition at line 104 of file FlowElement_v1.cxx.

104 {
105
106 const auto & elV = chargedObjectLinks();
107 const std::vector<float> & wV = chargedObjectWeights();
108 std::vector< std::pair<const xAOD::IParticle*,float> > result;
109 result.reserve( elV.size() );
110 if(wV.empty()) {
111 for(const auto& el: elV ){
112 result.emplace_back( el.isValid() ? *el : nullptr , 1. ) ;
113 }
114 } else {
115 for(size_t i=0;i<elV.size();i++){
116 const xAOD::IParticle* p = elV[i].isValid() ? *(elV[i]) : nullptr;
117 result.emplace_back(p , wV[i] );
118 }
119 }
120 return result;
121 }

◆ chargedObjectWeights()

const std::vector< float > & xAOD::FlowElement_v1::chargedObjectWeights ( ) const

◆ e()

double xAOD::FlowElement_v1::e ( ) const
overridevirtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 25 of file FlowElement_v1.cxx.

25 {
26 return PtEtaPhiMVector(pt(), eta(), phi(), m() ).E();
27 }
virtual double pt() const override
virtual double m() const override
The invariant mass of the particle.
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.

◆ eta()

virtual double xAOD::FlowElement_v1::eta ( ) const
overridevirtual

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

Implements xAOD::IParticle.

◆ IParticle() [1/3]

◆ IParticle() [2/3]

◆ IParticle() [3/3]

◆ 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::FlowElement_v1::isCharged ( ) const

Access charge

Definition at line 56 of file FlowElement_v1.cxx.

56{ return !bool( signalType()& Neutral );}
signal_t signalType() const
setBGCode setTAP setLVL2ErrorBits bool

◆ isMatchedToPV()

bool xAOD::FlowElement_v1::isMatchedToPV ( MatchedPVType vxtype = HardScatter) const

Acess vertex types

Definition at line 63 of file FlowElement_v1.cxx.

63 {
64 return (vertexType()==vxtype);
65 }
vertex_t vertexType() const

◆ m()

virtual double xAOD::FlowElement_v1::m ( ) const
overridevirtual

The invariant mass of the particle.

Implements xAOD::IParticle.

◆ nChargedObjects()

std::size_t xAOD::FlowElement_v1::nChargedObjects ( ) const

Definition at line 123 of file FlowElement_v1.cxx.

123 {
124 return chargedObjectLinks().size();
125 }

◆ nOtherObjects()

std::size_t xAOD::FlowElement_v1::nOtherObjects ( ) const

Definition at line 192 of file FlowElement_v1.cxx.

192 {
193 return otherObjectLinks().size();
194 }
const std::vector< ElementLink< IParticleContainer > > & otherObjectLinks() const

◆ otherObject()

const xAOD::IParticle * xAOD::FlowElement_v1::otherObject ( std::size_t i) const

Definition at line 196 of file FlowElement_v1.cxx.

196 {
197 const auto & elV = otherObjectLinks();
198 // should we check if i >= size() and throw ourselves ? or trust the user ?
199 return elV[i].isValid()? *(elV[i]) : nullptr ;
200 }

◆ otherObjectAndWeight()

std::pair< const xAOD::IParticle *, float > xAOD::FlowElement_v1::otherObjectAndWeight ( std::size_t i) const

Definition at line 202 of file FlowElement_v1.cxx.

202 {
203 const auto & elV = otherObjectLinks();
204 const std::vector<float> & wV = otherObjectWeights();
205
206 if( elV[i].isValid() ) return { *(elV[i]), wV[i] };
207 else return {nullptr, wV[i] } ;
208 }
const std::vector< float > & otherObjectWeights() const

◆ otherObjectLinks()

const std::vector< ElementLink< IParticleContainer > > & xAOD::FlowElement_v1::otherObjectLinks ( ) const

Access to the EL

◆ otherObjects()

std::vector< const xAOD::IParticle * > xAOD::FlowElement_v1::otherObjects ( ) const

Access directly the 'other' underlying IParticle (typically neutral CaloCluster) nullptr are returned if the ElementLink to the IParticle are invalid (ex: after thinning)

Definition at line 163 of file FlowElement_v1.cxx.

163 {
164 const auto & elV = otherObjectLinks();
165 std::vector<const xAOD::IParticle*> result;
166 result.reserve( elV.size() );
167 for(const auto& el: elV ){
168 result.push_back( el.isValid() ? *el : nullptr ) ;
169 }
170 return result;
171 }

◆ otherObjectsAndWeights()

std::vector< std::pair< const xAOD::IParticle *, float > > xAOD::FlowElement_v1::otherObjectsAndWeights ( ) const

Definition at line 173 of file FlowElement_v1.cxx.

173 {
174
175 const auto & elV = otherObjectLinks();
176 const std::vector<float> & wV = otherObjectWeights();
177 std::vector< std::pair<const xAOD::IParticle*,float> > result;
178 result.reserve( elV.size() );
179 if(wV.empty()) {
180 for(const auto& el: elV ){
181 result.emplace_back( el.isValid() ? *el : nullptr , 1. ) ;
182 }
183 } else {
184 for(size_t i=0;i<elV.size();i++){
185 const xAOD::IParticle* p = elV[i].isValid() ? *(elV[i]) : nullptr;
186 result.emplace_back(p , wV[i] );
187 }
188 }
189 return result;
190 }

◆ otherObjectWeights()

const std::vector< float > & xAOD::FlowElement_v1::otherObjectWeights ( ) const

◆ p4()

FlowElement_v1::FourMom_t xAOD::FlowElement_v1::p4 ( ) const
overridevirtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 33 of file FlowElement_v1.cxx.

33 {
35 p4.SetPtEtaPhiE( pt(), eta(), phi(), e() );
36 return p4;
37 }
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual double e() const override
The total energy of the particle.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.

◆ phi()

virtual double xAOD::FlowElement_v1::phi ( ) const
overridevirtual

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

Implements xAOD::IParticle.

◆ pt()

virtual double xAOD::FlowElement_v1::pt ( ) const
overridevirtual

kinematics (IParticle interface)

Implements xAOD::IParticle.

◆ rapidity()

double xAOD::FlowElement_v1::rapidity ( ) const
overridevirtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 29 of file FlowElement_v1.cxx.

29 {
30 return PtEtaPhiMVector(pt(), eta(), phi(), m() ).Rapidity();
31 }

◆ setCharge()

void xAOD::FlowElement_v1::setCharge ( float c)

◆ setChargedObjectLinks() [1/2]

void xAOD::FlowElement_v1::setChargedObjectLinks ( const std::vector< ElementLink< IParticleContainer > > & elV)

◆ setChargedObjectLinks() [2/2]

void xAOD::FlowElement_v1::setChargedObjectLinks ( const std::vector< ElementLink< IParticleContainer > > & elV,
const std::vector< float > & wV )

◆ setOtherObjectLinks() [1/2]

void xAOD::FlowElement_v1::setOtherObjectLinks ( const std::vector< ElementLink< IParticleContainer > > & elV)

◆ setOtherObjectLinks() [2/2]

void xAOD::FlowElement_v1::setOtherObjectLinks ( const std::vector< ElementLink< IParticleContainer > > & elV,
const std::vector< float > & wV )

◆ setP4() [1/2]

void xAOD::FlowElement_v1::setP4 ( const FourMom_t & p4)

Definition at line 51 of file FlowElement_v1.cxx.

51 {
52 setP4(p4.Pt(), p4.Eta(), p4.Phi(), p4.M());
53 }
void setP4(float pt, float eta, float phi, float m)

◆ setP4() [2/2]

void xAOD::FlowElement_v1::setP4 ( float pt,
float eta,
float phi,
float m )

Definition at line 39 of file FlowElement_v1.cxx.

39 {
40 static const Accessor< float > acc1( "pt" );
41 acc1( *this ) = pt;
42 static const Accessor< float > acc2( "eta" );
43 acc2( *this ) = eta;
44 static const Accessor< float > acc3( "phi" );
45 acc3( *this ) = phi;
46 static const Accessor< float > acc4( "m" );
47 acc4( *this ) = m;
48
49 }

◆ setSignalType()

void xAOD::FlowElement_v1::setSignalType ( signal_t t)

◆ setVertexType()

void xAOD::FlowElement_v1::setVertexType ( vertex_t t)

◆ signalType()

signal_t xAOD::FlowElement_v1::signalType ( ) const

Access signal type

◆ type()

Type::ObjectType xAOD::FlowElement_v1::type ( ) const
overridevirtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 68 of file FlowElement_v1.cxx.

68 {
69 return Type::FlowElement;
70 }

◆ vertexType()

vertex_t xAOD::FlowElement_v1::vertexType ( ) const

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