ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
HLT::MET::PufitMultiGrid< N >::Tower Class Reference

Tower in the multi-grid. More...

#include <PufitMultiGrid.h>

Inheritance diagram for HLT::MET::PufitMultiGrid< N >::Tower:
Collaboration diagram for HLT::MET::PufitMultiGrid< N >::Tower:

Public Member Functions

 Tower (PufitMultiGrid *parent, std::size_t index)
 Create a tower with its parent grid. More...
 
 Tower (const Tower &)=default
 
Toweroperator= (const Tower &other)
 Copy assignment operator. More...
 
double ex (std::size_t type=All) const
 The x-component of this tower's energy. More...
 
double ey (std::size_t type=All) const
 The y-component of this tower's energy. More...
 
double ez (std::size_t type=All) const
 The z-component of this tower's energy. More...
 
double sumEt (std::size_t type=All) const
 The total sumEt in this tower. More...
 
double sumE (std::size_t type=All) const
 The total sumE in this tower. More...
 
double phi (std::size_t type=All) const
 This tower's kinematic phi. More...
 
double eta (std::size_t type=All) const
 This tower's kinematic eta. More...
 
bool masked () const
 Whether or not this tower was masked. More...
 
void mask (bool value=true)
 Set the mask on this tower. More...
 
const PufitMultiGridgrid () const override
 The parent grid of this tower. More...
 
SignedKinematics kinematics (std::size_t type=All) const
 Build a kinematics object from this tower. More...
 
 operator SignedKinematics () const
 Conversion operator, returns the value for the sum of all the grids. More...
 
Toweroperator+= (const Tower &other)
 Add another tower's energies into this one. More...
 
Toweroperator-= (const Tower &other)
 Subtract another tower's energies from this one. More...
 
void applyToAll (PufitGrid::Tower &(PufitGrid::Tower::*f)(const PufitGrid::Tower &), const PufitMultiGrid::Tower &other)
 Apply a function to all sub towers. More...
 
template<typename T >
std::decay< T >::type sumOver (int type, T(PufitGrid::Tower::*f)() const) const
 Sum over the results of all sub towers whose indices match the 'type' mask. More...
 
double towerPhi () const
 The central phi coordinate of this tower. More...
 
double towerEta () const
 The central eta coordinate of this tower. More...
 
std::size_t index () const
 The global index of this tower. More...
 
std::size_t etaIndex () const
 The eta index of this tower. More...
 
std::size_t phiIndex () const
 The phi index of this tower. More...
 
std::pair< std::size_t, std::size_t > etaPhiIndex () const
 The eta/phi indices of the tower together. More...
 

Public Attributes

template<std::size_t I, typename = typename std::enable_if<isPow2(I)>::type>
 m_grids [ii][index()]
 Get one of the underlying towers. More...
 

Private Attributes

std::size_t m_index
 

Friends

class PufitMulitGrid
 

Detailed Description

template<std::size_t N>
class HLT::MET::PufitMultiGrid< N >::Tower

Tower in the multi-grid.

Each tower is built from N 'normal' PufitGrid::Towers. Kinematic quantities can be read from the tower either from any of the 'subtowers' or from a sum over them, passing in a std::size_t as a bitmask.

Definition at line 82 of file PufitMultiGrid.h.

Constructor & Destructor Documentation

◆ Tower() [1/2]

template<std::size_t N>
HLT::MET::PufitMultiGrid< N >::Tower::Tower ( PufitMultiGrid parent,
std::size_t  index 
)

Create a tower with its parent grid.

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

◆ Tower() [2/2]

template<std::size_t N>
HLT::MET::PufitMultiGrid< N >::Tower::Tower ( const Tower )
default

Member Function Documentation

◆ applyToAll()

template<std::size_t N>
void HLT::MET::PufitMultiGrid< N >::Tower::applyToAll ( PufitGrid::Tower &(PufitGrid::Tower::*)(const PufitGrid::Tower &)  f,
const PufitMultiGrid::Tower other 
)
inline

Apply a function to all sub towers.

Definition at line 196 of file PufitMultiGrid.h.

197  {
198  for (std::size_t ii = 0; ii < N; ++ii)
199  (subTower(ii).*f)(other.subTower(ii));
200  }

◆ eta()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::eta ( std::size_t  type = All) const

This tower's kinematic eta.

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

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

◆ ex()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::ex ( std::size_t  type = All) const

