ATLAS Offline Software
Loading...
Searching...
No Matches
HECCell.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_HECCELL_H
6#define LARREADOUTGEOMETRY_HECCELL_H
7
9#include "GeoModelKernel/CellBinning.h"
10#include "GeoModelKernel/RCBase.h"
11#include "LArHV/HECHVSubgap.h"
13#include <mutex>
14
29
30class HECCell : public RCBase
31{
32 public:
33
34 typedef enum {FRONT,CENTER,BACK} CELLPOS;
35
36
40 HECCell (unsigned int endcap, const HECDetDescr *hecDescriptor, unsigned int eta, unsigned int phi);
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 unsigned int getNumBlocks () const;
71
80 unsigned int getBlockIndex (unsigned int block) const;
81
85 double getZMin (unsigned int block) const;
86
90 double getZMax (unsigned int block) const;
91
97 double getPhiLocalLower () const;
98
104 double getPhiLocalUpper () const;
105
109 double getPhiMinNominal() const;
110
114 double getPhiMaxNominal() const;
115
119 double getEtaMinNominal () const;
120
124 double getEtaMaxNominal () const;
125
129 double getZLocal (CELLPOS position) const;
130
134 double getRMinLocalNominal (CELLPOS position) const;
135
139 double getRMaxLocalNominal (CELLPOS position) const;
140
144 double getRMin (unsigned int block) const;
145
149 double getRMax (unsigned int block) const;
150
154 const HECDetDescr * getDescriptor () const;
155
160 bool occupiesBlock (unsigned int block) const;
161
165 unsigned int getNumSubgaps() const;
166
170 const HECHVSubgap& getSubgap (unsigned int i) const;
171
172
173
174 private:
175
176 HECCell(const HECCell &right);
177
178 virtual ~HECCell();
179
180 HECCell & operator=(const HECCell &right);
181
188
192 unsigned int m_clockwork;
193
198
202 friend class ImaginaryFriend;
203
204 const std::vector<const HECHVSubgap*>& getSubgaps() const;
205 void initHV (std::vector<const HECHVSubgap*>& subgaps) const;
206};
207
208
209
210
211
212inline HECCell::HECCell (unsigned int endcap, const HECDetDescr *hecDescriptor, unsigned int eta, unsigned int phi)
213
214
215
216 :m_hecDetDescr(hecDescriptor),m_clockwork(phi | (eta<<6) | (endcap <<10))
217
218{
219
220
221}
222
223
224
225
226inline unsigned int HECCell::getPhiIndex () const
227{
228
229 return m_clockwork & 0x0000003F;
230
231}
232
233inline unsigned int HECCell::getEndcapIndex () const
234{
235
236 return (m_clockwork & 0x00000400) >> 10;
237
238}
239
240inline unsigned int HECCell::getEtaIndex () const
241{
242
243 // 4 Bits for eta:
244 return (m_clockwork & 0x000003C0) >> 6;
245
246}
247
248inline unsigned int HECCell::getSamplingIndex () const
249{
250
252
253}
254
255inline unsigned int HECCell::getRegionIndex () const
256{
257
258 return getDescriptor()->getRegionIndex();
259
260}
261
262inline unsigned int HECCell::getNumBlocks () const
263{
264
265 return getDescriptor()->getNumBlocks();
266
267}
268
269inline unsigned int HECCell::getBlockIndex (unsigned int block) const
270{
271
272 return getDescriptor()->getBlockIndex(block);
273
274}
275
276inline double HECCell::getZMin (unsigned int block) const
277{
278
279 return getDescriptor()->getZMin(block);
280
281}
282
283inline double HECCell::getZMax (unsigned int block) const
284{
285
286 return getDescriptor()->getZMax(block);
287
288}
289
290inline double HECCell::getPhiLocalLower () const
291{
292
293 return getDescriptor()->getPhiBinning().binLower(getPhiIndex());
294
295}
296
297inline double HECCell::getPhiLocalUpper () const
298{
299
300 return getDescriptor()->getPhiBinning().binUpper(getPhiIndex());
301
302}
303
304inline double HECCell::getEtaMinNominal () const
305{
306
307 return getDescriptor()->getEtaBinning().binLower(getEtaIndex());
308
309}
310
311inline double HECCell::getEtaMaxNominal () const
312{
313
314 return getDescriptor()->getEtaBinning().binUpper(getEtaIndex());
315
316}
317
318inline double HECCell::getZLocal (CELLPOS position) const
319{
320
321 switch (position) {
322 case FRONT:
323 return getZMin(0);
324 case CENTER:
325 return (getZLocal(FRONT) + getZLocal(BACK))/2.0;
326 case BACK:
327 return getZMax(getNumBlocks()-1);
328 default :
329 return 0;
330 };
331
332}
333
334inline double HECCell::getRMinLocalNominal (CELLPOS position) const
335{
336 bool hec2 = getSamplingIndex() > 1;
337 if (hec2) {
338 return (getDescriptor()->getManager()->getFocalToRef2() + getZLocal(position))/sinh(getEtaMaxNominal());
339 }
340 else {
341 return (getDescriptor()->getManager()->getFocalToRef1() + getZLocal(position))/sinh(getEtaMaxNominal());
342 }
343
344}
345
346inline double HECCell::getRMaxLocalNominal (CELLPOS position) const
347{
348 bool hec2 = getSamplingIndex() > 1;
349 if (hec2) {
350 return (getDescriptor()->getManager()->getFocalToRef2() + getZLocal(position))/sinh(getEtaMinNominal());
351 }
352 else {
353 return (getDescriptor()->getManager()->getFocalToRef1() + getZLocal(position))/sinh(getEtaMinNominal());
354 }
355
356}
357
358inline double HECCell::getRMin (unsigned int block) const
359{
360
361 return getDescriptor()->getRMin(block,getEtaIndex());
362
363}
364
365inline double HECCell::getRMax (unsigned int block) const
366{
367
368 return getDescriptor()->getRMax(block,getEtaIndex());
369
370}
371
372inline const HECDetDescr * HECCell::getDescriptor () const
373{
374
375 return m_hecDetDescr;
376
377}
378
379inline bool HECCell::occupiesBlock (unsigned int block) const
380{
381
382 return getDescriptor()->getRadialSegment(block,getEtaIndex())!=NULL;
383
384}
385
386
387inline double HECCell::getPhiMinNominal () const
388{
390}
391
392inline double HECCell::getPhiMaxNominal () const
393{
395}
396
397
398
399#endif
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Cached value with atomic update.
Cached value with atomic update.
Definition CachedValue.h:55
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition HECCell.h:392
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition HECCell.h:387
HECCell & operator=(const HECCell &right)
unsigned int getBlockIndex(unsigned int block) const
The block index of cell i.
Definition HECCell.h:269
double getZMax(unsigned int block) const
Maximum Z of block i.
Definition HECCell.h:283
HECCell(unsigned int endcap, const HECDetDescr *hecDescriptor, unsigned int eta, unsigned int phi)
Constructor.
Definition HECCell.h:212
double getZLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition HECCell.h:318
bool occupiesBlock(unsigned int block) const
Returns true if the cell occupies (or overlaps) this longitudinal block.
Definition HECCell.h:379
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition HECCell.h:248
double getRMin(unsigned int block) const
Minimum r of block i.
Definition HECCell.h:358
const HECDetDescr * m_hecDetDescr
Pointer to the Descriptor.
Definition HECCell.h:187
double getRMinLocalNominal(CELLPOS position) const
Nominal RMin for the cell at (FRONT,CENTER,BACK)
Definition HECCell.h:334
HECCell(const HECCell &right)
const std::vector< const HECHVSubgap * > & getSubgaps() const
Definition HECCell.cxx:24
unsigned int getEndcapIndex() const
The EndcapIndex of this Cell (0=negative, 1=positive)
Definition HECCell.h:233
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition HECCell.h:290
double getEtaMaxNominal() const
Nominal Eta Min (geometry is not projective)
Definition HECCell.h:311
virtual ~HECCell()
const HECDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition HECCell.h:372
CxxUtils::CachedValue< std::vector< const HECHVSubgap * > > m_subgaps
Cache of subgaps.
Definition HECCell.h:197
double getRMax(unsigned int block) const
Maximum r of block i.
Definition HECCell.h:365
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition HECCell.h:226
unsigned int getNumBlocks() const
The number of blocks in this cell.
Definition HECCell.h:262
unsigned int getRegionIndex() const
The region index of this cell.
Definition HECCell.h:255
double getEtaMinNominal() const
Nominal Eta Min (geometry is not projective)
Definition HECCell.h:304
unsigned int m_clockwork
Bitpacked indices.
Definition HECCell.h:192
const HECHVSubgap & getSubgap(unsigned int i) const
@Get subgap
Definition HECCell.cxx:18
unsigned int getEtaIndex() const
The eta index of this cell.
Definition HECCell.h:240
void initHV(std::vector< const HECHVSubgap * > &subgaps) const
Definition HECCell.cxx:35
friend class ImaginaryFriend
Additional Implementation Declarations.
Definition HECCell.h:202
double getPhiLocalUpper() const
Gets the phi value at the "upper" edge of the cell.
Definition HECCell.h:297
double getRMaxLocalNominal(CELLPOS position) const
Nominal RMax for the cell at (FRONT,CENTER,BACK)
Definition HECCell.h:346
double getZMin(unsigned int block) const
Minimum Z of Block i.
Definition HECCell.h:276
@ BACK
Definition HECCell.h:34
@ FRONT
Definition HECCell.h:34
@ CENTER
Definition HECCell.h:34
unsigned int getNumSubgaps() const
@Get num subgaps
Definition HECCell.cxx:14
Descriptor for regions of the hadronic endcap calorimeter.
Definition HECDetDescr.h:30
unsigned int getBlockIndex(unsigned int block) const
Gets the block index for the ith block (in case it is ever needed).
unsigned int getSamplingIndex() const
The sampling index.
double getRMax(unsigned int block, unsigned int eta) const
Returns max r at block i.
double getZMax(unsigned int block) const
Returns max z for the ith block at eta index.
unsigned int getNumBlocks() const
Number of blocks in the region.
const HECRadialSegment * getRadialSegment(unsigned int block, unsigned int eta) const
Returns the radial segment of in block b with eta index i, or else NULL.
double getRMin(unsigned int block, unsigned int eta) const
Returns min r for block i.
const CellBinning & getPhiBinning() const
The Binning in Phi.
double getZMin(unsigned int block) const
Returns min z for the ith block at eta index.
unsigned int getRegionIndex() const
The region Index.
const CellBinning & getEtaBinning() const
The Binning in Eta.