ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
TruthEtIsolations Class Reference

#include <TruthEtIsolations.h>

Collaboration diagram for TruthEtIsolations:

Public Types

typedef ElementLink< McEventCollectionGenEventLink_t
 A (persistent) link to a HepMC::GenEvent. More...
 
typedef McAod::EtIsolations EtIsol_t
 An array of doubles of fixed size to modelize the Et isolations for different values of isolation radii' cones. More...
 
typedef std::unordered_map< int, EtIsol_tEtIsolMap_t
 The map of barcode-to-Et isolations. More...
 
typedef EtIsolMap_t::const_iterator const_iterator
 The iterator over the map of barcode-to-Et-isolations. More...
 

Public Member Functions

 TruthEtIsolations ()
 Default constructor. More...
 
 TruthEtIsolations (const TruthEtIsolations &rhs)
 Copy constructor. More...
 
 TruthEtIsolations (const GenEventLink_t &genEvtLink)
 Constructor with parameters: construct a TruthEtIsolations container from an ElementLink to a HepMC::GenEvent (hold by a McEventCollection) Note that no Et isolations are computed at that time. More...
 
 TruthEtIsolations (const std::string &genEvtName, const std::size_t genEvtIdx)
 Constructor with parameters: construct a TruthEtIsolations container from a StoreGate key to a McEventCollection and an index std::size_t to a HepMC::GenEvent. More...
 
TruthEtIsolationsoperator= (const TruthEtIsolations &rhs)
 Assignment operator. More...
 
 ~TruthEtIsolations ()
 Default destructor: More...
 
const std::string & genEventName () const
 Return the name (ie: the StoreGate key) of the McEventCollection holding the HepMC::GenEvent from which the Et isolations have been computed. More...
 
std::size_t genEventIdx () const
 Return the index in the McEventCollection container holding the HepMC::GenEvent from which the Et isolations have been computed. More...
 
std::size_t size () const
 Return the number of HepMC::GenParticle for which Et isolations have been stored into this TruthEtIsolations container. More...
 
bool hasEtIsol (const HepMC::ConstGenParticlePtr &genParticle) const
 Return true if this TruthEtIsolations container holds Et isolations for that HepMC::GenParticle. More...
 
bool hasEtIsol (const int genParticleBarcode) const
 Return true if this TruthEtIsolations container holds Et isolations for that HepMC::GenParticle. More...
 
const EtIsol_tetIsolations (const HepMC::ConstGenParticlePtr &genParticle) const
 Return the transverse energies for all cone sizes of isolation, for a given HepMC::GenParticle's barcode. More...
 
const EtIsol_tetIsolations (const int genParticleBarcode) const
 Return the transverse energies for all cone sizes of isolation, for a given HepMC::GenParticle's barcode. More...
 
double etIsol (const HepMC::ConstGenParticlePtr &genParticle, const TruthParticleParameters::ConeSize coneIdx) const
 Return the transverse energy in a given cone size of isolation, for a given HepMC::GenParticle. More...
 
double etIsol (const int genParticleBarcode, const TruthParticleParameters::ConeSize coneIdx) const
 Return the transverse energy in a given cone size of isolation, for a given HepMC::GenParticle's barcode Note that the size of the code must be one of the encoded sizes (see TruthEtIsolationsParamDefs.h file) and that the index is checked for out of bounds. More...
 
const_iterator begin () const
 Const iterator over the barcodes of the HepMC::GenParticle for which we have Et isolations computed. More...
 
const_iterator end () const
 Const iterator over the barcodes of the HepMC::GenParticle for which we have Et isolations computed. More...
 
void setEtIsol (const HepMC::ConstGenParticlePtr &genParticle, const TruthParticleParameters::ConeSize coneIdx, const double etIsol)
 Set the transverse energy isolation of a HepMC::GenParticle for a given Cone size. More...
 
void setEtIsol (const HepMC::ConstGenParticlePtr &genParticle, const std::vector< double > &etIsols)
 Set the transverse energy isolations for all the Cone sizes. More...
 
void setEtIsol (const HepMC::ConstGenParticlePtr &genParticle, const EtIsol_t &etIsols)
 Set the transverse energy isolations for all the Cone sizes. More...
 

Protected Attributes

GenEventLink_t m_genEvtLink
 ElementLink to the HepMC::GenEvent from which the Et isolations have been (or will be) computed More...
 