The x-component of this tower's energy.

◆ ey()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::ey ( std::size_t  type = All) const

The y-component of this tower's energy.

◆ ez()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::ez ( std::size_t  type = All) const

The z-component of this tower's energy.

◆ grid()

template<std::size_t N>
const PufitMultiGrid* HLT::MET::PufitMultiGrid< N >::Tower::grid ( ) const
overridevirtual

The parent grid of this tower.

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

◆ 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()

template<std::size_t N>
SignedKinematics HLT::MET::PufitMultiGrid< N >::Tower::kinematics ( std::size_t  type = All) const

Build a kinematics object from this tower.

◆ mask()

template<std::size_t N>
void HLT::MET::PufitMultiGrid< N >::Tower::mask ( bool  value = true)

Set the mask on this tower.

◆ masked()

template<std::size_t N>
bool HLT::MET::PufitMultiGrid< N >::Tower::masked ( ) const

Whether or not this tower was masked.

◆ operator SignedKinematics()

template<std::size_t N>
HLT::MET::PufitMultiGrid< N >::Tower::operator SignedKinematics ( ) const

Conversion operator, returns the value for the sum of all the grids.

◆ operator+=()

template<std::size_t N>
Tower& HLT::MET::PufitMultiGrid< N >::Tower::operator+= ( const Tower other)

Add another tower's energies into this one.

◆ operator-=()

template<std::size_t N>
Tower& HLT::MET::PufitMultiGrid< N >::Tower::operator-= ( const Tower other)

Subtract another tower's energies from this one.

◆ operator=()

template<std::size_t N>
Tower& HLT::MET::PufitMultiGrid< N >::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.

◆ phi()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::phi ( std::size_t  type = All) const

This tower's kinematic 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()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::sumE ( std::size_t  type = All) const

The total sumE in this tower.

◆ sumEt()

template<std::size_t N>
double HLT::MET::PufitMultiGrid< N >::Tower::sumEt ( std::size_t  type = All) const

The total sumEt in this tower.

◆ sumOver()

template<std::size_t N>
template<typename T >
std::decay<T>::type HLT::MET::PufitMultiGrid< N >::Tower::sumOver ( int  type,
T(PufitGrid::Tower::*)() const  f 
) const
inline

Sum over the results of all sub towers whose indices match the 'type' mask.

Definition at line 205 of file PufitMultiGrid.h.

206  {
207  typename std::decay<T>::type val{};
208  for (std::size_t ii = 0; ii < N; ++ii)
209  if (1 << ii & type)
210  val += (subTower(ii).*f)();
211  return val;
212  }

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

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

Friends And Related Function Documentation

◆ PufitMulitGrid

template<std::size_t N>
friend class PufitMulitGrid
friend

Definition at line 84 of file PufitMultiGrid.h.

Member Data Documentation

◆ m_grids

template<std::size_t N>
template<std::size_t I, typename = typename std::enable_if<isPow2(I)>::type>
HLT::MET::PufitMultiGrid< N >::Tower::m_grids[ii][index()]

Get one of the underlying towers.

This is only defined where I is a power of 2

Definition at line 192 of file PufitMultiGrid.h.

◆ m_index

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

Definition at line 109 of file PeriodicGridBase.h.


The documentation for this class was generated from the following file:
HLT::MET::PeriodicGridBase::Tower::etaPhiIndex
std::pair< std::size_t, std::size_t > etaPhiIndex() const
The eta/phi indices of the tower together.
Definition: PeriodicGridBase.cxx:59
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
HLT::MET::PeriodicGridBase::etaPhiIndex
std::pair< std::size_t, std::size_t > etaPhiIndex(std::size_t index) const
Convert a global index to an eta/phi index pair.
Definition: PeriodicGridBase.cxx:124
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
HLT::MET::PeriodicGridBase::Tower::grid
virtual const PeriodicGridBase * grid() const =0
The grid which owns this tower.
HLT::MET::PeriodicGridBase::centralPhi
double centralPhi(std::size_t iPhi) const
Central phi coordinate of the given phi.
Definition: PeriodicGridBase.cxx:133
HLT::MET::PeriodicGridBase::centralEta
double centralEta(std::size_t iEta) const
Central eta coordinate of the given eta index.
Definition: PeriodicGridBase.cxx:129
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLT::MET::PeriodicGridBase::Tower::m_index
std::size_t m_index
Definition: PeriodicGridBase.h:109