ATLAS Offline Software
L1CaloDetectorRegion.cxx
Go to the documentation of this file.
3 
4 #include <iostream>
5 
15 //********************************************************************
16 // Constructor
17 //********************************************************************
19 : m_object (NONE), m_layer (None)
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 //********************************************************************
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 //********************************************************************
59 }
60 
61 //********************************************************************
62 // Simple comparison operator - doesn't need to
63 // do everything
64 //********************************************************************
65 bool
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 //********************************************************************
214 bool 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 //********************************************************************
235 bool 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 //********************************************************************
251 bool 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 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
CaloDivision::LArEMBA
@ LArEMBA
Definition: CaloDivision.h:23
NONE
@ NONE
Definition: sTGCenumeration.h:13
L1CaloDetectorRegion::objectTypeToString
std::string objectTypeToString()
Method to convert the enumerated type 'object' to string.
Definition: L1CaloDetectorRegion.cxx:87
L1CaloDetectorRegion::isEtaPhiDisabled
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...
Definition: L1CaloDetectorRegion.cxx:251
L1CaloDetectorRegion::PPM
@ PPM
Definition: L1CaloDetectorRegion.h:13
L1CaloDetectorRegion::m_phiIdx
int m_phiIdx
phi index
Definition: L1CaloDetectorRegion.h:84
CaloDivision::TileLBC
@ TileLBC
Definition: CaloDivision.h:30
L1CaloDetectorRegion::HadFcal2
@ HadFcal2
Definition: L1CaloDetectorRegion.h:25
L1CaloDetectorRegion::Front
@ Front
Definition: L1CaloDetectorRegion.h:28
L1CaloDetectorRegion::getPhiLetterBit
unsigned int getPhiLetterBit() const
Method to return the bit number of the phi "letter".
Definition: L1CaloDetectorRegion.cxx:198
L1CaloDetectorRegion::getLayer
LayerTypeEnum getLayer() const
Definition: L1CaloDetectorRegion.h:52
L1CaloDetectorRegion::NONE
@ NONE
Definition: L1CaloDetectorRegion.h:19
CaloDivision::LArEMECC
@ LArEMECC
Definition: CaloDivision.h:20
L1CaloDetectorRegion::getEtaLetterBit
unsigned int getEtaLetterBit() const
Method to return the bit number of the eta "letter".
Definition: L1CaloDetectorRegion.cxx:179
L1CaloDetectorRegion::Back
@ Back
Definition: L1CaloDetectorRegion.h:30
L1CaloDetectorRegion::isCaloDisabled
bool isCaloDisabled(unsigned int caloDivisionsDisabled) const
Method to check this region against patterns of disabled areas: caloDisabled bit pattern of disabled ...
Definition: L1CaloDetectorRegion.cxx:235
L1CaloDetectorRegion::getCaloDivision
CaloDivision getCaloDivision() const
Method to return the calorimeter partition for this region.
Definition: L1CaloDetectorRegion.cxx:140
L1CaloDetectorRegion::layerToString
std::string layerToString()
Method to convert the enumerated type 'layer' to string.
Definition: L1CaloDetectorRegion.cxx:110
L1CaloDetectorRegion::Presampler
@ Presampler
Definition: L1CaloDetectorRegion.h:27
CaloDivision::LArOverlapA
@ LArOverlapA
Definition: CaloDivision.h:24
L1CaloDetectorRegion::getValidity
bool getValidity() const
Definition: L1CaloDetectorRegion.h:50
L1CaloDetectorRegion::LayerTypeEnum
LayerTypeEnum
Definition: L1CaloDetectorRegion.h:22
L1CaloDetectorRegion::getEtaCoordinate
double getEtaCoordinate() const
Definition: L1CaloDetectorRegion.h:48
L1CaloDetectorRegion::GFEX
@ GFEX
Definition: L1CaloDetectorRegion.h:18
L1CaloDetectorRegion::Hadronic
@ Hadronic
Definition: L1CaloDetectorRegion.h:24
L1CaloDetectorRegion::operator==
bool operator==(const L1CaloDetectorRegion &rhs)
Definition: L1CaloDetectorRegion.cxx:66
CaloDivision::LArFCAL1C
@ LArFCAL1C
Definition: CaloDivision.h:19
L1CaloDetectorRegion::m_valid
bool m_valid
validity of the mapped channel
Definition: L1CaloDetectorRegion.h:80
L1CaloDetectorRegion::getPhiBinWidth
double getPhiBinWidth() const
Definition: L1CaloDetectorRegion.h:47
CaloDivision::LArEMBC
@ LArEMBC
Definition: CaloDivision.h:22
CaloDivision::TileEBC
@ TileEBC
Definition: CaloDivision.h:29
L1CaloDetectorRegion::None
@ None
Definition: L1CaloDetectorRegion.h:32
L1CaloDetectorRegion::m_object
ObjectTypeEnum m_object
Definition: L1CaloDetectorRegion.h:78
L1CaloDetectorRegion::~L1CaloDetectorRegion
~L1CaloDetectorRegion()
Definition: L1CaloDetectorRegion.cxx:58
L1CaloDetectorRegion::JEM
@ JEM
Definition: L1CaloDetectorRegion.h:15
L1CaloDetectorRegion::EFEX
@ EFEX
Definition: L1CaloDetectorRegion.h:16
calibdata.valid
list valid
Definition: calibdata.py:45
CaloDivision::LArHECC
@ LArHECC
Definition: CaloDivision.h:28
CaloCellPos2Ntuple.None
None
Definition: CaloCellPos2Ntuple.py:23
L1CaloDetectorRegion::Electromagnetic
@ Electromagnetic
Definition: L1CaloDetectorRegion.h:23
CaloDivision::TileLBA
@ TileLBA
Definition: CaloDivision.h:31
L1CaloDetectorRegion::getEtaBinWidth
double getEtaBinWidth() const
Definition: L1CaloDetectorRegion.h:46
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
CaloDivision::LArEMECA
@ LArEMECA
Definition: CaloDivision.h:25
CaloDivision::TileEBA
@ TileEBA
Definition: CaloDivision.h:32
L1CaloDetectorRegion::L1CaloDetectorRegion
L1CaloDetectorRegion()
Definition: L1CaloDetectorRegion.cxx:18
L1CaloDetectorRegion::isDisabled
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 ...
Definition: L1CaloDetectorRegion.cxx:214
L1CaloDetectorRegion.h
L1CaloDetectorRegion::CPM
@ CPM
Definition: L1CaloDetectorRegion.h:14
L1CaloDetectorRegion::getEtaIndex
int getEtaIndex() const
Definition: L1CaloDetectorRegion.h:44
CaloDivision::getEnum
CaloDivisionEnum getEnum() const
Definition: CaloDivision.h:55
L1CaloDetectorRegion::ObjectTypeEnum
ObjectTypeEnum
Definition: L1CaloDetectorRegion.h:12
CaloDivision::LArOverlapC
@ LArOverlapC
Definition: CaloDivision.h:21
L1CaloDetectorRegion
Definition: L1CaloDetectorRegion.h:8
L1CaloDetectorRegion::getObjectType
ObjectTypeEnum getObjectType() const
Definition: L1CaloDetectorRegion.h:51
L1CaloDetectorRegion::getPhiIndex
int getPhiIndex() const
Definition: L1CaloDetectorRegion.h:45
L1CaloDetectorRegion::HadFcal3
@ HadFcal3
Definition: L1CaloDetectorRegion.h:26
L1CaloDetectorRegion::m_layer
LayerTypeEnum m_layer
Definition: L1CaloDetectorRegion.h:79
CaloDivision.h
L1CaloDetectorRegion::printInfo
void printInfo()
Print the content of the L1CaloDetectorRegion object.
Definition: L1CaloDetectorRegion.cxx:268
L1CaloDetectorRegion::Both
@ Both
Definition: L1CaloDetectorRegion.h:31
CaloDivision::LArFCAL23C
@ LArFCAL23C
Definition: CaloDivision.h:27
L1CaloDetectorRegion::getPhiCoordinate
double getPhiCoordinate() const
Definition: L1CaloDetectorRegion.h:49
pickleTool.object
object
Definition: pickleTool.py:30
L1CaloDetectorRegion::Middle
@ Middle
Definition: L1CaloDetectorRegion.h:29
CaloDivision
Definition: CaloDivision.h:14
CaloDivision::LArFCAL1A
@ LArFCAL1A
Definition: CaloDivision.h:26
L1CaloDetectorRegion::m_etaIdx
int m_etaIdx
eta index
Definition: L1CaloDetectorRegion.h:83
CaloDivision::LArHECA
@ LArHECA
Definition: CaloDivision.h:33
CaloDivision::Invalid
@ Invalid
Definition: CaloDivision.h:35
L1CaloDetectorRegion::JFEX
@ JFEX
Definition: L1CaloDetectorRegion.h:17
CaloDivision::LArFCAL23A
@ LArFCAL23A
Definition: CaloDivision.h:34