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

! More...

#include <CaloTower_v1.h>

Inheritance diagram for xAOD::CaloTower_v1:
Collaboration diagram for xAOD::CaloTower_v1:

Public Types

enum  { INVALIDINDEX =-1 }

Public Member Functions

 CaloTower_v1 ()
 Default constructor.
 ~CaloTower_v1 ()
 Destructor.
void reset ()
 Reset function.
void addEnergy (double energy)
 Add energy.
void setEnergy (double energy)
 Sets the energy.
Implementations of the other @c IParticle interface methods
virtual Type::ObjectType type () const
 object type - presently Type::Other (FIXME)
Functions for getting and setting user properties
template<class T>
XAOD_AUXDATA_DEPRECATED T & auxdata (const std::string &name, const std::string &clsname="")
 Fetch an aux data variable, as a non-const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED const T & auxdata (const std::string &name, const std::string &clsname="") const
 Fetch an aux data variable, as a const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for reading or not.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for writing or not.

Private Member Functions

Set accessors to persistent data
floatf_ref_e ()
 Reference to modifiable energy store.
Get accessors to persistent data
float f_val_e () const
 Accessor for energy.

Kinematic accessors (@c IParticle interface)

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
typedef ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
 Base 4 Momentum type for calo.
virtual double pt () const
 transverse momentum \( p_{\mathrm{T}} \)
virtual double eta () const
 pseudorapidity \( \eta \)$
virtual double phi () const
 azimuth \( \phi \)
virtual double rapidity () const
 rapidity \( y \)
virtual double m () const
 mass \( m = 0 \) (by convention)
virtual double e () const
 energy \( E \)
GenVecFourMom_t genvecP4 () const
 Four-momentum representation: GenVector.
virtual FourMom_t p4 () const
 Four-momentum representation.

Detailed Description

!

Object representing calorimeter signal towers.

This object represents calorimeter energy towers located on a regular grid in azimuth and pseudorapidity. The grid is associated with the xAOD::CaloTowerContainer_v1. Due to the minimalistic underlying storage model, xAOD::CaloTower_v1 objects are only completely described if allocated in its container.

General kinematic features

Kinematic features of calorimeter towers are (1) they are massless, and (2) their direction is given by the center of the \( (\eta,\phi) \) bin they represent. This means that \( (\eta,\phi) \) for any given shower never changes, only its energy content is dynamic.

The full four-momentum of the calorimeter tower is calculated from its energy and direction

\[ \left(E,\eta,\phi\right) \mapsto \left(E=p,p_{x},p_{y},p_{z}\right) \]

Formally, this can be considered a massless pseudoparticle. If the net energy of the tower is negative, no physically meaningful four-momentum can be constructed (see below), rather the tower is represented by \( (0.,0., 0., 0.) \).

Treatment of negative energy towers

Negative energy towers cannot provide a four-momentum, but still contain valuable data. The direction \( ( \eta, \phi ) \) are independent of the value and sign of the tower energy, as towers are located at a fixed location in this space. The tower energy is provided independent of its sign as well. This means the xAOD::CaloTower_v1::e(), xAOD::CaloTower_v1::eta(), and xAOD::CaloTower_v1::phi() methods return correct information. In addition, the xAOD::CaloTower_v1::m() and xAOD::CaloTower_v1::rapidity() methods provide meaningful information as well, with rapidity \( y = \eta \) due to tower mass \( m = 0 \).

Definition at line 17 of file CaloTower_v1.h.

Member Typedef Documentation

◆ FourMom_t

Definition of the 4-momentum type.

Definition at line 58 of file CaloTower_v1.h.

◆ GenVecFourMom_t

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

Base 4 Momentum type for calo.

Definition at line 61 of file CaloTower_v1.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
INVALIDINDEX 

Definition at line 21 of file CaloTower_v1.h.

21 {
23 };

Constructor & Destructor Documentation

◆ CaloTower_v1()

xAOD::CaloTower_v1::CaloTower_v1 ( )

Default constructor.

Constructs empty xAOD::CaloTower_v1 object.

Definition at line 14 of file CaloTower_v1.cxx.

15 : IParticle()
16 {}
IParticle()=default

◆ ~CaloTower_v1()

xAOD::CaloTower_v1::~CaloTower_v1 ( )

Destructor.

Definition at line 19 of file CaloTower_v1.cxx.

20{ }

Member Function Documentation

◆ addEnergy()

void xAOD::CaloTower_v1::addEnergy ( double energy)

Add energy.

Parameters
[in]energyvalue added to tower energy

Definition at line 22 of file CaloTower_v1.cxx.

22 {
23 f_ref_e() += energy;
24}
float & f_ref_e()
Reference to modifiable energy store.

◆ 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

◆ e()

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

energy \( E \)

