ATLAS Offline Software
Loading...
Searching...
No Matches
PanTau::TauConstituent Class Reference

Input object for PanTau. More...

#include <TauConstituent.h>

Inheritance diagram for PanTau::TauConstituent:
Collaboration diagram for PanTau::TauConstituent:

Public Types

enum  Type {
  t_NoType = 0 , t_Charged = 1 , t_Neutral = 2 , t_Pi0Neut = 3 ,
  t_nTypes = 8
}
 Type enumeration to specify type of this tau constituent. More...

Public Member Functions

 TauConstituent ()
 Default Constructor for POOL.
 TauConstituent (const TLorentzVector &itsMomentum, int itsCharge, const std::vector< int > &itsType, double itsBDTValue, const xAOD::PFO *itsPFO)
virtual ~TauConstituent ()
 Destructor.
 TauConstituent (const TauConstituent &tauConst)
 Copy Constructor.
TauConstituentoperator= (const TauConstituent &tauConst)
 Assignment operator.
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 Member Functions

static double DefaultBDTValue ()
static double DefaultCharge ()
static std::string AllConstituentsName ()
static std::string getTypeName (PanTau::TauConstituent::Type aType)
static bool isNeutralType (int tauConstituentType)

xAOD::IParticle functions

These are already virtual due to IParticle

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
FourMom_t m_p4
 4-momentum object
std::vector< int > m_TypeFlags
double m_BDTValue
int m_Charge
const xAOD::PFOm_PFO
std::vector< TauConstituent * > m_Shots
int m_nPhotonsInShot
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 as a TLorentzVector.
virtual xAOD::Type::ObjectType type () const
 The type of the object as a simple enumeration, remains pure virtual in e/gamma.
void setP4 (float pt, float eta, float phi, float m)
 set the 4-vec
void setPt (float pt)
 set the Pt
void setEta (float eta)
 set the eta
void setPhi (float phi)
 set the phi
void setM (float m)
 set the Mass
void removeTypeFlag (TauConstituent::Type aType)
std::vector< std::string > getTypeName () const
std::string getTypeNameString () const
const std::vector< int > & getTypeFlags () const
bool isOfType (TauConstituent::Type aType) const
double getBDTValue () const
int getCharge () const
const xAOD::PFOgetPFO () const
void addShot (TauConstituent *shot)
const std::vector< TauConstituent * > & getShots () const
unsigned int getNShots () const
void setNPhotonsInShot (int nPhotons)
int getNPhotonsInShot () const

Detailed Description

Input object for PanTau.

Mainly a 4-vector with additional information about its type (charged, neutral, pi0 tagged)

Author
limba.nosp@m.ch@p.nosp@m.hysik.nosp@m..uni.nosp@m.-bonn.nosp@m..de

Definition at line 25 of file TauConstituent.h.

Member Typedef Documentation

◆ FourMom_t

typedef IParticle::FourMom_t PanTau::TauConstituent::FourMom_t

Definition of the 4-momentum type.

Definition at line 110 of file TauConstituent.h.

Member Enumeration Documentation

◆ Type

Type enumeration to specify type of this tau constituent.

t_NoType: This is used in default constructors when no type is specified t_Charged: Used to represent objects considered as 'charged' by input substructure reco t_Neutral: Use for objects considered neutral by input substructure algorithm t_Pi0Neut: If a particle passes pi0 ID, use this flag t_OutChrg: Charged objects in 0.2 to 0.4 t_OutNeut: Neutral objects in 0.2 to 0.4 t_NeutLowA: (Core) Neutrals with lower Et cut -> removed t_NeutLowB: (Core) Neutrals with even lower Et cut -> removed t_nTypes: Dont use this, just tell number of types

Enumerator
t_NoType 
t_Charged 
t_Neutral 
t_Pi0Neut 
t_nTypes 

Definition at line 42 of file TauConstituent.h.

42 {
43 t_NoType = 0,
44 t_Charged = 1,
45 t_Neutral = 2,
46 t_Pi0Neut = 3,
47 //t_OutChrg = 4,
48 //t_OutNeut = 5,
49 //t_NeutLowA = 6,
50 //t_NeutLowB = 7,
51 t_nTypes = 8
52 };

Constructor & Destructor Documentation

◆ TauConstituent() [1/3]

PanTau::TauConstituent::TauConstituent ( )

Default Constructor for POOL.

Do not use!

