ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloDetectorRegion.cxx
Go to the documentation of this file.
3
4#include <iostream>
5
14
15//********************************************************************
16// Constructor
17//********************************************************************
20, m_valid (false)
21, m_etaIdx (99), m_phiIdx (99)
22, m_etaBinWidth (99.), m_phiBinWidth (99.)
23, m_etaCoord (99.), m_phiCoord (99.)
24, m_etaMin (99.), m_etaMax(99.)
25, m_phiMin (99.), m_phiMax(99.)
26{
27}
28
29
30//********************************************************************
31// Constructor
32//********************************************************************
34 LayerTypeEnum layer,
35 bool valid,
36 int etaIdx,
37 int phiIdx,
38 double etaBinWidth,
39 double phiBinWidth,
40 double etaCoord,
41 double phiCoord)
42: m_object (object), m_layer (layer)
43, m_valid (valid)
44, m_etaIdx (etaIdx), m_phiIdx (phiIdx)
45, m_etaBinWidth (etaBinWidth), m_phiBinWidth (phiBinWidth)
46, m_etaCoord (etaCoord), m_phiCoord (phiCoord)
47, m_etaMin (etaCoord-0.5*etaBinWidth)
48, m_etaMax (etaCoord+0.5*etaBinWidth)
49, m_phiMin (phiCoord-0.5*phiBinWidth)
50, m_phiMax (phiCoord+0.5*phiBinWidth)
51{
52}
53
54
55//********************************************************************
56// Destructor
57//********************************************************************
60
61//********************************************************************
62// Simple comparison operator - doesn't need to
63// do everything
64//********************************************************************
65bool
67 if ( m_object != rhs.m_object )
68 return false;
69 if ( m_layer != rhs.m_layer )
70 return false;
71 if ( m_valid != rhs.m_valid )
72 return false;
73 if ( m_etaIdx != rhs.m_etaIdx )
74 return false;
75 if ( m_phiIdx != rhs.m_phiIdx )
76 return false;
77 return true;
78}
79
80
81//********************************************************************
82// objectTypeToString
83//********************************************************************
88
89 std::string object;
90 switch ( this->getObjectType() ) {
91 case PPM: object = "PPM"; break;
92 case CPM: object = "CPM"; break;
93 case JEM: object = "JEM"; break;
94 case EFEX: object = "EFEX"; break;
95 case JFEX: object = "JFEX"; break;
96 case GFEX: object = "GFEX"; break;
97 case NONE: object = "NONE"; break;
98 }
99
100 return object;
101}
102
103
104//********************************************************************
105// layerToString
106//********************************************************************
111
112 std::string layer;
113 switch ( this->getLayer() ) {
114 case Electromagnetic: layer = "Electromagnetic"; break;
115 case Hadronic: layer = "Hadronic"; break;
116 case HadFcal2: layer = "HadFcal2"; break;
117 case HadFcal3: layer = "HadFcal3"; break;
118 case Presampler: layer = "Presampler"; break;
119 case Front: layer = "Front"; break;
120 case Middle: layer = "Middle"; break;
121 case Back: layer = "Back"; break;
122 case Both: layer = "Both"; break;
123 case None: layer = "None"; break;
124 }
125
126 return layer;
127}
128
129
130//********************************************************************
131// getCaloDivision
132//********************************************************************
142 if (this->getLayer() == Electromagnetic) {
143 if (m_etaIdx < -32) { part = CaloDivision::LArFCAL1C; }
144 else if (m_etaIdx < -15) { part = CaloDivision::LArEMECC; }
145 else if (m_etaIdx < -14) { part = CaloDivision::LArOverlapC; }
146 else if (m_etaIdx < 0) { part = CaloDivision::LArEMBC; }
147 else if (m_etaIdx < 14) { part = CaloDivision::LArEMBA; }
148 else if (m_etaIdx < 15) { part = CaloDivision::LArOverlapA; }
149 else if (m_etaIdx < 32) { part = CaloDivision::LArEMECA; }
150 else { part = CaloDivision::LArFCAL1A; }
151 }
152 else {
153 if (m_etaIdx < -32) { part = CaloDivision::LArFCAL23C; }
154 else if (m_etaIdx < -15) { part = CaloDivision::LArHECC; }
155 else if (m_etaIdx < -9) { part = CaloDivision::TileEBC; }
156 else if (m_etaIdx < 0) { part = CaloDivision::TileLBC; }
157 else if (m_etaIdx < 9) { part = CaloDivision::TileLBA; }
158 else if (m_etaIdx < 15) { part = CaloDivision::TileEBA; }
159 else if (m_etaIdx < 32) { part = CaloDivision::LArHECA; }
160 else { part = CaloDivision::LArFCAL23A; }
161 }
162 return part;
163}
164
165
166//********************************************************************
167// getEtaLetterBit
168//********************************************************************
180 unsigned int bit = 16; // Invalid
181 if (m_etaIdx < -29) { bit = 0; }
182 else if (m_etaIdx < -24) { bit = 1; }
183 else if (m_etaIdx >= 29) { bit = 15; }
184 else if (m_etaIdx >= 24) { bit = 14; }
185 else { bit = ((m_etaIdx + 24) / 4) + 2; }
186 return bit;
187}
188
189
190//********************************************************************
191// getPhiLetterBit
192//********************************************************************
199 unsigned int bit = 16; // Invalid
200 if (m_phiIdx >= 0 && m_phiIdx < 64) { bit = m_phiIdx / 4; }
201 return bit;
202}
203
204
205//********************************************************************
206// isDisabled
207//********************************************************************
214bool L1CaloDetectorRegion::isDisabled(unsigned int caloDivisionsDisabled,
215 unsigned int etaLetterBitsDisabled,
216 unsigned int phiLetterBitsDisabled) const {
217
218 unsigned int caloBit = this->getCaloDivision().getEnum();
219 unsigned int etaBit = this->getEtaLetterBit();
220 unsigned int phiBit = this->getPhiLetterBit();
221 bool ret = (((1 << caloBit) & caloDivisionsDisabled) != 0) ||
222 (((1 << etaBit) & etaLetterBitsDisabled) != 0) ||
223 (((1 << phiBit) & phiLetterBitsDisabled) != 0);
224 return ret;
225}
226
227
228//********************************************************************
229// isCaloDisabled
230//********************************************************************
235bool L1CaloDetectorRegion::isCaloDisabled(unsigned int caloDivisionsDisabled) const {
236
237 unsigned int caloBit = this->getCaloDivision().getEnum();
238 bool ret = (((1 << caloBit) & caloDivisionsDisabled) != 0);
239 return ret;
240}
241
242
243//********************************************************************
244// isEtaPhiDisabled
245//********************************************************************
251bool L1CaloDetectorRegion::isEtaPhiDisabled(unsigned int etaLetterBitsDisabled,
252 unsigned int phiLetterBitsDisabled) const {
253
254 unsigned int etaBit = this->getEtaLetterBit();
255 unsigned int phiBit = this->getPhiLetterBit();
256 bool ret = (((1 << etaBit) & etaLetterBitsDisabled) != 0) ||
257 (((1 << phiBit) & phiLetterBitsDisabled) != 0);
258 return ret;
259}
260
261
262//********************************************************************
263// printInfo
264//********************************************************************
269
270 std::cout << "Region Object Type: " << objectTypeToString()
271 << " Layer: " << layerToString() << std::endl;
272 std::cout << " Valid Channel: "
273 << (getValidity() ? "yes" : "no") << std::endl;
274
275 if (m_valid) {
276 std::cout << " EtaIndex: " << getEtaIndex()
277 << " PhiIndex: " << getPhiIndex() << std::endl;
278 std::cout << " EtaBinWidth: " << getEtaBinWidth()
279 << " PhiBinWidth: " << getPhiBinWidth() << std::endl;
280 std::cout << " EtaCoordinate: " << getEtaCoordinate()
281 << " PhiCoordinate: " << getPhiCoordinate() << std::endl;
282 }
283
284 std::cout << std::endl;
285}
CaloDivisionEnum getEnum() const
void printInfo()
Print the content of the L1CaloDetectorRegion object.
double m_etaMin
lower eta bounds of tower
CaloDivision getCaloDivision() const
Method to return the calorimeter partition for this region.
double getEtaCoordinate() const
ObjectTypeEnum getObjectType() const
double m_phiMax
upper phi bounds of tower
bool isEtaPhiDisabled(unsigned int etaLetterBitsDisabled, unsigned int phiLetterBitsDisabled) const
Method to check this region against patterns of disabled areas: etaDisabled bit pattern of disabled s...
std::string layerToString()
Method to convert the enumerated type 'layer' to string.
unsigned int getPhiLetterBit() const
Method to return the bit number of the phi "letter".
bool m_valid
validity of the mapped channel
double m_etaBinWidth
eta granularity
LayerTypeEnum getLayer() const
unsigned int getEtaLetterBit() const
Method to return the bit number of the eta "letter".
double m_etaCoord
eta coordinate of the trigger tower
double m_phiMin
lower phi bounds of tower
bool operator==(const L1CaloDetectorRegion &rhs)
std::string objectTypeToString()
Method to convert the enumerated type 'object' to string.
double m_phiCoord
phi coordinate of the trigger tower
double m_etaMax
upper eta bounds of tower
bool isCaloDisabled(unsigned int caloDivisionsDisabled) const
Method to check this region against patterns of disabled areas: caloDisabled bit pattern of disabled ...
double m_phiBinWidth
phi granularity
bool isDisabled(unsigned int caloDivisionsDisabled, unsigned int etaLetterBitsDisabled, unsigned int phiLetterBitsDisabled) const
Method to check this region against patterns of disabled areas: caloDisabled bit pattern of disabled ...
double getPhiCoordinate() const