ATLAS Offline Software
Loading...
Searching...
No Matches
EMECDetDescr.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8
9namespace {
10
11
15
16struct Boundary {
17 double min;
18 double max;
19 unsigned int nDiv;
20};
21const Boundary
22etaBoundariesEndcap[4][2][6] = {{{{1.500, 1.800, 12},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // presampler outer
23 {{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // presampler inner
24 {{{1.375, 1.425, 1},{1.425, 1.500, 3},{1.500, 1.800, 96},{1.800, 2.000, 48},{2.000, 2.400, 64},{2.400, 2.500, 4}}, // sample 1 outer
25 {{2.500, 3.200, 7},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // sample 1 inner
26 {{{1.375, 1.425, 1},{1.425, 2.5, 43},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // sample 2 outer
27 {{2.500, 3.200, 7},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}, // sample 2 inner
28 {{{1.500, 2.500, 20},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}, // sample 3 outer
29 {{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0},{0.000, 0.000, 0}}}}; // sample 3 inner
30
31
32} // anonymous namespace
33
34
36 , unsigned int sampling
37 , unsigned int region
38 , unsigned int radialPart
39 , const CellBinning &phiBinning)
40 : m_manager(detManager)
41 , m_samplingIndex(sampling)
42 , m_regionIndex(region)
43 , m_radialIndex(radialPart)
44 , m_phiBinning(phiBinning)
45 , m_etaBinning(etaBoundariesEndcap[sampling][radialPart][region].min
46 ,etaBoundariesEndcap[sampling][radialPart][region].max
47 ,etaBoundariesEndcap[sampling][radialPart][region].nDiv)
48{
49 // This contains some logic for decoding the sampling separation arrays:
50 if (sampling==0) {
51 m_halfLength.push_back(m_manager->getPresamplerFullLength()/2.0);
52 m_offset.push_back (0);
53 return;
54 }
55
56 double eta0, dEta;
57 if (m_radialIndex ==0 ) { // Outer Wheel.
58 eta0=1.4;
59 dEta=0.025;
60 }
61 else if (m_radialIndex==1) { // Inner Wheel
62 eta0=2.5;
63 dEta=0.1;
64 }
65 else {
66 throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
67 }
68
69 const double inv_dEta = 1. / dEta;
70
71 for (unsigned int i=0;i<m_etaBinning.getNumDivisions();i++) {
72 double eta = m_etaBinning.binCenter(i);
73 int ipad = int((eta - eta0) * inv_dEta);
74 double front,back;
75 if (m_radialIndex ==0 ) { // Outer Wheel.
76 if (sampling==1) {
77 front=0;
78 back = m_manager->getZSEP12(ipad)-m_manager->getFocalToRef()-m_manager->getRefToActive();
79 }
80 else if (sampling==2) {
81
82 // std::min is used to max out the length to the total active length; this is for
83 // cells that spill out the side. They will have funny volumes.
84
85 front = m_manager->getZSEP12(ipad)-m_manager->getFocalToRef()-m_manager->getRefToActive();
86 back = std::min(m_manager->getActiveLength(),m_manager->getZSEP23(ipad/2)-m_manager->getFocalToRef()-m_manager->getRefToActive());
87 }
88 else if (sampling==3) {
89 front = m_manager->getZSEP23(ipad/2)-m_manager->getFocalToRef()-m_manager->getRefToActive();
90 back = m_manager->getActiveLength();
91 }
92 else {
93 throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
94 }
95
96 }
97 else if (m_radialIndex==1) { // Inner Wheel
98 if (sampling==1) {
99 front=0;
100 back = m_manager->getZIW(ipad) - m_manager->getFocalToRef() - m_manager->getRefToActive();
101 }
102 else if (sampling==2) {
103 front = m_manager->getZIW(ipad) - m_manager->getFocalToRef() - m_manager->getRefToActive();
104 back = m_manager->getActiveLength();
105 }
106 else {
107 throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
108 }
109 }
110 else {
111 throw std::range_error("Attempt to construct EMEC DetDescr with illegal index combinations");
112 }
113 m_offset.push_back((front+back)/2.);
114 m_halfLength.push_back((back-front)/2.);
115 }
116}
117
118
120= default;
Scalar eta() const
pseudorapidity method
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
CellBinning m_phiBinning
std::vector< double > m_offset
Vector of cell center positions for the cells, one for each eta index.
~EMECDetDescr()
Destructor.
unsigned int m_regionIndex
const EMECDetectorManager * m_manager
unsigned int m_radialIndex
CellBinning m_etaBinning
std::vector< double > m_halfLength
Vector of half-lengths for the cells, one for each eta index.
EMECDetDescr(const EMECDetectorManager *detManager, unsigned int sampling, unsigned int region, unsigned int radialPart, const CellBinning &phiBinning)
Constructor.
unsigned int m_samplingIndex
A manager class providing access to readout geometry information for the electromagnetic endcap calor...