Definition at line 7 of file TauConstituent.cxx.

7 :
8 IParticle(),
9 m_p4(),
13 m_PFO(nullptr),
14 m_Shots(),
16{
17}
const xAOD::PFO * m_PFO
static double DefaultCharge()
std::vector< TauConstituent * > m_Shots
FourMom_t m_p4
4-momentum object
std::vector< int > m_TypeFlags
static double DefaultBDTValue()
IParticle()=default

◆ TauConstituent() [2/3]

PanTau::TauConstituent::TauConstituent ( const TLorentzVector & itsMomentum,
int itsCharge,
const std::vector< int > & itsType,
double itsBDTValue,
const xAOD::PFO * itsPFO )
Parameters
itsMomentumThe P4EEtaPhiM of this particle
itsTypeThe type of this particle using this class' enumeration
itsBDTValueIf a BDT was used ot ID this particle, provide the BDT response

Definition at line 20 of file TauConstituent.cxx.

24 :
25 IParticle(),
26 m_p4(itsMomentum),
27 m_TypeFlags(itsType),
28 m_BDTValue(itsBDTValue),
29 m_Charge(itsCharge),
30 m_PFO(itsPFO),
31 m_Shots(),
33{
34}

◆ ~TauConstituent()

PanTau::TauConstituent::~TauConstituent ( )
virtual

Destructor.

Definition at line 42 of file TauConstituent.cxx.

43{
44 //delete the shot constituents
45 for(unsigned int iShot=0; iShot<m_Shots.size(); iShot++) {
46 PanTau::TauConstituent* curConst = m_Shots[iShot];
47 delete curConst;
48 }
49}

◆ TauConstituent() [3/3]

PanTau::TauConstituent::TauConstituent ( const TauConstituent & tauConst)
default

Copy Constructor.

Member Function Documentation

◆ addShot()

void PanTau::TauConstituent::addShot ( TauConstituent * shot)

Definition at line 232 of file TauConstituent.cxx.

232 {
233 if(shot != nullptr) m_Shots.push_back(shot);
234}

◆ AllConstituentsName()

std::string PanTau::TauConstituent::AllConstituentsName ( )
inlinestatic

Definition at line 56 of file TauConstituent.h.

56{return "All";}

◆ 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

◆ DefaultBDTValue()

double PanTau::TauConstituent::DefaultBDTValue ( )
inlinestatic

Definition at line 54 of file TauConstituent.h.

54{return -4711.1337;}

◆ DefaultCharge()

double PanTau::TauConstituent::DefaultCharge ( )
inlinestatic

Definition at line 55 of file TauConstituent.h.

55{return -47111337;}

◆ e()

double PanTau::TauConstituent::e ( ) const
virtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 92 of file TauConstituent.cxx.

92 {
93 return p4().E();
94}
virtual FourMom_t p4() const
The full 4-momentum of the particle as a TLorentzVector.

◆ eta()

double PanTau::TauConstituent::eta ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 77 of file TauConstituent.cxx.

77 {
78 static const Accessor<float > acc( "eta" );
79 return acc( *this );
80}

◆ getBDTValue()

double PanTau::TauConstituent::getBDTValue ( ) const

Definition at line 203 of file TauConstituent.cxx.

203 {
204 return m_BDTValue;
205}

◆ getCharge()

int PanTau::TauConstituent::getCharge ( ) const

Definition at line 222 of file TauConstituent.cxx.

222 {
223 return m_Charge;
224}

◆ getNPhotonsInShot()

int PanTau::TauConstituent::getNPhotonsInShot ( ) const

Definition at line 252 of file TauConstituent.cxx.

252 {
253 return m_nPhotonsInShot;
254}

◆ getNShots()

unsigned int PanTau::TauConstituent::getNShots ( ) const

Definition at line 242 of file TauConstituent.cxx.

242 {
243 return m_Shots.size();
244}

◆ getPFO()

const xAOD::PFO * PanTau::TauConstituent::getPFO ( ) const

Definition at line 227 of file TauConstituent.cxx.

227 {
228 return m_PFO;
229}

◆ getShots()

const std::vector< PanTau::TauConstituent * > & PanTau::TauConstituent::getShots ( ) const

Definition at line 237 of file TauConstituent.cxx.

237 {
238 return m_Shots;
239}

◆ getTypeFlags()

const std::vector< int > & PanTau::TauConstituent::getTypeFlags ( ) const

