ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwCalibHitsShowerDepth.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
10
11
14
15
16namespace CaloClusterCorr {
17
18
20
21
36double CaloSwCalibHitsShowerDepth::depth (const float aeta,
37 const float start_crack,
38 const float end_crack,
39 const CaloRec::Array<2>& sampling_depth,
40 const float etamax,
41 const xAOD::CaloCluster* cluster,
42 MsgStream& log)
43{
44 float R[4];
45 int si;
46
47 if (aeta < start_crack) {
48 barrelCoefs (aeta, R);
49 si = 0;
50 }
51 else if (aeta > end_crack) {
52 if (!endcapCoefs (aeta, sampling_depth, etamax, R))
53 return 0;
54 si = 1;
55 }
56 else
57 return 0;
58
59 static const CaloSampling::CaloSample samps[2][4] = {
60 { CaloSampling::PreSamplerB,
61 CaloSampling::EMB1,
62 CaloSampling::EMB2,
63 CaloSampling::EMB3 },
64 { CaloSampling::PreSamplerE,
65 CaloSampling::EME1,
66 CaloSampling::EME2,
67 CaloSampling::EME3 }
68 };
69
70 double rsum = 0;
71 double esum = 0;
72 for (int i=0; i < 4; i++) {
73 float e = cluster->eSample (samps[si][i]);
74 rsum += R[i] * e;
75 esum += e;
76 }
77
78 if (esum == 0)
79 return 0;
80
81 double depth = rsum / esum;
82
83 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Shower barycenter ---->> " << depth << endmsg;
84
85 return depth;
86}
87
88
95 float R[4])
96{
97//----------------------------------------------------------------------
98// APPROXIMATE Longitudinal segmentation of the EM Barrel
99// Inspired from M.Seman's former ACCOMPA.
100// - PURPOSE Computes the shower longitudinal barycenter
101// - Inputs: shower eta and energies in the compartments
102//----------------------------------------------------------------------
103
104 static const float
105 X0IN = 1.6, // 1.7 X0 before strips
106 X0S1 = 6.0, // 6 X0 till end of strips
107 // X0S2 = 24.0, // 24 X0 till end of S2
108 // X0S3 = 2.0, // 2 X0 at least in S3
109 // RIN = 150.0024, // where strips start (cm)
110 // ROUT = 197.0482, // where S3 ends (cm)
111 // RCLR = 0.7, // clearance for resistive ink (cm)
112 //BEND1 = 152.1000, // first 3 bends radii (cm)
113 //BEND2 = 155.9659,
114 //BEND3 = 159.7202,
115 ETASTEP = 0.8, // where lead changes
116 //DENSHI = 2.137, // cm/X0 high density
117 //DENSLO = 2.695, // cm/X0 low density
118 X0THI = 23.74, // total depth high density part (not indep?)
119 X0TLO = 19.177; // total depth low density part (not indep?)
120
121 float X0T;
122 float R12, R23;
123
124 if ( aeta < ETASTEP ) {
125 //DENS = DENSHI;
126 X0T = X0THI;
127 //RLO = BEND2; // break strips between bends 2 and 3
128 //RHI = BEND3;
129 }else{
130 //DENS = DENSLO;
131 X0T = X0TLO;
132 //RLO = BEND1; // break strips between bends 1 and 2
133 //RHI = BEND2;
134 }
135
136 R[0] = (X0IN) * cosh(aeta);
137
138 // R12 is radius at transition strips->Sampling2
139 // R23 is radius at transition Sampling2->Sampling3
140
141 R12 = X0S1;
142
143 //.. total depth of calo at given eta
144
145 float RADLTOT = X0T*cosh(aeta);
146
147 //.. radius where S2 ends. Make sure there are 2X0 left for S3
148
149 if (aeta < 0.5){
150 R23 = 22 * cosh(aeta) ;
151 }else{
152 R23 = 25;
153 }
154
155 R[1] = R[0] + (R12 - R[0])/2 ;
156 R[2] = R12 + (R23 - R12)/2;
157 R[3] = R23 + (RADLTOT - R23)/2;
158}
159
160
169 const CaloRec::Array<2>& sampling_depth,
170 const float etamax,
171 float R[4])
172{
173 unsigned int ibin = (static_cast<unsigned int> (aeta / etamax * 100)) ;
174 if (ibin >= sampling_depth.size())
175 return false;
176
177 for (int i=0; i < 4; i++)
178 R[i] = sampling_depth[ibin][i+1];
179 return true;
180}
181
182
183} // namespace CaloClusterCorr
#define endmsg
Calculate the shower depth as used by the calib hits correction.
static bool endcapCoefs(const float aeta, const CaloRec::Array< 2 > &sampling_depth, const float etamax, float R[4])
Calculate the sampling depth coefficients for the endcap.
static void barrelCoefs(const float aeta, float R[4])
Calculate the sampling depth coefficients for the barrel.
static double depth(const float aeta, const float start_crack, const float end_crack, const CaloRec::Array< 2 > &sampling_depth, const float etamax, const xAOD::CaloCluster *cluster, MsgStream &log)
Calculate the depth of the cluster.
Read-only multidimensional array.
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
float eSample(const CaloSample sampling) const
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.