ATLAS Offline Software
Loading...
Searching...
No Matches
eflowDepthCalculator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6
7NAME: eflowDepthCalculator.h
8PACKAGE: offline/Reconstruction/eflowRec
9
10AUTHORS: M.Hodgkinson, R Duxfield (based on R.Duxfields Root package)
11CREATED: 18th Aug, 2005
12
13********************************************************************/
14
15//Athena Headers
18#include "GaudiKernel/SystemOfUnits.h"
19
20//C++ Headers
21#include <cmath>
22
23
24
25
26// maps layer index to element containing depth to end of that layer
28
29// gaps, dead regions etc. in interaction lengths
30const double eflowDepthCalculator::m_preEMBat0eta = 0.5793; // fit to TDR diagram
31const double eflowDepthCalculator::m_cryostatAt0eta = 0.4666; // fit to TDR diagram
32const double eflowDepthCalculator::m_LArGap = 0.4;
33const double eflowDepthCalculator::m_preEMEat19eta = 0.5; // '' '' '' '' ''
34const double eflowDepthCalculator::m_preHEC = 0.4; // '' '' '' '' ''
35const double eflowDepthCalculator::m_preFCAL = 0.5;
36const double eflowDepthCalculator::m_tileGapAt1eta = 0.5; // a fudge (approx fit to TDR diagram)
37const double eflowDepthCalculator::m_inclusivePreTileExt = 3.9603; // a fudge (approx fit to TDR diagram)
38
39// no. interaction lengths per m in LAr and tile
40const double eflowDepthCalculator::m_EMBlambdaPerUnitLength = 2.5189 / Gaudi::Units::meter;
41const double eflowDepthCalculator::m_tileLambdaPerUnitLength = 4.9979 / Gaudi::Units::meter;
42
43const double eflowDepthCalculator::m_fcalLambdaPerUnitLength[3] = {27.5/(0.45*Gaudi::Units::meter),91.3/(0.45*Gaudi::Units::meter),89.2/(0.45*Gaudi::Units::meter)};
44
45// EMB geometry in (r, z)
46const double eflowDepthCalculator::m_EMBlayerR[4] = {1.5*Gaudi::Units::meter, 1.586*Gaudi::Units::meter, 1.93*Gaudi::Units::meter, 1.96*Gaudi::Units::meter}; // layer boundaries
47const double eflowDepthCalculator::m_EMBzMin = 0.0*Gaudi::Units::meter;
48const double eflowDepthCalculator::m_EMBzMax = 3.15*Gaudi::Units::meter;
49
50// EME geometry in (r, z)
51const double eflowDepthCalculator::m_EMErMin = 0.33*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
52const double eflowDepthCalculator::m_EMErMax = 1.96*Gaudi::Units::meter; //
53const double eflowDepthCalculator::m_EMElayerZ[4] = { 3.55*Gaudi::Units::meter, 3.65*Gaudi::Units::meter, 3.95*Gaudi::Units::meter, 4.08*Gaudi::Units::meter }; // TOTAL GUESS !!!!!
54
55// HEC geometry in (r, z)
56const double eflowDepthCalculator::m_HECrMin = 0.50*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
57const double eflowDepthCalculator::m_HECrMax = 1.96*Gaudi::Units::meter; //
58const double eflowDepthCalculator::m_HEClayerZ[5] = { 4.14*Gaudi::Units::meter, 4.61*Gaudi::Units::meter, 5.08*Gaudi::Units::meter, 5.55*Gaudi::Units::meter, 6.00*Gaudi::Units::meter }; // TOTAL GUESS !!!!!
59
60// FCAL geometry in (r, z)
61const double eflowDepthCalculator::m_FCALrMin = 0.6*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
62const double eflowDepthCalculator::m_FCALrMax = 0.45*Gaudi::Units::meter; //
63const double eflowDepthCalculator::m_FCALlayerZ[4] = { 4.71*Gaudi::Units::meter, (4.71+.45)*Gaudi::Units::meter, (4.71+2*.45)*Gaudi::Units::meter, (4.71+3*.45)*Gaudi::Units::meter }; // TOTAL GUESS !!!!!
64
65// tile barrel geometry in (r, z)
66const double eflowDepthCalculator::m_tileBarLayerR[4] = {2.3*Gaudi::Units::meter, 2.6*Gaudi::Units::meter, 3.44*Gaudi::Units::meter, 3.82*Gaudi::Units::meter};
67const double eflowDepthCalculator::m_tileBarZmin = 0.0*Gaudi::Units::meter;
68const double eflowDepthCalculator::m_tileBarZmax = 2.82*Gaudi::Units::meter;
69
70// tile ext. geometry in (r, z)
71const double eflowDepthCalculator::m_tileExtLayerR[4] = {2.3*Gaudi::Units::meter, 2.6*Gaudi::Units::meter, 3.14*Gaudi::Units::meter, 3.82*Gaudi::Units::meter};
72const double eflowDepthCalculator::m_tileExtZmin = 3.42*Gaudi::Units::meter; // ??
73const double eflowDepthCalculator::m_tileExtZmax = 6.33*Gaudi::Units::meter;
74
75// ITC1 geometry in (r, z)
76const double eflowDepthCalculator::m_itc1Zmin = 3.34*Gaudi::Units::meter;
77const double eflowDepthCalculator::m_itc1Zmax = 3.42*Gaudi::Units::meter;
78const double eflowDepthCalculator::m_itc1Rmin = 2.99*Gaudi::Units::meter;
79const double eflowDepthCalculator::m_itc1Rmax = 3.44*Gaudi::Units::meter;
80
81// ITC2 geometry in (r, z)
82const double eflowDepthCalculator::m_itc2Zmin = 3.17*Gaudi::Units::meter;
83const double eflowDepthCalculator::m_itc2Zmax = 3.42*Gaudi::Units::meter;
84const double eflowDepthCalculator::m_itc2Rmin = 3.44*Gaudi::Units::meter;
85const double eflowDepthCalculator::m_itc2Rmax = 3.82*Gaudi::Units::meter;
86
87
89
90 //initialize the array
91 for (int i = 0; i <= m_nDepth; i++) m_layerDepth[i] = 0.0;
92
93}
94
95
97{
98 if (eflowCalo::Unknown == layer)
99 return Unknown;
100 else
101 return m_layerDepthMap[layer];
102}
103
104
105
106
107// returns the length of a track at a given theta trough a box in (r, z)
108
109double eflowDepthCalculator::lengthThroughBox(double theta, double zMin, double zMax, double rMin, double rMax)
110{
111 double thetaTopLeft, thetaBottomLeft, thetaTopRight, thetaBottomRight;
112
113
114 if (0.0 == zMin) {
115 thetaTopLeft = M_PI / 2.0;
116 thetaBottomLeft = M_PI / 2.0;
117 }
118 else {
119 thetaTopLeft = atan(rMax / zMin);
120 thetaBottomLeft = atan(rMin / zMin);
121 }
122 thetaBottomRight = atan(rMin / zMax);
123 thetaTopRight = atan(rMax / zMax);
124
125
126 if (theta > thetaTopLeft || theta <= thetaBottomRight) {
127
128 return 0.0;
129 }
130 else if (theta > thetaBottomLeft) {
131
132 if (theta <= thetaTopRight)
133 return (zMax - zMin) / cos(theta);
134 else
135 return (rMax - zMin * tan(theta)) / sin(theta);
136 }
137 else {
138
139 if (theta >= thetaTopRight)
140 return (rMax - rMin) / sin(theta);
141 else
142 return (zMax * tan(theta) - rMin) / sin(theta);
143 }
144}
145
146
147
148
149// returns an array containing the depth of the boundaries between all parts of the detector
150// in interaction lengths
151
152const double* eflowDepthCalculator::calcDepthArray(double eta, double filler)
153{
154 static const double thetaTileExtBottomRight = atan( m_tileExtLayerR[0] / m_tileExtZmax );
155 static const double thetaEMBbottomRight = atan( m_EMBlayerR[0] / m_EMBzMax );
156 static const double thetaEMEtopLeft = atan( m_EMErMax / m_EMElayerZ[0] );
157 static const double thetaHECtopLeft = atan( m_HECrMax / m_HEClayerZ[0] );
158 static const double thetaFCALtopLeft = atan( m_FCALrMax / m_FCALlayerZ[0] );
159 static const double preEMBbottomRight = m_preEMBat0eta / sin(thetaEMBbottomRight);
160 static const double etaEMBbottomRight = fabs( log(tan(thetaEMBbottomRight / 2)) );
161
162 for (int i = 0; i <= m_nDepth; i++) m_layerDepth[i] = 0.0;
163 eta = fabs(eta);
164
165 if (eta >= 4.0) {
166 return nullptr;
167 }
168 else {
169 const double theta = 2.0 * atan( exp(-eta) );
170 const double sinTheta = sin(theta);
171
172 if (theta > thetaEMBbottomRight) {
173 m_layerDepth[EMB1] = m_preEMBat0eta / sinTheta;
174 if (theta < thetaEMEtopLeft) m_layerDepth[EME1] = m_LArGap;
175 }
176 else {
178 if (eta < 1.9) m_layerDepth[EME1] += (1.9 - eta) * (preEMBbottomRight - m_preEMEat19eta) / (1.9 - etaEMBbottomRight);
179 }
180
181 if (theta < thetaHECtopLeft) m_layerDepth[HEC1] = m_preHEC;
182 if (theta < thetaFCALtopLeft) m_layerDepth[FCAL0] = m_preFCAL;
183 if (theta > thetaTileExtBottomRight) m_layerDepth[Tile1] = m_cryostatAt0eta / sinTheta;
184
185 for (int i = 0; i < 3; i++) {
188 }
189
192
193 if (eta <= 0.7) {
194
195 for (int i = 0; i < 3; i++)
197 }
198 else if (eta < 1.0) {
199
200 bool haveIncludedGap = false;
201 double tileGap = m_tileGapAt1eta;
202 double tileBar, tileExt, temp;
203
204 for (int i = 0; i < 3; i++) {
205
208
209 if (1 == i)
211 else if (2 == i)
213
214 if (tileBar > 0.0 && tileExt > 0.0) {
215
216 temp = tileBar + tileExt;
217
218 if (!haveIncludedGap) {
219 temp += tileGap;
220 haveIncludedGap = true;
221 }
222
223 m_layerDepth[2*i+TileGap12] = temp;
224 }
225 else if (tileBar == 0.0 && tileExt > 0.0) {
226
227 m_layerDepth[2*i+TileGap12] = tileExt;
228
229 if (i > 0 && !haveIncludedGap) {
230 m_layerDepth[2*i+Tile1] = tileGap;
231 haveIncludedGap = true;
232 }
233 }
234 else {
235
236 m_layerDepth[2*i+TileGap12] = tileBar;
237 }
238 }
239 }
240 else {
241
242 double temp = 0.0;
243
244 for (int i = ORIGIN; i <= Tile1; i++) temp += m_layerDepth[i];
246
247 for (int i = 0; i < 3; i++)
249 }
250
251 for (int i = 1; i <= m_nDepth; i++) {
252 if (m_layerDepth[i] == 0.0) m_layerDepth[i] = filler;
253 m_layerDepth[i] += m_layerDepth[i-1];
254 }
255 }
256
257 return m_layerDepth;
258}
259
260
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
static const int nRegions
static const double m_tileExtLayerR[4]
static const double m_cryostatAt0eta
static const double m_tileBarZmax
static const double m_preEMBat0eta
static const double m_preEMEat19eta
static const double m_HEClayerZ[5]
static const double m_itc1Rmin
static const double m_tileExtZmax
static const double m_tileLambdaPerUnitLength
static const double m_EMBlayerR[4]
static const double m_itc2Rmin
static const double m_itc2Zmax
static const double m_tileBarLayerR[4]
static const double m_EMBlambdaPerUnitLength
static const double m_FCALrMin
static const double m_EMElayerZ[4]
const double * calcDepthArray(double eta, double filler=0.0)
static const double m_FCALlayerZ[4]
static const double m_inclusivePreTileExt
static const double m_tileBarZmin
static const DEPTHLAYER m_layerDepthMap[eflowCalo::nRegions]
static double lengthThroughBox(double theta, double zMin, double zMax, double rMin, double rMax)
static const double m_preHEC
static const double m_fcalLambdaPerUnitLength[3]
static const double m_itc1Zmin
static const double m_EMBzMin
static const double m_itc1Rmax
static const double m_FCALrMax
static const double m_LArGap
static const double m_EMErMax
static const double m_tileExtZmin
static const double m_itc1Zmax
static const double m_itc2Rmax
static const double m_EMErMin
static const double m_HECrMin
static const double m_HECrMax
static const double m_EMBzMax
static const double m_itc2Zmin
static const double m_preFCAL
static const double m_tileGapAt1eta
static DEPTHLAYER depthIndex(eflowCaloENUM layer)
double m_layerDepth[m_nDepth+1]
eflowCalo::LAYER eflowCaloENUM
eflowDepthCalculator::DEPTHLAYER eflowDepthLayerENUM