57 {
58
59
60
61
63 {
65 }
66 else
67 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
68
69
72 {
73
74
75
76
77
78
79
80
81
82
83 constexpr double oneOverDeta = 10.;
84 constexpr double oneOverDphi = 32./
M_PI;
85
86 constexpr double rhoMinPresamplerMother = 1385.*CLHEP::mm;
87 constexpr double rhoMiddlePresampler = (1385.*CLHEP::mm + 1447.*CLHEP::mm)/2.;
88
89
90
91
92 constexpr double rhoAlignmentSafety = 10.*CLHEP::mm;
93 constexpr double rhoInFrontOfColdWall = rhoMinPresamplerMother - rhoAlignmentSafety;
94 static const double RIN_AC =
m_parameters->GetValue(
"LArEMBRadiusInnerAccordion");
95 constexpr double RCUT12 = 1593.9*CLHEP::mm;
96 constexpr double RCUT23 = 1866.1*CLHEP::mm;
97 static const double ROUT_AC =
m_parameters->GetValue(
"LArEMBRadiusOuterAccordion");
98 static const double rhoOuterAccordionWithSafety = ROUT_AC - rhoAlignmentSafety;
99 static const double LArEMBZmax =
m_parameters->GetValue(
"LArEMBZmax");
100
101 static const double zMaxAccordionWithSafety = LArEMBZmax - 10.*CLHEP::mm;
102
103
104
105
106 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
107 G4StepPoint* post_step_point =
step->GetPostStepPoint();
108
109 G4ThreeVector startPoint = pre_step_point->GetPosition();
110 G4ThreeVector endPoint = post_step_point->GetPosition();
111 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
112
113 G4double
rho =
p.perp();
114 G4double
eta = fabs(
p.pseudoRapidity() );
115 G4double
phi =
p.phi();
117
118
119 G4int subdet = (
p.z() > 0.) ? 4 : -4;
122
123
124
125 G4int
type = INT_MIN;
126 G4int sampling = INT_MIN;
127 G4int region = INT_MIN;
129
130
132 {
133
134
135
136
138
139
140 if ( rho < RIN_AC ) { sampling = 0; }
141 else if ( rho < RCUT12 ) { sampling = 1; }
142 else if ( rho < RCUT23 ) { sampling = 2; }
143 else { sampling = 3; }
144
145
146 region = 0;
148 }
149 else
150 {
151
153
155 {
156 if ( rho < rhoInFrontOfColdWall )
157
158
159
160
161
162
163 {
164 sampling = 1;
165 region = 0;
167 }
168 else if ( rho < rhoMiddlePresampler )
169
170
171
172
173 {
174 sampling = 1;
175 region = 2;
177 }
178 else if ( rho < rhoOuterAccordionWithSafety &&
179 fabs(
p.z()) < zMaxAccordionWithSafety )
180
181
182
183
184 {
185 sampling = 1;
186 region = 3;
188 }
189 else
190 {
191 sampling = 2;
192
194 {
195 region = 0;
197 }
198 else
199 {
200 region = 2;
202 }
203 }
204 }
205 else if (
eta < 1.6 )
206 {
207 sampling = 1;
208 region = 4;
210 }
211 else if (
eta < 1.8 )
212 {
213 sampling = 1;
214 region = 5;
216 }
217 else if (
eta < 3.2 )
218 {
219 sampling = 1;
220 region = 6;
222 }
223 }
224
225
226
227
228
229
230
231
232 if ( type == INT_MIN ||
233 region == INT_MIN ||
234 sampling == INT_MIN ||
235 etaBin == INT_MIN ||
236 phiBin < 0 )
237 {
238#if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
239 constexpr G4int messageMax = 10;
240 static std::atomic<G4int> messageCount = 0;
241 if ( messageCount++ < messageMax )
242 {
243 std::cout << "LArG4::BarrelCryostat::CalibrationLArCalculator::Process"
244 << " (error " << messageCount << " of " << messageMax << " max displayed)"
245 << std::endl
246 << " G4Step in LAr at unexpected place: (x,y,z) [mm] = ("
247 <<
p.x()/CLHEP::mm <<
","
248 <<
p.y()/CLHEP::mm <<
","
251 <<
", phi=" <<
phi << std::endl
252 << " using default calculator"
253 << std::endl;
254 }
255#endif
257 }
258 else
259 {
260
262 << subdet
263
265 << sampling
266 << region
269 }
270 }
271
272#ifdef DEBUG_HITS
274 std::cout << "LArG4::BarrelCryostat::CalibrationLArCalculator::Process"
275 << " ID=" << std::string(identifier)
277 << " energies=(" << energies[0]
278 << "," << energies[1]
279 << "," << energies[2]
280 << "," << energies[3] << ")"
281 << std::endl;
282#endif
283
284
285 if ( identifier == LArG4Identifier() )
286 return false;
287
288 return true;
289 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
CaloG4::SimulationEnergies m_energyCalculator
const std::string process
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin