ATLAS Offline Software
Loading...
Searching...
No Matches
EMBDetDescr.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
8#include "GeoModelKernel/CellBinning.h"
9
10
11namespace {
12
13
14struct Boundary {
15 double min;
16 double max;
17 unsigned int nDiv;
18 unsigned int firstDiv;
19};
20
21const Boundary
22etaBoundariesBarrel [4][2] = {{{0.000, 1.525, 61,0},{0.000, 0.000, 0,0}}, //
23 {{0.003125, 1.400, 447,1},{1.400, 1.475, 3,0}}, //
24 {{0.000, 1.400, 56,0},{1.400, 1.475, 1,0}}, //
25 {{0.000, 1.350, 27,0},{0.000, 0.000, 0,0}}}; //
26
27} // anonymous namespace
28
29
30
31
32EMBDetDescr::EMBDetDescr (const EMBDetectorManager *detManager, unsigned int sampling, unsigned int region, const CellBinning &phiBinning)
33 :m_manager(detManager),m_samplingIndex(sampling),m_regionIndex(region),m_phiBinning(phiBinning),m_etaBinning(etaBoundariesBarrel[sampling][region].min,
34 etaBoundariesBarrel[sampling][region].max,
35 etaBoundariesBarrel[sampling][region].nDiv,
36 etaBoundariesBarrel[sampling][region].firstDiv)
37{
38
39 for (unsigned int i=0;i<m_etaBinning.getFirstDivisionNumber()+m_etaBinning.getNumDivisions();i++) {
40 if (i<m_etaBinning.getFirstDivisionNumber()) {
41 m_offset.push_back(0);
42 m_halfLength.push_back(0);
43 }
44 else {
45 double front, back;
46 switch (sampling) {
47 case 0:
48 front = m_manager->getBasicReadoutNumbers()->getPresamplerRadius();
49 back = m_manager->getBasicReadoutNumbers()->getRinAc();
50 break;
51 case 1:
52 front = m_manager->getBasicReadoutNumbers()->getRinAc();
53 back = region==0 ? m_manager->getBasicReadoutNumbers()->getEMBSamplingSepInnerRMax(i) : m_manager->getBasicReadoutNumbers()->getEMBSamplingSepInnerRMax(447);
54 break;
55 case 2:
56 front = region==0 ? m_manager->getBasicReadoutNumbers()->getEMBSamplingSepInnerRMax(std::max((unsigned int) 0,8*i+7)) : m_manager->getBasicReadoutNumbers()->getEMBSamplingSepInnerRMax(447);
57 back = m_manager->getBasicReadoutNumbers()->getRMX23(std::min((unsigned int) 52,i));
58 break;
59 case 3:
60 front = (m_manager->getBasicReadoutNumbers()->getRMX23(std::min((unsigned int)52,2*i))+m_manager->getBasicReadoutNumbers()->getRMX23(std::min((unsigned int)52,2*i+1)))/2.0;
61 back = m_manager->getBasicReadoutNumbers()->getRoutAc();
62 break;
63 default:
64 throw std::range_error("Attempt to construct EMEB DetDescr with illegal sampling index");
65
66 }
67 m_offset.push_back((front+back)/2.);
68 m_halfLength.push_back((back-front)/2.);
69 }
70 }
71}
72
73
75= default;
76
77
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
CellBinning m_phiBinning
Definition EMBDetDescr.h:97
EMBDetDescr(const EMBDetectorManager *detManager, unsigned int sampling, unsigned int region, const CellBinning &phiBinning)
Constructor.
CellBinning m_etaBinning
Definition EMBDetDescr.h:98
unsigned int m_samplingIndex
Definition EMBDetDescr.h:95
~EMBDetDescr()
Destructor.
std::vector< double > m_halfLength
Vector of half-lengths for the cells, one for each eta index.
std::vector< double > m_offset
Vector of cell center positions for the cells, one for each eta index.
unsigned int m_regionIndex
Definition EMBDetDescr.h:96
const EMBDetectorManager * m_manager
Definition EMBDetDescr.h:94
A manager class providing access to readout geometry information for the electromagnetic barrel calor...