Definition at line 208 of file TauConstituent.cxx.

208 {
209 return m_TypeFlags;
210}

◆ getTypeName() [1/2]

std::vector< std::string > PanTau::TauConstituent::getTypeName ( ) const

Definition at line 180 of file TauConstituent.cxx.

180 {
181 std::vector<std::string> res;
182 for(unsigned int iType=0; iType<TauConstituent::t_nTypes; iType++) {
183 if(m_TypeFlags[iType] == 1) {
185 res.push_back( TauConstituent::getTypeName(curType) );
186 }
187 }
188 return res;
189}
std::pair< std::vector< unsigned int >, bool > res
std::vector< std::string > getTypeName() const
Type
Type enumeration to specify type of this tau constituent.

◆ getTypeName() [2/2]

std::string PanTau::TauConstituent::getTypeName ( PanTau::TauConstituent::Type aType)
static

Definition at line 158 of file TauConstituent.cxx.

158 {
159 switch(aType) {
160 case PanTau::TauConstituent::t_Charged: return "Charged";
161 case PanTau::TauConstituent::t_Neutral: return "Neutral";
162 case PanTau::TauConstituent::t_Pi0Neut: return "Pi0Neut";
163 case PanTau::TauConstituent::t_NoType: return "All";
164 default: return "UnkownType";
165 }
166}

◆ getTypeNameString()

std::string PanTau::TauConstituent::getTypeNameString ( ) const

Definition at line 192 of file TauConstituent.cxx.

192 {
193 std::string res;
194 for(unsigned int iType=0; iType<m_TypeFlags.size(); iType++) {
195 if(m_TypeFlags[iType] == 1) {
197 }
198 }
199 return res;
200}

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

◆ isNeutralType()

bool PanTau::TauConstituent::isNeutralType ( int tauConstituentType)
static

Definition at line 169 of file TauConstituent.cxx.

169 {
171 switch(type) {
172 case PanTau::TauConstituent::t_Neutral: return true;
173 case PanTau::TauConstituent::t_Pi0Neut: return true;
174 default: return false;
175 }
176 return false;
177}
virtual xAOD::Type::ObjectType type() const
The type of the object as a simple enumeration, remains pure virtual in e/gamma.

◆ isOfType()

bool PanTau::TauConstituent::isOfType ( TauConstituent::Type aType) const

Definition at line 213 of file TauConstituent.cxx.

213 {
214 if(theType >= static_cast<int>(TauConstituent::t_nTypes)) {
215 return false;
216 }
217 if(m_TypeFlags.at( static_cast<int>(theType)) == 1) return true;
218 return false;
219}

◆ m()

double PanTau::TauConstituent::m ( ) const
virtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 87 of file TauConstituent.cxx.

87 {
88 static const Accessor< float> acc( "m" );
89 return acc( *this );
90}

◆ operator=()

PanTau::TauConstituent & PanTau::TauConstituent::operator= ( const TauConstituent & tauConst)

Assignment operator.

Definition at line 52 of file TauConstituent.cxx.

53{
54 if (this!=&tauConst){
55
56 if (!this->container() && !this->hasStore() ) {
58 }
59 this->IParticle::operator=( tauConst );
60 this->m_p4 = tauConst.m_p4;
61 m_TypeFlags = tauConst.m_TypeFlags;
62 m_BDTValue = tauConst.m_BDTValue;
63 m_Charge = tauConst.m_Charge;
64 m_PFO = tauConst.m_PFO;
65 m_Shots = tauConst.m_Shots;
66 m_nPhotonsInShot = tauConst.m_nPhotonsInShot;
67 }
68 return *this;
69}
void makePrivateStore()
Create a new (empty) private store for this object.
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.

◆ p4()

PanTau::TauConstituent::FourMom_t PanTau::TauConstituent::p4 ( ) const
virtual

The full 4-momentum of the particle as a TLorentzVector.

Implements xAOD::IParticle.

Definition at line 100 of file TauConstituent.cxx.

100 {
101 return m_p4;
102}

◆ phi()

double PanTau::TauConstituent::phi ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 82 of file TauConstituent.cxx.

82 {
83 static const Accessor< float > acc( "phi" );
84 return acc( *this );
85}

◆ pt()

double PanTau::TauConstituent::pt ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 72 of file TauConstituent.cxx.

72 {
73 static const Accessor< float > acc( "pt" );
74 return acc( *this );
75}

