ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
CaloTowerSeg::SubSeg Class Reference

A rectangular window within the segmentation. More...

#include <CaloTowerSeg.h>

Collaboration diagram for CaloTowerSeg::SubSeg:

Public Types

typedef CaloTowerSeg::index_t index_t
 

Public Member Functions

 SubSeg (const CaloTowerSeg &parent, index_t etamin, index_t etamax, index_t phimin, index_t phimax)
 Constructor. More...
 
index_t etamin () const
 Lower eta index. More...
 
index_t etamax () const
 Upper eta index (inclusive). More...
 
index_t phimin () const
 Lower phi index. More...
 
index_t phimax () const
 Upper phi index (inclusive). phimax<phimin indicates phi wraparound. More...
 
size_t neta () const
 The number of towers in the eta direction in this window. More...
 
size_t nphi () const
 The number of towers in the phi direction in this window. More...
 
size_t size () const
 The number of towers in this window. More...
 
const CaloTowerSegparent () const
 
CaloTowerSeg segmentation () const
 Return a new segmentation object corresponding to this window. More...
 

Private Attributes

const CaloTowerSegm_parent
 Segmentation of which this is a part. More...
 
index_t m_etamin
 Inclusive indices. m_phimax < m_phimin indicates phi wraparound. More...
 
index_t m_etamax
 
index_t m_phimin
 
index_t m_phimax
 

Detailed Description

A rectangular window within the segmentation.

Definition at line 219 of file CaloTowerSeg.h.

Member Typedef Documentation

◆ index_t

Definition at line 222 of file CaloTowerSeg.h.

Constructor & Destructor Documentation

◆ SubSeg()

CaloTowerSeg::SubSeg::SubSeg ( const CaloTowerSeg parent,
index_t  etamin,
index_t  etamax,
index_t  phimin,
index_t  phimax 
)

Constructor.

Parameters
parentSegmentation of which this is a part.
etaminLower eta index.
etamaxUpper eta index (inclusive).
phiminLower phi index.
phimaxUpper phi index (inclusive). If phimax < phimin, then we wrap around in phi.

Definition at line 57 of file CaloTowerSeg.cxx.

60  : m_parent (parent),
61  m_etamin (etamin),
62  m_etamax (etamax),
63  m_phimin (phimin),
65 {
66 }

Member Function Documentation

◆ etamax()

CaloTowerSeg::SubSeg::index_t CaloTowerSeg::SubSeg::etamax ( ) const
inline

Upper eta index (inclusive).

Definition at line 549 of file CaloTowerSeg.h.

550 {
551  return m_etamax;
552 }

◆ etamin()

CaloTowerSeg::SubSeg::index_t CaloTowerSeg::SubSeg::etamin ( ) const
inline

Lower eta index.

Definition at line 538 of file CaloTowerSeg.h.

539 {
540  return m_etamin;
541 }

◆ neta()

size_t CaloTowerSeg::SubSeg::neta ( ) const
inline

The number of towers in the eta direction in this window.

Definition at line 581 of file CaloTowerSeg.h.

582 {
583  return m_etamax - m_etamin + 1;
584 }

◆ nphi()

size_t CaloTowerSeg::SubSeg::nphi ( ) const

The number of towers in the phi direction in this window.

Definition at line 72 of file CaloTowerSeg.cxx.

73 {
74  int nphi = m_phimax - m_phimin + 1;
75  // Handle phi wraparound.
76  if (m_phimax < m_phimin)
77  nphi += m_parent.nphi();
78  return nphi;
79 }

◆ parent()

const CaloTowerSeg& CaloTowerSeg::SubSeg::parent ( ) const
inline

Definition at line 258 of file CaloTowerSeg.h.

318 : public TOWER_ITERATOR

◆ phimax()

CaloTowerSeg::SubSeg::index_t CaloTowerSeg::SubSeg::phimax ( ) const
inline

Upper phi index (inclusive). phimax<phimin indicates phi wraparound.

Upper phi index (inclusive).

phimax<phimin indicates phi wraparound.

Definition at line 571 of file CaloTowerSeg.h.

572 {
573  return m_phimax;
574 }

◆ phimin()

CaloTowerSeg::SubSeg::index_t CaloTowerSeg::SubSeg::phimin ( ) const
inline

Lower phi index.

Definition at line 560 of file CaloTowerSeg.h.

