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

#include <GBlock_v1.h>

Inheritance diagram for xAOD::GBlock_v1:
Collaboration diagram for xAOD::GBlock_v1:

Public Types

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.

Public Member Functions

 GBlock_v1 ()=default
 Default constructor.
 GBlock_v1 (const GBlock_v1 &other)
 Copy constructor.
GBlock_v1operator= (const GBlock_v1 &other)
 Assignment operator.
virtual ~GBlock_v1 () override
 Default destructor.
virtual double pt () const final
 The transverse momentum of the particle.
virtual double eta () const final
 The pseudorapidity ( \(\eta\)) of the particle.
void setEta (double)
virtual double phi () const final
 The azimuthal angle ( \(\phi\)) of the particle.
void setPhi (double)
float deta () const
 The pseudorapidity ( \(\eta\)) of the particle.
void setdEta (float)
float dphi () const
 The azimuthal angle ( \(\phi\)) of the particle.
void setdPhi (float)
float et () const
void setEt (float)
virtual double m () const final
 The invariant mass of the particle.
virtual double e () const final
 The total energy of the particle.
virtual double rapidity () const final
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const final
 The full 4-momentum of the particle as a TLoretzVector.
virtual Type::ObjectType type () const final
 The type of the object as a simple enumeration, remains pure virtual in e/gamma.
const ElementLink< JGTowerContainer > & seedTowerLink () const
 The element link to the seed tower of this gBlock.
const JGTowerseedTower () const
 The seed tower for this gBlock.
std::size_t nTowers () const
 The number of towers that make up this gBlock (including the seed).
const std::vector< ElementLink< JGTowerContainer > > & towerLinks () const
 Element links to the towers making up this gBlock (including the seed).
const JGTowergetTower (std::size_t idx) const
 Get a link by number.
float area () const
 The area of the gBlock.
void setArea (float)
 Set the area.
void setSeedTowerLink (const ElementLink< JGTowerContainer > &link)
 Set the seed link.
void setTowerLinks (const std::vector< ElementLink< JGTowerContainer > > &links)
 set the tower links
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

Definition at line 16 of file GBlock_v1.h.

Member Typedef Documentation

◆ FourMom_t

Definition of the 4-momentum type.

Definition at line 60 of file GBlock_v1.h.

Constructor & Destructor Documentation

◆ GBlock_v1() [1/2]

xAOD::GBlock_v1::GBlock_v1 ( )
default

Default constructor.

◆ GBlock_v1() [2/2]

xAOD::GBlock_v1::GBlock_v1 ( const GBlock_v1 & other)

Copy constructor.

Definition at line 18 of file GBlock_v1.cxx.

20 {
21 }
IParticle()=default

◆ ~GBlock_v1()

xAOD::GBlock_v1::~GBlock_v1 ( )
overridevirtual

Default destructor.

Definition at line 36 of file GBlock_v1.cxx.

36{}

Member Function Documentation

◆ area()

float xAOD::GBlock_v1::area ( ) const

The area of the gBlock.

◆ 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

◆ deta()

float xAOD::GBlock_v1::deta ( ) const

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

◆ dphi()

float xAOD::GBlock_v1::dphi ( ) const

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

◆ e()

double xAOD::GBlock_v1::e ( ) const
finalvirtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 56 of file GBlock_v1.cxx.

56{ return p4().E(); }
virtual FourMom_t p4() const final
The full 4-momentum of the particle as a TLoretzVector.
Definition GBlock_v1.cxx:60

◆ et()

float xAOD::GBlock_v1::et ( ) const

◆ eta()

virtual double xAOD::GBlock_v1::eta ( ) const
finalvirtual

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

Implements xAOD::IParticle.

◆ getTower()

const JGTower * xAOD::GBlock_v1::getTower ( std::size_t idx) const

Get a link by number.

Definition at line 89 of file GBlock_v1.cxx.

90 {
91 const std::vector<ElementLink<JGTowerContainer>> &links = towerLinks();
92 return idx >= links.size() ? nullptr : *links[idx];
93 }
const std::vector< ElementLink< JGTowerContainer > > & towerLinks() const
Element links to the towers making up this gBlock (including the seed).
Definition GBlock_v1.cxx:84

◆ 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::GBlock_v1::m ( ) const
finalvirtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 54 of file GBlock_v1.cxx.