EtIsolMap_t m_etIsolations
 Holds transverse energy isolations for different isolation cones The key of this map is the barcode of the HepMC::GenParticle for which the Et isolations have been computed. More...
 

Static Protected Attributes

static const EtIsol_t m_dfltEtIsols
 The default Et isolation energy which is being returned when I don't know what to return. More...
 

Friends

class TruthEtIsolationsCnv_p1
 

Detailed Description

container which holds isolation informations for a given HepMC::GenParticle (labelled by barcode) for a given HepMC::GenEvent of a given McEventCollection

Definition at line 39 of file TruthEtIsolations.h.

Member Typedef Documentation

◆ const_iterator

typedef EtIsolMap_t::const_iterator TruthEtIsolations::const_iterator

The iterator over the map of barcode-to-Et-isolations.

Definition at line 58 of file TruthEtIsolations.h.

◆ EtIsol_t

An array of doubles of fixed size to modelize the Et isolations for different values of isolation radii' cones.

Definition at line 52 of file TruthEtIsolations.h.

◆ EtIsolMap_t

typedef std::unordered_map<int,EtIsol_t> TruthEtIsolations::EtIsolMap_t

The map of barcode-to-Et isolations.

Definition at line 55 of file TruthEtIsolations.h.

◆ GenEventLink_t

A (persistent) link to a HepMC::GenEvent.

Definition at line 48 of file TruthEtIsolations.h.

Constructor & Destructor Documentation

◆ TruthEtIsolations() [1/4]

TruthEtIsolations::TruthEtIsolations ( )

Default constructor.

Definition at line 45 of file TruthEtIsolations.cxx.

45  :
46  m_genEvtLink ( ),
47  m_etIsolations ( )
48 {}

◆ TruthEtIsolations() [2/4]

TruthEtIsolations::TruthEtIsolations ( const TruthEtIsolations rhs)

Copy constructor.

Definition at line 50 of file TruthEtIsolations.cxx.

50  :
51  m_genEvtLink ( rhs.m_genEvtLink ),
53 {}

◆ TruthEtIsolations() [3/4]

TruthEtIsolations::TruthEtIsolations ( const GenEventLink_t genEvtLink)

Constructor with parameters: construct a TruthEtIsolations container from an ElementLink to a HepMC::GenEvent (hold by a McEventCollection) Note that no Et isolations are computed at that time.

Definition at line 56 of file TruthEtIsolations.cxx.

56  :
57  m_genEvtLink ( genEvtLink ),
58  m_etIsolations ( )
59 {}

◆ TruthEtIsolations() [4/4]

TruthEtIsolations::TruthEtIsolations ( const std::string &  genEvtName,
const std::size_t  genEvtIdx 
)

Constructor with parameters: construct a TruthEtIsolations container from a StoreGate key to a McEventCollection and an index std::size_t to a HepMC::GenEvent.

Note that no Et isolations are computed at that time.

Definition at line 61 of file TruthEtIsolations.cxx.

62  :
63  m_genEvtLink ( genEvtName, genEvtIdx ),
65 {}

◆ ~TruthEtIsolations()

TruthEtIsolations::~TruthEtIsolations ( )

Default destructor:

Definition at line 80 of file TruthEtIsolations.cxx.

81 {}

Member Function Documentation

◆ begin()

TruthEtIsolations::const_iterator TruthEtIsolations::begin ( ) const
inline

Const iterator over the barcodes of the HepMC::GenParticle for which we have Et isolations computed.

Definition at line 249 of file TruthEtIsolations.h.

250 { return m_etIsolations.begin(); }

◆ end()

TruthEtIsolations::const_iterator TruthEtIsolations::end ( ) const
inline

Const iterator over the barcodes of the HepMC::GenParticle for which we have Et isolations computed.

Definition at line 252 of file TruthEtIsolations.h.

253 { return m_etIsolations.end(); }

◆ etIsol() [1/2]

double TruthEtIsolations::etIsol ( const HepMC::ConstGenParticlePtr genParticle,
const TruthParticleParameters::ConeSize  coneIdx 
) const

Return the transverse energy in a given cone size of isolation, for a given HepMC::GenParticle.

Note that the size of the code must be one of the encoded sizes (see TruthEtIsolationsParamDefs.h file) and that the index is checked for out of bounds.

