ATLAS Offline Software
EMBCell.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_EMBCELL_H
6 #define LARREADOUTGEOMETRY_EMBCELL_H
7 
10 #include "LArHV/EMBHVElectrode.h"
11 #include "GeoModelKernel/RCBase.h"
12 #include "CxxUtils/CachedValue.h"
13 #include <cmath>
14 #include <vector>
15 
17 
30 class EMBCell : public RCBase
31 {
32  public:
33  typedef enum {FRONT,CENTER,BACK} CELLPOS;
34 
35  public:
39  EMBCell (unsigned int side, const EMBDetDescr *embDescriptor, unsigned int eta, unsigned int phi);
40 
41 
45  unsigned int getPhiIndex () const;
46 
50  unsigned int getEndcapIndex () const;
51 
55  unsigned int getEtaIndex () const;
56 
60  unsigned int getSamplingIndex () const;
61 
65  unsigned int getRegionIndex () const;
66 
70  const EMBDetDescr * getDescriptor () const;
71 
75  double getRLocal (CELLPOS position) const;
76 
80  double getZMinLocal (CELLPOS position) const;
81 
85  double getZMaxLocal (CELLPOS position) const;
86 
92  double getPhiLocalLower () const;
93 
99  double getPhiLocalUpper () const;
100 
104  double getPhiMinNominal() const;
105 
109  double getPhiMaxNominal() const;
110 
114  double getEtaMin () const;
115 
119  double getEtaMax () const;
120 
121 
127  double getPhiLocalLower (double r) const;
133  double getPhiLocalUpper (double r) const;
134 
138  unsigned int getNumElectrodes() const;
139 
143  const EMBHVElectrode & getElectrode (unsigned int i) const;
144 
148  unsigned int getNumHVPathologies ()const ;
149 
153  const EMBHVPathologiesConstLink & getHVPathologies (unsigned int i) const;
154 
159 
160 
165 
166 
167  private:
168 
169  EMBCell(const EMBCell &right);
170 
171  virtual ~EMBCell();
172 
173  EMBCell & operator=(const EMBCell &right);
174 
176 
177  struct HVInfo
178  {
179  // The cell does NOT own the pointers to its electrodes
180  std::vector<const EMBHVElectrode*> m_electrode;
182  };
184 
185  std::vector<EMBHVPathologiesConstLink> m_hvPathologies;
186 
187  unsigned int m_clockwork;
188 
189  friend class ImaginaryFriend;
190 
191  const HVInfo& getHVInfo() const;
192  void initHV (HVInfo& hvinfo) const;
193 };
194 
195 
196 // Class EMBCell
197 
198 inline EMBCell::EMBCell (unsigned int side, const EMBDetDescr *embDescriptor, unsigned int eta, unsigned int phi)
199  :m_embDetDescr(embDescriptor),m_clockwork(phi | (eta<<8) | (side <<17) )
200 {
201 }
202 
203 
204 
205 inline unsigned int EMBCell::getPhiIndex () const
206 {
207  return m_clockwork & 0x000000FF;
208 }
209 
210 inline unsigned int EMBCell::getEndcapIndex () const
211 {
212  return (m_clockwork & 0x00020000) >> 17;
213 }
214 
215 inline unsigned int EMBCell::getEtaIndex () const
216 {
217  return (m_clockwork & 0x0001FF00) >> 8;
218 }
219 
220 inline unsigned int EMBCell::getSamplingIndex () const
221 {
222  return getDescriptor()->getSamplingIndex();
223 }
224 
225 inline unsigned int EMBCell::getRegionIndex () const
226 {
227  return getDescriptor()->getRegionIndex();
228 }
229 
230 inline const EMBDetDescr * EMBCell::getDescriptor () const
231 {
232  return m_embDetDescr;
233 }
234 
235 inline double EMBCell::getRLocal (CELLPOS position) const
236 {
237  switch (position) {
238  case FRONT:
240  case CENTER:
241  return getDescriptor()->getOffset(getEtaIndex());
242  case BACK:
244  default :
245  return 0;
246  };
247 }
248 
249 inline double EMBCell::getZMinLocal (CELLPOS position) const
250 {
251  return getRLocal(position)*sinh(getEtaMin());
252 }
253 
254 inline double EMBCell::getZMaxLocal (CELLPOS position) const
255 {
256  return getRLocal(position)*sinh(getEtaMax());
257 }
258 
259 inline double EMBCell::getPhiLocalLower () const
260 {
261  return getDescriptor()->getPhiBinning().binLower(getPhiIndex());
262 }
263 
264 inline double EMBCell::getPhiLocalUpper () const
265 {
266  return getDescriptor()->getPhiBinning().binUpper(getPhiIndex());
267 }
268 
269 inline double EMBCell::getPhiMinNominal () const
270 {
272 }
273 
274 inline double EMBCell::getPhiMaxNominal () const
275 {
277 }
278 
279 inline double EMBCell::getEtaMin () const
280 {
281  return getDescriptor()->getEtaBinning().binLower(getEtaIndex());
282 }
283 
284 inline double EMBCell::getEtaMax () const
285 {
286  return getDescriptor()->getEtaBinning().binUpper(getEtaIndex());
287 }
288 
289 
290 
291 
292 #endif
EMBDetDescr
Descriptor for regions of the electromagnetic barrel calorimeter.
Definition: EMBDetDescr.h:27
beamspotman.r
def r
Definition: beamspotman.py:676
EMBCell::getHVInfo
const HVInfo & getHVInfo() const
Definition: EMBCell.cxx:40
EMBHVPathologiesConstLink
GeoIntrusivePtr< const EMBHVPathologies > EMBHVPathologiesConstLink
Definition: EMBHVPathologies.h:49
EMBHVElectrode
Definition: EMBHVElectrode.h:15
EMBCell::getPhiLocalUpper
double getPhiLocalUpper() const
Gets the phi value at the "upper" edge of a cell.
Definition: EMBCell.h:264
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
EMBCell::addHVPathologies
void addHVPathologies(const EMBHVPathologiesConstLink &)
@Add HVPathologies
Definition: EMBCell.cxx:115
EMBCell::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition: EMBCell.h:220
M_PI
#define M_PI
Definition: ActiveFraction.h:11
EMBDetDescr.h
EMBCell::getNumElectrodes
unsigned int getNumElectrodes() const
@Get num electrodes
Definition: EMBCell.cxx:27
EMBCell::getElectrode
const EMBHVElectrode & getElectrode(unsigned int i) const
@Get electrode
Definition: EMBCell.cxx:31
EMBDetDescr::getPhiBinning
const CellBinning & getPhiBinning() const
The Binning in Phi.
Definition: EMBDetDescr.h:177
EMBCell::initHV
void initHV(HVInfo &hvinfo) const
Definition: EMBCell.cxx:51
EMBHVElectrode.h
EMBCell::HVInfo
Definition: EMBCell.h:178
EMBCell::HVInfo::m_electrode
std::vector< const EMBHVElectrode * > m_electrode
Definition: EMBCell.h:180
EMBCell::getRLocal
double getRLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition: EMBCell.h:235
TRT::Hit::side
@ side
Definition: HitInfo.h:83
EMBCell::CELLPOS
CELLPOS
Definition: EMBCell.h:33
EMBCell::EMBCell
EMBCell(const EMBCell &right)
EMBCell::m_hvPathologies
std::vector< EMBHVPathologiesConstLink > m_hvPathologies
Definition: EMBCell.h:185
EMBCell::getPresamplerHVModule
const EMBPresamplerHVModule & getPresamplerHVModule() const
@Get HVModule (presampler cells)
Definition: EMBCell.cxx:35
EMBDetDescr::getHalfLength
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.
Definition: EMBDetDescr.h:146
EMBCell::getEtaIndex
unsigned int getEtaIndex() const
The eta index of this cell.
Definition: EMBCell.h:215
EMBCell
A cell of the electromagnetic barrel calorimeter readout geometry This class gives dimensions and pos...
Definition: EMBCell.h:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
CxxUtils::CachedValue
Cached value with atomic update.
Definition: CachedValue.h:55
EMBCell::ImaginaryFriend
friend class ImaginaryFriend
Definition: EMBCell.h:189
EMBCell::HVInfo::m_presamplerModule
const EMBPresamplerHVModule * m_presamplerModule
Definition: EMBCell.h:181
EMBCell::m_embDetDescr
const EMBDetDescr * m_embDetDescr
Definition: EMBCell.h:175
EMBCell::getZMinLocal
double getZMinLocal(CELLPOS position) const
RMin for the cell at (FRONT,CENTER,BACK)
Definition: EMBCell.h:249
EMBCell::getRegionIndex
unsigned int getRegionIndex() const
The region index of this cell.
Definition: EMBCell.h:225
EMBCell::getEtaMin
double getEtaMin() const
Minimum Eta.
Definition: EMBCell.h:279
EMBCell::getDescriptor
const EMBDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition: EMBCell.h:230
EMBCell::getNumHVPathologies
unsigned int getNumHVPathologies() const
@Get num HVPathologies
Definition: EMBCell.cxx:119
EMBCell::getPhiMaxNominal
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition: EMBCell.h:274
EMBHVPathologies.h
EMBCell::BACK
@ BACK
Definition: EMBCell.h:33
EMBDetDescr::getEtaBinning
const CellBinning & getEtaBinning() const
The Binning in Eta.
Definition: EMBDetDescr.h:184
CachedValue.h
Cached value with atomic update.
EMBCell::getPhiMinNominal
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition: EMBCell.h:269
EMBCell::operator=
EMBCell & operator=(const EMBCell &right)
EMBDetDescr::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: EMBDetDescr.h:138
EMBCell::getEndcapIndex
unsigned int getEndcapIndex() const
The Side Index of this Cell (0=negatiive, 1=positive)
Definition: EMBCell.h:210
EMBCell::getZMaxLocal
double getZMaxLocal(CELLPOS position) const
RMax for the cell at (FRONT,CENTER,BACK)
Definition: EMBCell.h:254
EMBDetDescr::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index.
Definition: EMBDetDescr.h:163
EMBCell::~EMBCell
virtual ~EMBCell()
EMBCell::EMBCell
EMBCell(unsigned int side, const EMBDetDescr *embDescriptor, unsigned int eta, unsigned int phi)
Constructor.
Definition: EMBCell.h:198
EMBCell::getEtaMax
double getEtaMax() const
Maximum Eta.
Definition: EMBCell.h:284
EMBCell::CENTER
@ CENTER
Definition: EMBCell.h:33
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
EMBCell::getHVPathologies
const EMBHVPathologiesConstLink & getHVPathologies(unsigned int i) const
@Get HVPathologies
Definition: EMBCell.cxx:123
EMBCell::m_hvinfo
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition: EMBCell.h:183
EMBDetDescr::getRegionIndex
unsigned int getRegionIndex() const
The region index.
Definition: EMBDetDescr.h:170
EMBCell::getPhiLocalLower
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMBCell.h:259
EMBPresamplerHVModule
Describes one HV Module within the EMB Presampler.
Definition: EMBPresamplerHVModule.h:22
EMBCell::m_clockwork
unsigned int m_clockwork
Definition: EMBCell.h:187
EMBCell::getPhiIndex
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition: EMBCell.h:205
EMBCell::FRONT
@ FRONT
Definition: EMBCell.h:33