ATLAS Offline Software
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 
7 NAME: eflowDepthCalculator.h
8 PACKAGE: offline/Reconstruction/eflowRec
9 
10 AUTHORS: M.Hodgkinson, R Duxfield (based on R.Duxfields Root package)
11 CREATED: 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
30 const double eflowDepthCalculator::m_preEMBat0eta = 0.5793; // fit to TDR diagram
31 const double eflowDepthCalculator::m_cryostatAt0eta = 0.4666; // fit to TDR diagram
32 const double eflowDepthCalculator::m_LArGap = 0.4;
33 const double eflowDepthCalculator::m_preEMEat19eta = 0.5; // '' '' '' '' ''
34 const double eflowDepthCalculator::m_preHEC = 0.4; // '' '' '' '' ''
35 const double eflowDepthCalculator::m_preFCAL = 0.5;
36 const double eflowDepthCalculator::m_tileGapAt1eta = 0.5; // a fudge (approx fit to TDR diagram)
37 const double eflowDepthCalculator::m_inclusivePreTileExt = 3.9603; // a fudge (approx fit to TDR diagram)
38 
39 // no. interaction lengths per m in LAr and tile
42 
44 
45 // EMB geometry in (r, z)
46 const 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
49 
50 // EME geometry in (r, z)
51 const double eflowDepthCalculator::m_EMErMin = 0.33*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
53 const 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)
56 const double eflowDepthCalculator::m_HECrMin = 0.50*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
59 
60 // FCAL geometry in (r, z)
61 const double eflowDepthCalculator::m_FCALrMin = 0.6*Gaudi::Units::meter; // from calo TDR plan (prob. not very accurate)
63 const 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)
69 
70 // tile ext. geometry in (r, z)
74 
75 // ITC1 geometry in (r, z)
80 
81 // ITC2 geometry in (r, z)
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 {
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 
109 double 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 
152 const 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 
eflowCaloRegions.h
eflowDepthCalculator::m_itc2Rmin
static const double m_itc2Rmin
Definition: eflowDepthCalculator.h:102
eflowDepthCalculator::m_EMBlayerR
static const double m_EMBlayerR[4]
Definition: eflowDepthCalculator.h:71
eflowDepthCalculator::calcDepthArray
const double * calcDepthArray(double eta, double filler=0.0)
Definition: eflowDepthCalculator.cxx:152
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
eflowDepthCalculator::m_itc2Zmax
static const double m_itc2Zmax
Definition: eflowDepthCalculator.h:101
eflowDepthCalculator::m_layerDepth
double m_layerDepth[m_nDepth+1]
Definition: eflowDepthCalculator.h:112
eflowDepthCalculator::m_cryostatAt0eta
static const double m_cryostatAt0eta
Definition: eflowDepthCalculator.h:59
eflowDepthCalculator::m_itc2Zmin
static const double m_itc2Zmin
Definition: eflowDepthCalculator.h:100
eflowDepthCalculator::Unknown
@ Unknown
Definition: eflowDepthCalculator.h:53
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
eflowCalo::Unknown
@ Unknown
Definition: eflowCaloRegions.h:50
eflowDepthCalculator::HEC1
@ HEC1
Definition: eflowDepthCalculator.h:50
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
eflowDepthCalculator::m_itc1Rmin
static const double m_itc1Rmin
Definition: eflowDepthCalculator.h:97
eflowDepthCalculator::EMB2
@ EMB2
Definition: eflowDepthCalculator.h:48
eflowDepthCalculator::EMB1
@ EMB1
Definition: eflowDepthCalculator.h:48
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
eflowDepthCalculator::m_EMBlambdaPerUnitLength
static const double m_EMBlambdaPerUnitLength
Definition: eflowDepthCalculator.h:67
eflowDepthCalculator::m_FCALrMin
static const double m_FCALrMin
Definition: eflowDepthCalculator.h:83
eflowDepthCalculator::m_tileExtLayerR
static const double m_tileExtLayerR[4]
Definition: eflowDepthCalculator.h:91
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
eflowDepthCalculator::m_EMErMax
static const double m_EMErMax
Definition: eflowDepthCalculator.h:76
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
eflowDepthCalculator::m_preEMEat19eta
static const double m_preEMEat19eta
Definition: eflowDepthCalculator.h:61
eflowDepthCalculator::m_itc2Rmax
static const double m_itc2Rmax
Definition: eflowDepthCalculator.h:103
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
eflowDepthCalculator::m_itc1Rmax
static const double m_itc1Rmax
Definition: eflowDepthCalculator.h:98
eflowDepthCalculator::m_preFCAL
static const double m_preFCAL
Definition: eflowDepthCalculator.h:63
eflowDepthCalculator::eflowDepthCalculator
eflowDepthCalculator()
Definition: eflowDepthCalculator.cxx:88
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
eflowDepthCalculator::m_EMBzMax
static const double m_EMBzMax
Definition: eflowDepthCalculator.h:73
eflowDepthCalculator::EME2
@ EME2
Definition: eflowDepthCalculator.h:49
eflowDepthCalculator::m_tileGapAt1eta
static const double m_tileGapAt1eta
Definition: eflowDepthCalculator.h:64
eflowDepthCalculator::m_inclusivePreTileExt
static const double m_inclusivePreTileExt
Definition: eflowDepthCalculator.h:65
eflowDepthCalculator::ORIGIN
@ ORIGIN
Definition: eflowDepthCalculator.h:48
python.SystemOfUnits.meter
int meter
Definition: SystemOfUnits.py:61
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
lumiFormat.i
int i
Definition: lumiFormat.py:92
eflowDepthCalculator::m_HECrMax
static const double m_HECrMax
Definition: eflowDepthCalculator.h:80
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
eflowDepthCalculator::m_tileBarLayerR
static const double m_tileBarLayerR[4]
Definition: eflowDepthCalculator.h:87
eflowDepthCalculator::m_tileBarZmin
static const double m_tileBarZmin
Definition: eflowDepthCalculator.h:88
eflowDepthCalculator::m_itc1Zmin
static const double m_itc1Zmin
Definition: eflowDepthCalculator.h:95
eflowDepthCalculator::FCAL0
@ FCAL0
Definition: eflowDepthCalculator.h:52
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
eflowDepthCalculator::m_tileExtZmin
static const double m_tileExtZmin
Definition: eflowDepthCalculator.h:92
eflowDepthCalculator::m_FCALlayerZ
static const double m_FCALlayerZ[4]
Definition: eflowDepthCalculator.h:85
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
eflowDepthCalculator::Tile1
@ Tile1
Definition: eflowDepthCalculator.h:51
eflowDepthCalculator::m_EMErMin
static const double m_EMErMin
Definition: eflowDepthCalculator.h:75
eflowDepthCalculator::m_preEMBat0eta
static const double m_preEMBat0eta
Definition: eflowDepthCalculator.h:58
eflowDepthCalculator::m_tileExtZmax
static const double m_tileExtZmax
Definition: eflowDepthCalculator.h:93
eflowDepthCalculator::m_HECrMin
static const double m_HECrMin
Definition: eflowDepthCalculator.h:79
eflowDepthCalculator::lengthThroughBox
static double lengthThroughBox(double theta, double zMin, double zMax, double rMin, double rMax)
Definition: eflowDepthCalculator.cxx:109
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
eflowCalo::nRegions
static const int nRegions
Definition: eflowCaloRegions.h:45
eflowDepthCalculator.h
eflowDepthCalculator::m_fcalLambdaPerUnitLength
static const double m_fcalLambdaPerUnitLength[3]
Definition: eflowDepthCalculator.h:69
eflowDepthCalculator::m_HEClayerZ
static const double m_HEClayerZ[5]
Definition: eflowDepthCalculator.h:81
eflowCalo::LAYER
LAYER
Definition: eflowCaloRegions.h:36
eflowDepthCalculator::m_tileLambdaPerUnitLength
static const double m_tileLambdaPerUnitLength
Definition: eflowDepthCalculator.h:68
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
eflowDepthCalculator::m_EMBzMin
static const double m_EMBzMin
Definition: eflowDepthCalculator.h:72
eflowDepthCalculator::m_nDepth
static const int m_nDepth
Definition: eflowDepthCalculator.h:109
eflowDepthCalculator::DEPTHLAYER
DEPTHLAYER
Definition: eflowDepthCalculator.h:47
eflowDepthCalculator::m_FCALrMax
static const double m_FCALrMax
Definition: eflowDepthCalculator.h:84
eflowDepthCalculator::m_preHEC
static const double m_preHEC
Definition: eflowDepthCalculator.h:62
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
eflowDepthCalculator::m_tileBarZmax
static const double m_tileBarZmax
Definition: eflowDepthCalculator.h:89
eflowDepthCalculator::m_EMElayerZ
static const double m_EMElayerZ[4]
Definition: eflowDepthCalculator.h:77
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
eflowDepthCalculator::EME1
@ EME1
Definition: eflowDepthCalculator.h:49
eflowDepthCalculator::TileGap12
@ TileGap12
Definition: eflowDepthCalculator.h:51
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
eflowDepthCalculator::HEC2
@ HEC2
Definition: eflowDepthCalculator.h:50
eflowDepthCalculator::m_layerDepthMap
static const DEPTHLAYER m_layerDepthMap[eflowCalo::nRegions]
Definition: eflowDepthCalculator.h:110
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
eflowDepthCalculator::m_itc1Zmax
static const double m_itc1Zmax
Definition: eflowDepthCalculator.h:96
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
eflowDepthCalculator::depthIndex
static DEPTHLAYER depthIndex(eflowCaloENUM layer)
Definition: eflowDepthCalculator.cxx:96
eflowDepthCalculator::m_LArGap
static const double m_LArGap
Definition: eflowDepthCalculator.h:60