Implements xAOD::IParticle.

Definition at line 36 of file CaloTower_v1.cxx.

36{ return f_val_e(); }
float f_val_e() const
Accessor for energy.

◆ eta()

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

pseudorapidity \( \eta \)$

Implements xAOD::IParticle.

Definition at line 38 of file CaloTower_v1.cxx.

38 {
39 const CaloTowerContainer_v1* pTowCont =
40 static_cast<const CaloTowerContainer_v1*>(container());
41 return pTowCont->eta(index());
42}
str index
Definition DeMoScan.py:362
const SG::AuxVectorData * container() const
Return the container holding this element.

◆ f_ref_e()

float & xAOD::CaloTower_v1::f_ref_e ( )
inlineprivate

Reference to modifiable energy store.

Definition at line 87 of file CaloTower_v1.h.

87{ static const Accessor<float> acc("towerE"); return acc(*this); }
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ f_val_e()

float xAOD::CaloTower_v1::f_val_e ( ) const
inlineprivate

Accessor for energy.

Definition at line 89 of file CaloTower_v1.h.

89{ static const ConstAccessor<float> acc("towerE"); return acc(*this); }

◆ genvecP4()

xAOD::CaloTower_v1::GenVecFourMom_t xAOD::CaloTower_v1::genvecP4 ( ) const

Four-momentum representation: GenVector.

Definition at line 79 of file CaloTower_v1.cxx.

79 {
80
81 if (e() <= 0) {
82 // negative energy towers do not have a valid four-momentum representation (but a valid energy, eta, phi)
83 return GenVecFourMom_t();
84 }
85
86 const CaloTowerContainer_v1* pTowCont =
87 static_cast<const CaloTowerContainer_v1*>(container());
88
89
90 const double eta=pTowCont->eta(index());
91 const double phi=pTowCont->phi(index());
92 const double invcosheta = 1./std::cosh(eta);
93 const double pt=e()*invcosheta;
94 return GenVecFourMom_t(pt,eta,phi,m());
95}
virtual double pt() const
transverse momentum
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for calo.
virtual double m() const
mass (by convention)
virtual double eta() const
pseudorapidity $
virtual double phi() const
azimuth

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

◆ m()

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

mass \( m = 0 \) (by convention)

Implements xAOD::IParticle.

Definition at line 50 of file CaloTower_v1.cxx.

50{ return s_towerMass; }

◆ p4()

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

Four-momentum representation.

Implements xAOD::IParticle.

Definition at line 58 of file CaloTower_v1.cxx.

58 {
59
61
62 if (e() <= 0) {
63 // negative energy towers do not have a valid four-momentum representation (but a valid energy, eta, phi)
64 return p4;
65 }
66
67 const CaloTowerContainer_v1* pTowCont =
68 static_cast<const CaloTowerContainer_v1*>(container());
69
70
71 const double eta=pTowCont->eta(index());
72 const double phi=pTowCont->phi(index());
73 const double invcosheta = 1./std::cosh(eta);
74 const double pt=e()*invcosheta;
75 p4.SetPtEtaPhiM(pt,eta,phi,m());
76 return p4;
77}
virtual FourMom_t p4() const
Four-momentum representation.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.

◆ phi()

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

azimuth \( \phi \)

Implements xAOD::IParticle.

Definition at line 44 of file CaloTower_v1.cxx.

44 {
45 const CaloTowerContainer_v1* pTowCont =
46 static_cast<const CaloTowerContainer_v1*>(container());
47 return pTowCont->phi(index());
48}

◆ pt()

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

transverse momentum \( p_{\mathrm{T}} \)

Implements xAOD::IParticle.

Definition at line 52 of file CaloTower_v1.cxx.

52{ return genvecP4().Pt(); }
GenVecFourMom_t genvecP4() const
Four-momentum representation: GenVector.

◆ rapidity()

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

rapidity \( y \)

Implements xAOD::IParticle.

Definition at line 51 of file CaloTower_v1.cxx.

51{ return eta(); }

◆ reset()

void xAOD::CaloTower_v1::reset ( )

Reset function.

Sets the tower energy to zero. Indices/directions associated with this object are not changed.

Definition at line 30 of file CaloTower_v1.cxx.

30 {
31 f_ref_e() = 0.;
32}

◆ setEnergy()

void xAOD::CaloTower_v1::setEnergy ( double energy)

Sets the energy.

Parameters
[in]energyvalue to which the tower energy will be set to

Definition at line 26 of file CaloTower_v1.cxx.

26 {
27 f_ref_e() = energy;
28}

◆ type()

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

object type - presently Type::Other (FIXME)

Implements xAOD::IParticle.

Definition at line 55 of file CaloTower_v1.cxx.

55{ return Type::ObjectType::Other; }

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