Definition at line 114 of file TruthEtIsolations.cxx.

116 {
117  return ( 0 == p )
118  ? m_dfltEtIsols[idx]
119  : etIsol( HepMC::barcode(p), idx );
120 }

◆ etIsol() [2/2]

double TruthEtIsolations::etIsol ( const int  genParticleBarcode,
const TruthParticleParameters::ConeSize  coneIdx 
) const
inline

Return the transverse energy in a given cone size of isolation, for a given HepMC::GenParticle's barcode Note that the size of the code must be one of the encoded sizes (see TruthEtIsolationsParamDefs.h file) and that the index is checked for out of bounds.

Definition at line 243 of file TruthEtIsolations.h.

245 {
246  return (*etIsolations(bc))[idx];
247 }

◆ etIsolations() [1/2]

const TruthEtIsolations::EtIsol_t * TruthEtIsolations::etIsolations ( const HepMC::ConstGenParticlePtr genParticle) const

Return the transverse energies for all cone sizes of isolation, for a given HepMC::GenParticle's barcode.

Definition at line 106 of file TruthEtIsolations.cxx.

107 {
108  return ( 0 == p )
109  ? 0
111 }

◆ etIsolations() [2/2]

const TruthEtIsolations::EtIsol_t * TruthEtIsolations::etIsolations ( const int  genParticleBarcode) const
inline

Return the transverse energies for all cone sizes of isolation, for a given HepMC::GenParticle's barcode.

Definition at line 233 of file TruthEtIsolations.h.

234 {
235  const EtIsolMap_t::const_iterator i = m_etIsolations.find( bc );
236  return ( m_etIsolations.end() == i )
237  ? 0
238  : &i->second;
239 }

◆ genEventIdx()

std::size_t TruthEtIsolations::genEventIdx ( ) const

Return the index in the McEventCollection container holding the HepMC::GenEvent from which the Et isolations have been computed.

Definition at line 92 of file TruthEtIsolations.cxx.

93 {
94  return m_genEvtLink.index();
95 }

◆ genEventName()

const std::string & TruthEtIsolations::genEventName ( ) const

Return the name (ie: the StoreGate key) of the McEventCollection holding the HepMC::GenEvent from which the Et isolations have been computed.

Definition at line 87 of file TruthEtIsolations.cxx.

88 {
89  return m_genEvtLink.dataID();
90 }

◆ hasEtIsol() [1/2]

bool TruthEtIsolations::hasEtIsol ( const HepMC::ConstGenParticlePtr genParticle) const

Return true if this TruthEtIsolations container holds Et isolations for that HepMC::GenParticle.

Definition at line 98 of file TruthEtIsolations.cxx.

99 {
100  return ( 0 == p )
101  ? false
102  : hasEtIsol( HepMC::barcode(p) );
103 }

◆ hasEtIsol() [2/2]

bool TruthEtIsolations::hasEtIsol ( const int  genParticleBarcode) const
inline

Return true if this TruthEtIsolations container holds Et isolations for that HepMC::GenParticle.

Definition at line 227 of file TruthEtIsolations.h.

228 {
229  return m_etIsolations.end() != m_etIsolations.find( bc );
230 }

◆ operator=()

TruthEtIsolations & TruthEtIsolations::operator= ( const TruthEtIsolations rhs)

Assignment operator.

Definition at line 68 of file TruthEtIsolations.cxx.

69 {
70  if ( this != &rhs ) {
73  }
74  return *this;
75 }

◆ setEtIsol() [1/3]

void TruthEtIsolations::setEtIsol ( const HepMC::ConstGenParticlePtr genParticle,
const EtIsol_t etIsols 
)

Set the transverse energy isolations for all the Cone sizes.

Definition at line 147 of file TruthEtIsolations.cxx.

149 {
150  m_etIsolations[HepMC::barcode(genParticle)] = etIsols;
151 }

◆ setEtIsol() [2/3]

void TruthEtIsolations::setEtIsol ( const HepMC::ConstGenParticlePtr genParticle,
const std::vector< double > &  etIsols 
)

Set the transverse energy isolations for all the Cone sizes.

Definition at line 135 of file TruthEtIsolations.cxx.

