ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::MET::PufitGrid::Tower Class Reference

Describes a single element of the grid. More...

#include <PufitGrid.h>

Inheritance diagram for HLT::MET::PufitGrid::Tower:
Collaboration diagram for HLT::MET::PufitGrid::Tower:

Public Member Functions

 Tower (const PufitGrid *parent, std::size_t index)
 Create a tower with its parent.
 Tower (const Tower &)=default
Toweroperator= (const Tower &other)
 Copy assignment operator.
double ex () const
 The x-component of this tower's energy.
double ey () const
 The y-component of this tower's energy.
double ez () const
 The z-component of this tower's energy.
double sumEt () const
 The total sumEt in this tower.
double sumE () const
 The total sumE in this tower.
double phi () const
 This tower's kinematic phi.
double eta () const
 This tower's kinematic eta.
bool masked () const
 Whether or not this tower was masked.
void mask (bool value=true)
 Set the mask on this tower.
virtual const PufitGridgrid () const override
 The parent grid of this tower.
SignedKinematics kinematics () const
 Build a kinematics object from this tower.
 operator SignedKinematics () const
 Conversion operator.
Toweroperator+= (const SignedKinematics &kin)
 Add a signed object to this tower.
Toweroperator-= (const SignedKinematics &kin)
 Remove the energy of a signed object from this tower.
Toweroperator+= (const Tower &other)
 Add another tower's energies into this one.
Toweroperator-= (const Tower &other)
 Subtract another tower's energies from this one.
double towerPhi () const
 The central phi coordinate of this tower.
double towerEta () const
 The central eta coordinate of this tower.
std::size_t index () const
 The global index of this tower.
std::size_t etaIndex () const
 The eta index of this tower.
std::size_t phiIndex () const
 The phi index of this tower.
std::pair< std::size_t, std::size_t > etaPhiIndex () const
 The eta/phi indices of the tower together.

Private Attributes

const PufitGrid *const m_parent
 The parent grid.
SignedKinematics m_kin
double m_sumEt {0.}
 The summed et.
double m_sumE {0.}
 The summed energy.
bool m_mask {false}
 The mask value.
std::size_t m_index

Detailed Description

Describes a single element of the grid.

There are two sets of directions here - the 'kinematic' directions which result from the sums of objects going into the towers and the tower coordinates themselves.

Definition at line 47 of file PufitGrid.h.

Constructor & Destructor Documentation

◆ Tower() [1/2]

HLT::MET::PufitGrid::Tower::Tower ( const PufitGrid * parent,
std::size_t index )

Create a tower with its parent.

Parameters
parentThe parent grid of this tower
indexThe index of this tower in its parent's grid

Definition at line 15 of file PufitGrid.cxx.

15 : PeriodicGridBase::Tower(index),
16 m_parent(parent)
17 {
18 }
std::size_t index() const
The global index of this tower.
const PufitGrid *const m_parent
The parent grid.
Definition PufitGrid.h:133

◆ Tower() [2/2]

HLT::MET::PufitGrid::Tower::Tower ( const Tower & )
default

Member Function Documentation

◆ eta()

double HLT::MET::PufitGrid::Tower::eta ( ) const

This tower's kinematic eta.

Definition at line 35 of file PufitGrid.cxx.

35{ return kinematics().eta(); }
SignedKinematics kinematics() const
Build a kinematics object from this tower.
Definition PufitGrid.cxx:41
double eta() const
Direction.

◆ etaIndex()

std::size_t HLT::MET::PeriodicGridBase::Tower::etaIndex ( ) const
inherited

The eta index of this tower.

Definition at line 49 of file PeriodicGridBase.cxx.

50 {
51 return etaPhiIndex().first;
52 }
std::pair< std::size_t, std::size_t > etaPhiIndex() const
The eta/phi indices of the tower together.

◆ etaPhiIndex()

std::pair< std::size_t, std::size_t > HLT::MET::PeriodicGridBase::Tower::etaPhiIndex ( ) const
inherited

