ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTowerSeg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
15
17
18
24 double phi, double dphi) const
25{
27
28 index_t etamin = this->etaIndex (eta - deta + 0.001);
30 etamin = 1;
31
32 index_t etamax = this->etaIndex (eta + deta - 0.001);
34 etamax = this->neta();
35
36 index_t phimin = this->phiIndex (CaloPhiRange::fix (phi - dphi + 0.001));
38 phimin = this->phiIndex (this->phimin());
39
40 index_t phimax = this->phiIndex (CaloPhiRange::fix (phi + dphi - 0.001));
42 phimax = this->phiIndex (this->phimax() - this->dphi()/2);
43
44 return SubSeg (*this, etamin, etamax, phimin, phimax);
45}
46
47
67
68
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}
80
81
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}
95
96
This class defines the phi convention for Calorimeters.
static double fix(double phi)
A rectangular window within the segmentation.
const CaloTowerSeg & m_parent
Segmentation of which this is a part.
index_t etamax() const
Upper eta index (inclusive).
size_t nphi() const
The number of towers in the phi direction in this window.
index_t etamin() const
Lower eta index.
index_t m_etamin
Inclusive indices. m_phimax < m_phimin indicates phi wraparound.
const CaloTowerSeg & parent() const
index_t phimin() const
Lower phi index.
index_t phimax() const
Upper phi index (inclusive). phimax<phimin indicates phi wraparound.
CaloTowerSeg::index_t index_t
SubSeg(const CaloTowerSeg &parent, index_t etamin, index_t etamax, index_t phimin, index_t phimax)
Constructor.
CaloTowerSeg segmentation() const
Return a new segmentation object corresponding to this window.
index_t nphi() const
Retrieve number of bins.
size_t index_t
Type for eta, phi indices.
CaloTowerSeg()
Default constructor.
double phimin() const
Retrieve lower boundary value range.
index_t neta() const
Retrieve number of bins.
double deta() const
Retrieve bin size .
static const CaloPhiRange s_range
double dphi() const
Retrieve bin size .
index_t phiIndex(double phiVal) const
Returns index for a given value.
SubSeg subseg(double eta, double deta, double phi, double dphi) const
Return a window within the current segmentation.
static const index_t outOfRange
Used to flag out-of-range indices.
double phimax() const
Retrieve upper boundary value range.
double phi(index_t phiInd) const
Returns value for a given index.
double etamin() const
Retrieve lower boundary value range.
double etamax() const
Retrieve upper boundary value range.
double eta(index_t etaInd) const
Returns value for a given index.
index_t etaIndex(double etaVal) const
Returns index for a given value.