58 {
59
60
61
62
64 {
66 }
67 else
68 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
69
70
73 {
74
75
76
77
78
79
80
81
82
83
84 constexpr double oneOverDeta = 10.;
85 constexpr double oneOverDphi = 32./
M_PI;
86
87 constexpr double rhoMinPresamplerMother = 1385.*CLHEP::mm;
88 constexpr double rhoMiddlePresampler = (1385.*CLHEP::mm + 1447.*CLHEP::mm)/2.;
89
90
91
92
93 constexpr double rhoAlignmentSafety = 10.*CLHEP::mm;
94 constexpr double rhoInFrontOfColdWall = rhoMinPresamplerMother - rhoAlignmentSafety;
95 static const double RIN_AC =
m_parameters->GetValue(
"LArEMBRadiusInnerAccordion");
96 constexpr double RCUT12 = 1593.9*CLHEP::mm;
97 constexpr double RCUT23 = 1866.1*CLHEP::mm;
98 static const double ROUT_AC =
m_parameters->GetValue(
"LArEMBRadiusOuterAccordion");
99 static const double rhoOuterAccordionWithSafety = ROUT_AC - rhoAlignmentSafety;
100 static const double LArEMBZmax =
m_parameters->GetValue(
"LArEMBZmax");
101
102 static const double zMaxAccordionWithSafety = LArEMBZmax - 10.*CLHEP::mm;
103
104
105
106
107 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
108 G4StepPoint* post_step_point =
step->GetPostStepPoint();
109
110 G4ThreeVector startPoint = pre_step_point->GetPosition();
111 G4ThreeVector endPoint = post_step_point->GetPosition();
112 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
113
114 G4double
rho =
p.perp();
115 G4double
eta = fabs(
p.pseudoRapidity() );
116 G4double
phi =
p.phi();
118
119
120 G4int subdet = (
p.z() > 0.) ? 4 : -4;
123
124
125
126 G4int
type = INT_MIN;
127 G4int sampling = INT_MIN;
128 G4int region = INT_MIN;
130
131
133 {
134
135
136
137
139
140
141 if ( rho < RIN_AC ) { sampling = 0; }
142 else if ( rho < RCUT12 ) { sampling = 1; }
143 else if ( rho < RCUT23 ) { sampling = 2; }
144 else { sampling = 3; }
145
146
147 region = 0;
149 }
150 else
151 {
152
154
156 {
157 if ( rho < rhoInFrontOfColdWall )
158
159
160
161
162
163
164 {
165 sampling = 1;
166 region = 0;
168 }
169 else if ( rho < rhoMiddlePresampler )
170
171
172
173
174 {
175 sampling = 1;
176 region = 2;
178 }
179 else if ( rho < rhoOuterAccordionWithSafety &&
180 fabs(
p.z()) < zMaxAccordionWithSafety )
181
182
183
184
185 {
186 sampling = 1;
187 region = 3;
189 }
190 else
191 {
192 sampling = 2;
193
195 {
196 region = 0;
198 }
199 else
200 {
201 region = 2;
203 }
204 }
205 }
206 else if (
eta < 1.6 )
207 {
208 sampling = 1;
209 region = 4;
211 }
212 else if (
eta < 1.8 )
213 {
214 sampling = 1;
215 region = 5;
217 }
218 else if (
eta < 3.2 )
219 {
220 sampling = 1;
221 region = 6;
223 }
224 }
225
226
227
228
229
230
231
232
233 if ( type == INT_MIN ||
234 region == INT_MIN ||
235 sampling == INT_MIN ||
236 etaBin == INT_MIN ||
237 phiBin < 0 )
238 {
239#if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
240 constexpr G4int messageMax = 10;
241 static std::atomic<G4int> messageCount = 0;
242 if ( messageCount++ < messageMax )
243 {
244 std::cout << "LArG4::BarrelCryostat::CalibrationLArCalculator::Process"
245 << " (error " << messageCount << " of " << messageMax << " max displayed)"
246 << std::endl
247 << " G4Step in LAr at unexpected place: (x,y,z) [mm] = ("
248 <<
p.x()/CLHEP::mm <<
","
249 <<
p.y()/CLHEP::mm <<
","
252 <<
", phi=" <<
phi << std::endl
253 << " using default calculator"
254 << std::endl;
255 }
256#endif
258 }
259 else
260 {
261
263 << subdet
264
266 << sampling
267 << region
270 }
271 }
272
273#ifdef DEBUG_HITS
275 std::cout << "LArG4::BarrelCryostat::CalibrationLArCalculator::Process"
276 << " ID=" << std::string(identifier)
278 << " energies=(" << energies[0]
279 << "," << energies[1]
280 << "," << energies[2]
281 << "," << energies[3] << ")"
282 << std::endl;
283#endif
284
285
286 if ( identifier == LArG4Identifier() )
287 return false;
288
289 return true;
290 }
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