The eta/phi indices of the tower together.

Definition at line 59 of file PeriodicGridBase.cxx.

60 {
61 return grid()->etaPhiIndex(m_index);
62 }
virtual const PeriodicGridBase * grid() const =0
The grid which owns this tower.
std::pair< std::size_t, std::size_t > etaPhiIndex(std::size_t index) const
Convert a global index to an eta/phi index pair.

◆ ex()

double HLT::MET::PufitGrid::Tower::ex ( ) const

The x-component of this tower's energy.

Definition at line 29 of file PufitGrid.cxx.

29{ return m_kin.px(); }
SignedKinematics m_kin
Definition PufitGrid.h:135

◆ ey()

double HLT::MET::PufitGrid::Tower::ey ( ) const

The y-component of this tower's energy.

Definition at line 30 of file PufitGrid.cxx.

30{ return m_kin.py(); }

◆ ez()

double HLT::MET::PufitGrid::Tower::ez ( ) const

The z-component of this tower's energy.

Definition at line 31 of file PufitGrid.cxx.

31{ return m_kin.pz(); }

◆ grid()

const PufitGrid * HLT::MET::PufitGrid::Tower::grid ( ) const
overridevirtual

The parent grid of this tower.

Implements HLT::MET::PeriodicGridBase::Tower.

Definition at line 39 of file PufitGrid.cxx.

39{ return m_parent; }

◆ index()

std::size_t HLT::MET::PeriodicGridBase::Tower::index ( ) const
inherited

The global index of this tower.

Definition at line 44 of file PeriodicGridBase.cxx.

45 {
46 return m_index;
47 }

◆ kinematics()

SignedKinematics HLT::MET::PufitGrid::Tower::kinematics ( ) const

Build a kinematics object from this tower.

Definition at line 41 of file PufitGrid.cxx.

42 {
43 return m_kin;
44 }

◆ mask()

void HLT::MET::PufitGrid::Tower::mask ( bool value = true)

Set the mask on this tower.

Definition at line 37 of file PufitGrid.cxx.

37{ m_mask = value; }
bool m_mask
The mask value.
Definition PufitGrid.h:141

◆ masked()

bool HLT::MET::PufitGrid::Tower::masked ( ) const

Whether or not this tower was masked.

Definition at line 36 of file PufitGrid.cxx.

36{ return m_mask; }

◆ operator SignedKinematics()

HLT::MET::PufitGrid::Tower::operator SignedKinematics ( ) const

Conversion operator.

Definition at line 45 of file PufitGrid.cxx.

45{ return kinematics(); }

◆ operator+=() [1/2]

PufitGrid::Tower & HLT::MET::PufitGrid::Tower::operator+= ( const SignedKinematics & kin)

Add a signed object to this tower.

No check is done to make sure that this is the right bin. The momentum of the kinematics will be used. If you do not want this (i.e. you want mass to be ignored) you should construct the kinematics without mass.

Definition at line 47 of file PufitGrid.cxx.

48 {
49 m_kin += kin;
50 m_sumEt += kin.pt();
51 m_sumE += kin.energy();
52 return *this;
53 }
double m_sumE
The summed energy.
Definition PufitGrid.h:139
double m_sumEt
The summed et.
Definition PufitGrid.h:137

◆ operator+=() [2/2]

PufitGrid::Tower & HLT::MET::PufitGrid::Tower::operator+= ( const Tower & other)

Add another tower's energies into this one.

Definition at line 61 of file PufitGrid.cxx.

62 {
63 m_kin += other.kinematics();
64 m_sumEt += other.sumEt();
65 m_sumE += other.sumE();
66 return *this;
67 }

◆ operator-=() [1/2]

PufitGrid::Tower & HLT::MET::PufitGrid::Tower::operator-= ( const SignedKinematics & kin)

Remove the energy of a signed object from this tower.

No check is done to make sure that this is the right bin. The momentum of the kinematics will be used. If you do not want this (i.e. you want mass to be ignored) you should construct the kinematics without mass.

Definition at line 54 of file PufitGrid.cxx.

55 {
56 m_kin -= kin;
57 m_sumEt -= kin.pt();
58 m_sumE -= kin.energy();
59 return *this;
60 }

◆ operator-=() [2/2]

PufitGrid::Tower & HLT::MET::PufitGrid::Tower::operator-= ( const Tower & other)

Subtract another tower's energies from this one.

Definition at line 68 of file PufitGrid.cxx.

69 {
70 m_kin -= other.kinematics();
71 m_sumEt -= other.sumEt();
72 m_sumE -= other.sumE();
73 return *this;
74 }

◆ operator=()

PufitGrid::Tower & HLT::MET::PufitGrid::Tower::operator= ( const Tower & other)

Copy assignment operator.

This will not copy the other tower's parent. Each tower's parent is fixed from construction! This only copies the energy and masking information over.

Definition at line 20 of file PufitGrid.cxx.

21 {
22 m_kin = other.kinematics();
23 m_sumEt = other.sumEt();
24 m_sumE = other.sumE();
25 m_mask = other.masked();
26 return *this;
27 }

◆ phi()

double HLT::MET::PufitGrid::Tower::phi ( ) const

This tower's kinematic phi.

Definition at line 34 of file PufitGrid.cxx.

34{ return kinematics().phi(); }

◆ phiIndex()

std::size_t HLT::MET::PeriodicGridBase::Tower::phiIndex ( ) const
inherited

The phi index of this tower.

Definition at line 54 of file PeriodicGridBase.cxx.

55 {
56 return etaPhiIndex().second;
57 }

◆ sumE()

double HLT::MET::PufitGrid::Tower::sumE ( ) const

The total sumE in this tower.

Definition at line 33 of file PufitGrid.cxx.

33{ return m_sumE; }

◆ sumEt()

double HLT::MET::PufitGrid::Tower::sumEt ( ) const

The total sumEt in this tower.

Definition at line 32 of file PufitGrid.cxx.

32{ return m_sumEt; }

◆ towerEta()

double HLT::MET::PeriodicGridBase::Tower::towerEta ( ) const
inherited

The central eta coordinate of this tower.

Definition at line 39 of file PeriodicGridBase.cxx.

40 {
41 return grid()->centralEta(m_index);
42 }
double centralEta(std::size_t iEta) const
Central eta coordinate of the given eta index.

◆ towerPhi()

double HLT::MET::PeriodicGridBase::Tower::towerPhi ( ) const
inherited

The central phi coordinate of this tower.

Definition at line 34 of file PeriodicGridBase.cxx.

35 {
36 return grid()->centralPhi(m_index);
37 }
double centralPhi(std::size_t iPhi) const
Central phi coordinate of the given phi.

Member Data Documentation

◆ m_index

std::size_t HLT::MET::PeriodicGridBase::Tower::m_index
privateinherited

Definition at line 109 of file PeriodicGridBase.h.

◆ m_kin

SignedKinematics HLT::MET::PufitGrid::Tower::m_kin
private

Definition at line 135 of file PufitGrid.h.

◆ m_mask

bool HLT::MET::PufitGrid::Tower::m_mask {false}
private

The mask value.

Definition at line 141 of file PufitGrid.h.

141{false};

◆ m_parent

const PufitGrid* const HLT::MET::PufitGrid::Tower::m_parent
private

The parent grid.

Definition at line 133 of file PufitGrid.h.

◆ m_sumE

double HLT::MET::PufitGrid::Tower::m_sumE {0.}
private

The summed energy.

Definition at line 139 of file PufitGrid.h.

139{0.};

◆ m_sumEt

double HLT::MET::PufitGrid::Tower::m_sumEt {0.}
private

The summed et.

Definition at line 137 of file PufitGrid.h.

137{0.};

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