◆ rapidity()

double PanTau::TauConstituent::rapidity ( ) const
virtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 96 of file TauConstituent.cxx.

96 {
97 return p4().Rapidity();
98}

◆ removeTypeFlag()

void PanTau::TauConstituent::removeTypeFlag ( TauConstituent::Type aType)

Definition at line 151 of file TauConstituent.cxx.

151 {
152 unsigned int typeIndex = (unsigned int)aType;
153 m_TypeFlags.at(typeIndex) = 0;
154}

◆ setEta()

void PanTau::TauConstituent::setEta ( float eta)

set the eta

Definition at line 124 of file TauConstituent.cxx.

124 {
125 static const Accessor< float > acc( "eta" );
126 acc( *this ) = eta;
127 //Need to recalculate m_p4
128 m_p4.SetPtEtaPhiM( pt(), eta, phi(), m());
129}
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double m() const
The invariant mass of the particle.

◆ setM()

void PanTau::TauConstituent::setM ( float m)

set the Mass

Definition at line 138 of file TauConstituent.cxx.

138 {
139 static const Accessor< float > acc( "m" );
140 acc( *this ) = m;
141 //Need to recalculate m_p4
142 m_p4.SetPtEtaPhiM( pt(), eta(), phi(), m);
143}

◆ setNPhotonsInShot()

void PanTau::TauConstituent::setNPhotonsInShot ( int nPhotons)

Definition at line 247 of file TauConstituent.cxx.

247 {
248 m_nPhotonsInShot = nPhotons;
249}

◆ setP4()

void PanTau::TauConstituent::setP4 ( float pt,
float eta,
float phi,
float m )

set the 4-vec

Definition at line 104 of file TauConstituent.cxx.

104 {
105 static const Accessor< float > acc1( "pt" );
106 acc1( *this ) = pt;
107 static const Accessor< float > acc2( "eta" );
108 acc2( *this ) = eta;
109 static const Accessor< float > acc3( "phi" );
110 acc3( *this ) = phi;
111 static const Accessor< float > acc4( "m" );
112 acc4( *this ) = m;
113 //Need to recalculate m_p4
114 m_p4.SetPtEtaPhiM( pt, eta, phi, m);
115}

◆ setPhi()

void PanTau::TauConstituent::setPhi ( float phi)

set the phi

Definition at line 131 of file TauConstituent.cxx.

131 {
132 static const Accessor< float > acc( "phi" );
133 acc( *this ) = phi;
134 //Need to recalculate m_p4
135 m_p4.SetPtEtaPhiM( pt(), eta(), phi, m());
136}

◆ setPt()

void PanTau::TauConstituent::setPt ( float pt)

set the Pt

Definition at line 117 of file TauConstituent.cxx.

117 {
118 static const Accessor< float > acc( "pt" );
119 acc( *this ) = pt;
120 //Need to recalculate m_p4
121 m_p4.SetPtEtaPhiM( pt, eta(), phi(), m());
122}

◆ type()

xAOD::Type::ObjectType PanTau::TauConstituent::type ( ) const
virtual

The type of the object as a simple enumeration, remains pure virtual in e/gamma.

Implements xAOD::IParticle.

Definition at line 146 of file TauConstituent.cxx.

146 {
148}
@ ParticleFlow
The object is a particle-flow object.
Definition ObjectType.h:41

Member Data Documentation

◆ m_BDTValue

double PanTau::TauConstituent::m_BDTValue
protected

Definition at line 163 of file TauConstituent.h.

◆ m_Charge

int PanTau::TauConstituent::m_Charge
protected

Definition at line 164 of file TauConstituent.h.

◆ m_nPhotonsInShot

int PanTau::TauConstituent::m_nPhotonsInShot
protected

Definition at line 170 of file TauConstituent.h.

◆ m_p4

FourMom_t PanTau::TauConstituent::m_p4
private

4-momentum object

Definition at line 157 of file TauConstituent.h.

◆ m_PFO

const xAOD::PFO* PanTau::TauConstituent::m_PFO
protected

Definition at line 166 of file TauConstituent.h.

◆ m_Shots

std::vector<TauConstituent*> PanTau::TauConstituent::m_Shots
protected

Definition at line 169 of file TauConstituent.h.

◆ m_TypeFlags

std::vector<int> PanTau::TauConstituent::m_TypeFlags
protected

Definition at line 162 of file TauConstituent.h.


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