561 {
562  return m_phimin;
563 }

◆ segmentation()

CaloTowerSeg CaloTowerSeg::SubSeg::segmentation ( ) const

Return a new segmentation object corresponding to this window.

Definition at line 85 of file CaloTowerSeg.cxx.

86 {
87  const double etamin = m_parent.eta (m_etamin) - m_parent.deta()/2;
88  const double etamax = m_parent.eta (m_etamax) + m_parent.deta()/2;
89 
90  const double phimin = m_parent.phi (m_phimin) - m_parent.dphi()/2;
91  const double phimax = m_parent.phi (m_phimax) + m_parent.dphi()/2;
92 
93  return {neta(), nphi(), etamin, etamax, phimin, phimax};
94 }

◆ size()

size_t CaloTowerSeg::SubSeg::size ( ) const
inline

The number of towers in this window.

Definition at line 591 of file CaloTowerSeg.h.

592 {
593  return neta() * nphi();
594 }

Member Data Documentation

◆ m_etamax

index_t CaloTowerSeg::SubSeg::m_etamax
private

Definition at line 273 of file CaloTowerSeg.h.

◆ m_etamin

index_t CaloTowerSeg::SubSeg::m_etamin
private

Inclusive indices. m_phimax < m_phimin indicates phi wraparound.

Definition at line 272 of file CaloTowerSeg.h.

◆ m_parent

const CaloTowerSeg& CaloTowerSeg::SubSeg::m_parent
private

Segmentation of which this is a part.

Definition at line 269 of file CaloTowerSeg.h.

◆ m_phimax

index_t CaloTowerSeg::SubSeg::m_phimax
private

Definition at line 275 of file CaloTowerSeg.h.

◆ m_phimin

index_t CaloTowerSeg::SubSeg::m_phimin
private

Definition at line 274 of file CaloTowerSeg.h.


The documentation for this class was generated from the following files:
CaloTowerSeg::eta
double eta(index_t etaInd) const
Returns value for a given index.
Definition: CaloTowerSeg.h:516
CaloTowerSeg::SubSeg::phimin
index_t phimin() const
Lower phi index.
Definition: CaloTowerSeg.h:560
CaloTowerSeg::SubSeg::parent
const CaloTowerSeg & parent() const
Definition: CaloTowerSeg.h:258
CaloTowerSeg::SubSeg::m_phimin
index_t m_phimin
Definition: CaloTowerSeg.h:274
CaloTowerSeg::SubSeg::etamax
index_t etamax() const
Upper eta index (inclusive).
Definition: CaloTowerSeg.h:549
CaloTowerSeg::SubSeg::etamin
index_t etamin() const
Lower eta index.
Definition: CaloTowerSeg.h:538
CaloTowerSeg::deta
double deta() const
Retrieve bin size .
Definition: CaloTowerSeg.h:433
CaloTowerSeg::nphi
index_t nphi() const
Retrieve number of bins.
Definition: CaloTowerSeg.h:428
CaloTowerSeg::dphi
double dphi() const
Retrieve bin size .
Definition: CaloTowerSeg.h:438
CaloTowerSeg::SubSeg::m_phimax
index_t m_phimax
Definition: CaloTowerSeg.h:275
CaloTowerSeg::phi
double phi(index_t phiInd) const
Returns value for a given index.
Definition: CaloTowerSeg.h:521
CaloTowerSeg::SubSeg::phimax
index_t phimax() const
Upper phi index (inclusive). phimax<phimin indicates phi wraparound.
Definition: CaloTowerSeg.h:571
CaloTowerSeg::SubSeg::m_parent
const CaloTowerSeg & m_parent
Segmentation of which this is a part.
Definition: CaloTowerSeg.h:269
CaloTowerSeg::SubSeg::m_etamax
index_t m_etamax
Definition: CaloTowerSeg.h:273
CaloTowerSeg::SubSeg::m_etamin
index_t m_etamin
Inclusive indices. m_phimax < m_phimin indicates phi wraparound.
Definition: CaloTowerSeg.h:272
CaloTowerSeg::SubSeg::nphi
size_t nphi() const
The number of towers in the phi direction in this window.
Definition: CaloTowerSeg.cxx:72
CaloTowerSeg::SubSeg::neta
size_t neta() const
The number of towers in the eta direction in this window.
Definition: CaloTowerSeg.h:581