ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloEvent
src
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
14
#include "
CaloEvent/CaloTowerSeg.h
"
15
16
const
CaloPhiRange
CaloTowerSeg::s_range
;
17
18
23
CaloTowerSeg::SubSeg
CaloTowerSeg::subseg
(
double
eta
,
double
deta
,
24
double
phi
,
double
dphi
)
const
25
{
26
using
index_t
=
SubSeg::index_t
;
27
28
index_t
etamin
= this->
etaIndex
(eta -
deta
+ 0.001);
29
if
(
etamin
==
CaloTowerSeg::outOfRange
)
30
etamin
= 1;
31
32
index_t
etamax
= this->
etaIndex
(eta +
deta
- 0.001);
33
if
(
etamax
==
CaloTowerSeg::outOfRange
)
34
etamax
= this->
neta
();
35
36
index_t
phimin
= this->
phiIndex
(
CaloPhiRange::fix
(
phi
-
dphi
+ 0.001));
37
if
(
phimin
==
CaloTowerSeg::outOfRange
)
38
phimin
= this->
phiIndex
(this->
phimin
());
39
40
index_t
phimax
= this->
phiIndex
(
CaloPhiRange::fix
(
phi
+
dphi
- 0.001));
41
if
(
phimax
==
CaloTowerSeg::outOfRange
)
42
phimax
= this->
phiIndex
(this->
phimax
() - this->
dphi
()/2);
43
44
return
SubSeg
(*
this
,
etamin
,
etamax
,
phimin
,
phimax
);
45
}
46
47
57
CaloTowerSeg::SubSeg::SubSeg
(
const
CaloTowerSeg
&
parent
,
58
index_t
etamin
,
index_t
etamax
,
59
index_t
phimin
,
index_t
phimax
)
60
:
m_parent
(
parent
),
61
m_etamin
(
etamin
),
62
m_etamax
(
etamax
),
63
m_phimin
(
phimin
),
64
m_phimax
(
phimax
)
65
{
66
}
67
68
72
size_t
CaloTowerSeg::SubSeg::nphi
()
const
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
85
CaloTowerSeg
CaloTowerSeg::SubSeg::segmentation
()
const
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
CaloTowerSeg.h
CaloPhiRange
This class defines the phi convention for Calorimeters.
Definition
CaloPhiRange.h:28
CaloPhiRange::fix
static double fix(double phi)
Definition
CaloPhiRange.cxx:14
CaloTowerSeg::SubSeg
A rectangular window within the segmentation.
Definition
CaloTowerSeg.h:202
CaloTowerSeg::SubSeg::m_etamax
index_t m_etamax
Definition
CaloTowerSeg.h:255
CaloTowerSeg::SubSeg::m_parent
const CaloTowerSeg & m_parent
Segmentation of which this is a part.
Definition
CaloTowerSeg.h:251
CaloTowerSeg::SubSeg::etamax
index_t etamax() const
Upper eta index (inclusive).
Definition
CaloTowerSeg.h:549
CaloTowerSeg::SubSeg::m_phimin
index_t m_phimin
Definition
CaloTowerSeg.h:256
CaloTowerSeg::SubSeg::nphi
size_t nphi() const
The number of towers in the phi direction in this window.
Definition
CaloTowerSeg.cxx:72
CaloTowerSeg::SubSeg::etamin
index_t etamin() const
Lower eta index.
Definition
CaloTowerSeg.h:538
CaloTowerSeg::SubSeg::m_etamin
index_t m_etamin
Inclusive indices. m_phimax < m_phimin indicates phi wraparound.
Definition
CaloTowerSeg.h:254
CaloTowerSeg::SubSeg::parent
const CaloTowerSeg & parent() const
Definition
CaloTowerSeg.h:240
CaloTowerSeg::SubSeg::phimin
index_t phimin() const
Lower phi index.
Definition
CaloTowerSeg.h:560
CaloTowerSeg::SubSeg::phimax
index_t phimax() const
Upper phi index (inclusive). phimax<phimin indicates phi wraparound.
Definition
CaloTowerSeg.h:571
CaloTowerSeg::SubSeg::m_phimax
index_t m_phimax
Definition
CaloTowerSeg.h:257
CaloTowerSeg::SubSeg::index_t
CaloTowerSeg::index_t index_t
Definition
CaloTowerSeg.h:204
CaloTowerSeg::SubSeg::SubSeg
SubSeg(const CaloTowerSeg &parent, index_t etamin, index_t etamax, index_t phimin, index_t phimax)
Constructor.
Definition
CaloTowerSeg.cxx:57
CaloTowerSeg::SubSeg::segmentation
CaloTowerSeg segmentation() const
Return a new segmentation object corresponding to this window.
Definition
CaloTowerSeg.cxx:85
CaloTowerSeg::nphi
index_t nphi() const
Retrieve number of bins.
Definition
CaloTowerSeg.h:428
CaloTowerSeg::index_t
size_t index_t
Type for eta, phi indices.
Definition
CaloTowerSeg.h:41
CaloTowerSeg::CaloTowerSeg
CaloTowerSeg()
Default constructor.
Definition
CaloTowerSeg.h:51
CaloTowerSeg::phimin
double phimin() const
Retrieve lower boundary value range.
Definition
CaloTowerSeg.h:453
CaloTowerSeg::neta
index_t neta() const
Retrieve number of bins.
Definition
CaloTowerSeg.h:423
CaloTowerSeg::deta
double deta() const
Retrieve bin size .
Definition
CaloTowerSeg.h:433
CaloTowerSeg::s_range
static const CaloPhiRange s_range
Definition
CaloTowerSeg.h:417
CaloTowerSeg::dphi
double dphi() const
Retrieve bin size .
Definition
CaloTowerSeg.h:438
CaloTowerSeg::phiIndex
index_t phiIndex(double phiVal) const
Returns index for a given value.
Definition
CaloTowerSeg.h:499
CaloTowerSeg::subseg
SubSeg subseg(double eta, double deta, double phi, double dphi) const
Return a window within the current segmentation.
Definition
CaloTowerSeg.cxx:23
CaloTowerSeg::outOfRange
static const index_t outOfRange
Used to flag out-of-range indices.
Definition
CaloTowerSeg.h:44
CaloTowerSeg::phimax
double phimax() const
Retrieve upper boundary value range.
Definition
CaloTowerSeg.h:458
CaloTowerSeg::phi
double phi(index_t phiInd) const
Returns value for a given index.
Definition
CaloTowerSeg.h:521
CaloTowerSeg::etamin
double etamin() const
Retrieve lower boundary value range.
Definition
CaloTowerSeg.h:443
CaloTowerSeg::etamax
double etamax() const
Retrieve upper boundary value range.
Definition
CaloTowerSeg.h:448
CaloTowerSeg::eta
double eta(index_t etaInd) const
Returns value for a given index.
Definition
CaloTowerSeg.h:516
CaloTowerSeg::etaIndex
index_t etaIndex(double etaVal) const
Returns index for a given value.
Definition
CaloTowerSeg.h:489
Generated on
for ATLAS Offline Software by
1.17.0