54{ return 0; }

◆ nTowers()

std::size_t xAOD::GBlock_v1::nTowers ( ) const

The number of towers that make up this gBlock (including the seed).

◆ operator=()

GBlock_v1 & xAOD::GBlock_v1::operator= ( const GBlock_v1 & other)

Assignment operator.

Definition at line 23 of file GBlock_v1.cxx.

24 {
25 if (this != &other)
26 {
27 if (!container() && !hasStore())
28 {
30 }
32 }
33 return *this;
34 }
IParticle & operator=(const IParticle &)=default
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()

GBlock_v1::FourMom_t xAOD::GBlock_v1::p4 ( ) const
finalvirtual

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

Implements xAOD::IParticle.

Definition at line 60 of file GBlock_v1.cxx.

61 {
63 double PT = (pt() > 0) ? 1000. * static_cast<double>(pt()) : 0.01;
64 p4.SetPtEtaPhiM(PT, eta(), phi(), m());
65 return p4;
66 }
virtual double m() const final
The invariant mass of the particle.
Definition GBlock_v1.cxx:54
virtual double eta() const final
The pseudorapidity ( ) of the particle.
virtual double pt() const final
The transverse momentum of the particle.
Definition GBlock_v1.cxx:38
virtual double phi() const final
The azimuthal angle ( ) of the particle.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition GBlock_v1.h:60
H5::PredType PT
Definition H5Traits.cxx:15

◆ phi()

virtual double xAOD::GBlock_v1::phi ( ) const
finalvirtual

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

Implements xAOD::IParticle.

◆ pt()

double xAOD::GBlock_v1::pt ( ) const
finalvirtual

The transverse momentum of the particle.

Implements xAOD::IParticle.

Definition at line 38 of file GBlock_v1.cxx.

38{ return et(); }
float et() const

◆ rapidity()

double xAOD::GBlock_v1::rapidity ( ) const
finalvirtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 58 of file GBlock_v1.cxx.

58{ return p4().Rapidity(); }

◆ seedTower()

const JGTower * xAOD::GBlock_v1::seedTower ( ) const

The seed tower for this gBlock.

Definition at line 78 of file GBlock_v1.cxx.

79 {
81 return link.isValid() ? *link : nullptr;
82 }
const ElementLink< JGTowerContainer > & seedTowerLink() const
The element link to the seed tower of this gBlock.
Definition GBlock_v1.cxx:73
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ seedTowerLink()

const ElementLink< JGTowerContainer > & xAOD::GBlock_v1::seedTowerLink ( ) const

The element link to the seed tower of this gBlock.

Definition at line 73 of file GBlock_v1.cxx.

74 {
75 return accSeedTower(*this);
76 }

◆ setArea()

void xAOD::GBlock_v1::setArea ( float )

Set the area.

◆ setdEta()

void xAOD::GBlock_v1::setdEta ( float )

◆ setdPhi()

void xAOD::GBlock_v1::setdPhi ( float )

◆ setEt()

void xAOD::GBlock_v1::setEt ( float )

◆ setEta()

void xAOD::GBlock_v1::setEta ( double )

◆ setPhi()

void xAOD::GBlock_v1::setPhi ( double )

◆ setSeedTowerLink()

void xAOD::GBlock_v1::setSeedTowerLink ( const ElementLink< JGTowerContainer > & link)

Set the seed link.

Definition at line 95 of file GBlock_v1.cxx.

96 {
97 decSeedTower(*this) = link;
98 }

◆ setTowerLinks()

void xAOD::GBlock_v1::setTowerLinks ( const std::vector< ElementLink< JGTowerContainer > > & links)

set the tower links

Definition at line 101 of file GBlock_v1.cxx.

102 {
103 decTowers(*this) = links;
104 }

◆ towerLinks()

const std::vector< ElementLink< JGTowerContainer > > & xAOD::GBlock_v1::towerLinks ( ) const

Element links to the towers making up this gBlock (including the seed).

Definition at line 84 of file GBlock_v1.cxx.

85 {
86 return accTowers(*this);
87 }

◆ type()

Type::ObjectType xAOD::GBlock_v1::type ( ) const
finalvirtual

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

Implements xAOD::IParticle.

Definition at line 68 of file GBlock_v1.cxx.

69 {
70 return Type::Other;
71 }

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