137 {
138  EtIsol_t& et = m_etIsolations[HepMC::barcode(genParticle)];
139  for ( std::size_t i = 0, iMax = std::min<std::size_t>( etIsols.size(), TruthParticleParameters::NbrOfCones ); i != iMax;++i ) {
140  et[i] = etIsols[i];
141  }
142 
143  return;
144 }

◆ setEtIsol() [3/3]

void TruthEtIsolations::setEtIsol ( const HepMC::ConstGenParticlePtr genParticle,
const TruthParticleParameters::ConeSize  coneIdx,
const double  etIsol 
)

Set the transverse energy isolation of a HepMC::GenParticle for a given Cone size.

Definition at line 127 of file TruthEtIsolations.cxx.

130 {
131  m_etIsolations[HepMC::barcode(genParticle)][coneIdx] = etIsol;
132 }

◆ size()

std::size_t TruthEtIsolations::size ( ) const
inline

Return the number of HepMC::GenParticle for which Et isolations have been stored into this TruthEtIsolations container.

Definition at line 223 of file TruthEtIsolations.h.

224 { return m_etIsolations.size(); }

Friends And Related Function Documentation

◆ TruthEtIsolationsCnv_p1

friend class TruthEtIsolationsCnv_p1
friend

Definition at line 196 of file TruthEtIsolations.h.

Member Data Documentation

◆ m_dfltEtIsols

const EtIsol_t TruthEtIsolations::m_dfltEtIsols
staticprotected
Initial value:
= {
{
-999.*CLHEP::GeV, -999.*CLHEP::GeV, -999.*CLHEP::GeV, -999.*CLHEP::GeV,
-999.*CLHEP::GeV, -999.*CLHEP::GeV, -999.*CLHEP::GeV, -999.*CLHEP::GeV
}
}

The default Et isolation energy which is being returned when I don't know what to return.

That's ugly but for backward compatibility's sake... Next EDM :P

Definition at line 210 of file TruthEtIsolations.h.

◆ m_etIsolations

EtIsolMap_t TruthEtIsolations::m_etIsolations
protected

Holds transverse energy isolations for different isolation cones The key of this map is the barcode of the HepMC::GenParticle for which the Et isolations have been computed.

Definition at line 205 of file TruthEtIsolations.h.

◆ m_genEvtLink

GenEventLink_t TruthEtIsolations::m_genEvtLink
protected

ElementLink to the HepMC::GenEvent from which the Et isolations have been (or will be) computed

Definition at line 200 of file TruthEtIsolations.h.


The documentation for this class was generated from the following files:
et
Extra patterns decribing particle interation process.
TruthParticleParameters::NbrOfCones
@ NbrOfCones
Definition: TruthParticleParamDefs.h:31
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TruthEtIsolations::m_genEvtLink
GenEventLink_t m_genEvtLink
ElementLink to the HepMC::GenEvent from which the Et isolations have been (or will be) computed
Definition: TruthEtIsolations.h:200
TruthEtIsolations::m_etIsolations
EtIsolMap_t m_etIsolations
Holds transverse energy isolations for different isolation cones The key of this map is the barcode o...
Definition: TruthEtIsolations.h:205
TruthEtIsolations::hasEtIsol
bool hasEtIsol(const HepMC::ConstGenParticlePtr &genParticle) const
Return true if this TruthEtIsolations container holds Et isolations for that HepMC::GenParticle.
Definition: TruthEtIsolations.cxx:98
TruthEtIsolations::etIsol
double etIsol(const HepMC::ConstGenParticlePtr &genParticle, const TruthParticleParameters::ConeSize coneIdx) const
Return the transverse energy in a given cone size of isolation, for a given HepMC::GenParticle.
Definition: TruthEtIsolations.cxx:114
lumiFormat.i
int i
Definition: lumiFormat.py:92
TruthEtIsolations::m_dfltEtIsols
static const EtIsol_t m_dfltEtIsols
The default Et isolation energy which is being returned when I don't know what to return.
Definition: TruthEtIsolations.h:210
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
TruthEtIsolations::etIsolations
const EtIsol_t * etIsolations(const HepMC::ConstGenParticlePtr &genParticle) const
Return the transverse energies for all cone sizes of isolation, for a given HepMC::GenParticle's barc...
Definition: TruthEtIsolations.cxx:106
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
EtIsol_t
TruthEtIsolations::EtIsol_t EtIsol_t
Definition: TruthEtIsolations.cxx:29