ATLAS Offline Software
EMECCell.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARREADOUTGEOMETRY_EMECCELL_H
6 #define LARREADOUTGEOMETRY_EMECCELL_H
7 #include <iostream>
10 #include "GeoModelKernel/CellBinning.h"
11 #include "GeoModelKernel/RCBase.h"
12 #include "LArHV/EMECHVElectrode.h"
14 #include "CxxUtils/CachedValue.h"
15 
31 class EMECCell : public RCBase
32 {
33 
34  public:
35 
36  typedef enum {FRONT,CENTER,BACK} CELLPOS;
37 
41  EMECCell (unsigned int endcap, const EMECDetDescr *emecDescriptor, unsigned int eta, unsigned int phi);
42 
46  unsigned int getPhiIndex () const;
47 
51  unsigned int getEndcapIndex () const;
52 
56  unsigned int getEtaIndex () const;
57 
61  unsigned int getSamplingIndex () const;
62 
66  unsigned int getRegionIndex () const;
67 
71  unsigned int getRadialIndex () const;
72 
76  const EMECDetDescr * getDescriptor () const;
77 
81  double getZLocal (CELLPOS position) const;
82 
86  double getRMinLocal (CELLPOS position) const;
87 
91  double getRMaxLocal (CELLPOS position) const;
92 
98  double getPhiLocalLower () const;
99 
105  double getPhiLocalUpper () const;
106 
110  double getPhiMinNominal() const;
111 
115  double getPhiMaxNominal() const;
116 
120  double getEtaMin () const;
121 
125  double getEtaMax () const;
126 
127 
131  unsigned int getNumElectrodes() const;
132 
136  const EMECHVElectrode& getElectrode (unsigned int i) const;
137 
138 
143 
144  private:
145 
146  EMECCell(const EMECCell &right);
147 
148  virtual ~EMECCell();
149 
150  EMECCell & operator=(const EMECCell &right);
151  // Pointer to the Descriptor. This class responds to its
152  // interface mostly by forwarding requests to the
153  // descriptor.
154 
156 
157  struct HVInfo
158  {
159  // The cell does NOT own the pointers to its electrodes
160  std::vector<const EMECHVElectrode*> m_electrode;
162  };
164 
165  unsigned int m_clockwork;
166 
167 
168  friend class ImaginaryFriend;
169 
170  const HVInfo& getHVInfo() const;
171  void initHV (HVInfo& hvinfo) const;
172 };
173 
174 
175 
176 
177 inline EMECCell::EMECCell (unsigned int endcap, const EMECDetDescr *emecDescriptor, unsigned int eta, unsigned int phi)
178  // 8 bits are needed for phi index, 6 for eta, 1 for endcap.
179  :m_emecDetDescr(emecDescriptor),m_clockwork(phi | (eta<<8) | (endcap <<15) )
180 {
181 
182 }
183 
184 
185 
186 
187 inline unsigned int EMECCell::getPhiIndex () const
188 {
189 
190  return m_clockwork & 0x000000FF;
191 
192 }
193 
194 inline unsigned int EMECCell::getEndcapIndex () const
195 {
196 
197  return (m_clockwork & 0x00008000) >> 15;
198 
199 }
200 
201 inline unsigned int EMECCell::getEtaIndex () const
202 {
203 
204  return (m_clockwork & 0x00007F00) >> 8;
205 
206 }
207 
208 inline unsigned int EMECCell::getSamplingIndex () const
209 {
210 
211  return getDescriptor()->getSamplingIndex();
212 
213 }
214 
215 inline unsigned int EMECCell::getRegionIndex () const
216 {
217 
218  return getDescriptor()->getRegionIndex();
219 
220 }
221 
222 inline unsigned int EMECCell::getRadialIndex () const
223 {
224 
225  return getDescriptor()->getRadialIndex();
226 
227 }
228 
229 inline const EMECDetDescr * EMECCell::getDescriptor () const
230 {
231 
232  return m_emecDetDescr;
233 
234 }
235 
236 inline double EMECCell::getZLocal (CELLPOS position) const
237 {
238 
239  switch (position) {
240  case FRONT:
242  case CENTER:
243  return getDescriptor()->getOffset(getEtaIndex());
244  case BACK:
246  default :
247  return 0;
248  };
249 
250 }
251 
252 inline double EMECCell::getRMinLocal (CELLPOS position) const
253 {
254 
256  return (getDescriptor()->getManager()->getFocalToRef()+toActive+getZLocal(position))/sinh(getEtaMax());
257 
258 }
259 
260 inline double EMECCell::getRMaxLocal (CELLPOS position) const
261 {
262 
264  return (getDescriptor()->getManager()->getFocalToRef()+toActive+getZLocal(position))/sinh(getEtaMin());
265 
266 }
267 
268 inline double EMECCell::getPhiLocalLower () const
269 {
270 
271  return getDescriptor()->getPhiBinning().binLower(getPhiIndex());
272 
273 }
274 
275 inline double EMECCell::getPhiLocalUpper () const
276 {
277 
278  return getDescriptor()->getPhiBinning().binUpper(getPhiIndex());
279 
280 }
281 
282 
283 inline double EMECCell::getPhiMinNominal () const
284 {
286 }
287 
288 inline double EMECCell::getPhiMaxNominal () const
289 {
291 }
292 
293 inline double EMECCell::getEtaMin () const
294 {
295 
296  return getDescriptor()->getEtaBinning().binLower(getEtaIndex());
297 
298 }
299 
300 inline double EMECCell::getEtaMax () const
301 {
302 
303  return getDescriptor()->getEtaBinning().binUpper(getEtaIndex());
304 
305 }
306 
307 
308 #endif
EMECDetDescr::getManager
const EMECDetectorManager * getManager() const
The manager.
Definition: EMECDetDescr.h:142
EMECCell::getElectrode
const EMECHVElectrode & getElectrode(unsigned int i) const
@Get electrode
Definition: EMECCell.cxx:21
EMECDetDescr::getOffset
double getOffset(unsigned int etaIndex) const
Gets the offset position (cell centers with respect to the position of the front of the active volume...
Definition: EMECDetDescr.h:124
EMECCell::getRMaxLocal
double getRMaxLocal(CELLPOS position) const
RMax for the cell at (FRONT,CENTER,BACK)
Definition: EMECCell.h:260
EMECHVElectrode.h
EMECCell::getPhiMaxNominal
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition: EMECCell.h:288
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
EMECCell::getPhiIndex
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition: EMECCell.h:187
EMECCell::HVInfo::m_electrode
std::vector< const EMECHVElectrode * > m_electrode
Definition: EMECCell.h:160
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
EMECDetectorManager.h
EMECDetDescr::getPhiBinning
const CellBinning & getPhiBinning() const
The Binning in Phi.
Definition: EMECDetDescr.h:170
EMECCell::getNumElectrodes
unsigned int getNumElectrodes() const
@Get num electrodes
Definition: EMECCell.cxx:17
M_PI
#define M_PI
Definition: ActiveFraction.h:11
EMECCell::ImaginaryFriend
friend class ImaginaryFriend
Definition: EMECCell.h:168
EMECCell
A Cell of the electromagnetic endcap calorimeter readout geometry This class represents a single EMEC...
Definition: EMECCell.h:32
EMECCell::m_hvinfo
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition: EMECCell.h:163
EMECCell::getRMinLocal
double getRMinLocal(CELLPOS position) const
RMin for the cell at (FRONT,CENTER,BACK)
Definition: EMECCell.h:252
EMECCell::getRegionIndex
unsigned int getRegionIndex() const
The region index of this cell.
Definition: EMECCell.h:215
EMECCell::getEtaMin
double getEtaMin() const
Minimum Eta.
Definition: EMECCell.h:293
EMECCell::m_clockwork
unsigned int m_clockwork
Definition: EMECCell.h:165
EMECCell::getDescriptor
const EMECDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition: EMECCell.h:229
EMECDetDescr
Descriptor for regions of the electromagnetic endcap calorimeter.
Definition: EMECDetDescr.h:27
EMECCell::FRONT
@ FRONT
Definition: EMECCell.h:36
EMECCell::getEndcapIndex
unsigned int getEndcapIndex() const
The EndcapIndex of this Cell (0=negatiive, 1=positive)
Definition: EMECCell.h:194
EMECCell::operator=
EMECCell & operator=(const EMECCell &right)
EMECPresamplerHVModule.h
EMECCell::~EMECCell
virtual ~EMECCell()
EMECDetDescr::getHalfLength
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.
Definition: EMECDetDescr.h:132
EMECDetectorManager::getRefToPresampler
double getRefToPresampler() const
This provides the distance in CLHEP::mm from the Active Endcap Presampler volume (center) to the refe...
Definition: EMECDetectorManager.h:306
EMECCell::CENTER
@ CENTER
Definition: EMECCell.h:36
EMECCell::getPhiLocalUpper
double getPhiLocalUpper() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMECCell.h:275
lumiFormat.i
int i
Definition: lumiFormat.py:85
EMECCell::BACK
@ BACK
Definition: EMECCell.h:36
CxxUtils::CachedValue
Cached value with atomic update.
Definition: CachedValue.h:55
EMECCell::getHVInfo
const HVInfo & getHVInfo() const
Definition: EMECCell.cxx:30
EMECCell::getRadialIndex
unsigned int getRadialIndex() const
The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).
Definition: EMECCell.h:222
EMECDetectorManager::getRefToActive
double getRefToActive() const
This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.
Definition: EMECDetectorManager.h:292
EMECCell::m_emecDetDescr
const EMECDetDescr * m_emecDetDescr
Definition: EMECCell.h:155
EMECDetDescr::getRegionIndex
unsigned int getRegionIndex() const
The region index.
Definition: EMECDetDescr.h:156
EMECDetDescr::getEtaBinning
const CellBinning & getEtaBinning() const
The Binning in Eta.
Definition: EMECDetDescr.h:177
EMECCell::HVInfo
Definition: EMECCell.h:158
CachedValue.h
Cached value with atomic update.
EMECCell::HVInfo::m_presamplerModule
const EMECPresamplerHVModule * m_presamplerModule
Definition: EMECCell.h:161
EMECDetDescr.h
EMECDetDescr::getRadialIndex
unsigned int getRadialIndex() const
The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).
Definition: EMECDetDescr.h:163
EMECCell::getEtaIndex
unsigned int getEtaIndex() const
The eta index of this cell.
Definition: EMECCell.h:201
EMECCell::CELLPOS
CELLPOS
Definition: EMECCell.h:36
EMECCell::getPresamplerHVModule
const EMECPresamplerHVModule & getPresamplerHVModule() const
@Get HVModule (presampler cells)
Definition: EMECCell.cxx:25
EMECCell::EMECCell
EMECCell(const EMECCell &right)
EMECDetDescr::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index.
Definition: EMECDetDescr.h:149
EMECPresamplerHVModule
Describes one HV Module within the EMEc Presampler.
Definition: EMECPresamplerHVModule.h:22
EMECCell::getEtaMax
double getEtaMax() const
Maximum Eta.
Definition: EMECCell.h:300
EMECHVElectrode
Definition: EMECHVElectrode.h:15
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
EMECCell::initHV
void initHV(HVInfo &hvinfo) const
Definition: EMECCell.cxx:41
EMECCell::getPhiLocalLower
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMECCell.h:268
EMECCell::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition: EMECCell.h:208
EMECCell::getZLocal
double getZLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition: EMECCell.h:236
EMECCell::EMECCell
EMECCell(unsigned int endcap, const EMECDetDescr *emecDescriptor, unsigned int eta, unsigned int phi)
Constructor.
Definition: EMECCell.h:177
EMECCell::getPhiMinNominal
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition: EMECCell.h:283