226{
227
229
230
231 const double rWire = 25.e-4;
232
233 const double rTube = 1.45;
234
235 const double lTube = 10.;
236
237 double eKin_eV = ekin_MeV * 1e+6;
238
239 double xc = 0., yc = 0., zc = 0., tc = 0.;
240
241 int nc = 0;
242
243 double ec = 0.;
244
245 double extra = 0.;
247
248
249
251 if (particleName == "gamma") {
253 x_cm, y_cm, z_cm, time, eKin_eV, dx, dy, dz, nc);
254 }
255 else {
257 x_cm, y_cm, z_cm, time, eKin_eV, dx, dy, dz, nc);
259 }
260
261 for (int cl = 0; cl < nc; cl++) {
262 double xe, ye, ze, te;
263 double ee, dxe, dye, dze;
264 fTrackHeed->GetElectron(cl, xe, ye, ze, te, ee, dxe, dye, dze);
265 if (ze < lTube && ze > -lTube && sqrt(xe * xe + ye * ye) < rTube) {
267 if (particleName == "gamma") {
269 }
270
271
273 double newTime = te;
274 if (newTime < time) {
275 newTime += time;
276 }
279 }
280
281 fDrift->DriftElectron(xe, ye, ze, te);
282
283 double xe1, ye1, ze1, te1;
284 double xe2, ye2, ze2, te2;
285
286 int status;
287 fDrift->GetElectronEndpoint(
288 0, xe1, ye1, ze1, te1, xe2, ye2, ze2, te2, status);
289
290 if (0 < xe2 && xe2 < rWire) {
291 xe2 += 2 * rWire;
292 }
293 if (0 > xe2 && xe2 > -rWire) {
294 xe2 += -2 * rWire;
295 }
296 if (0 < ye2 && ye2 < rWire) {
297 ye2 += 2 * rWire;
298 }
299 if (0 > ye2 && ye2 > -rWire) {
300 ye2 += -2 * rWire;
301 }
302
303 double e2 = 0.1;
304 fAvalanche->AvalancheElectron(xe2, ye2, ze2, te2, e2, 0, 0, 0);
305
306 int ne = 0, ni = 0;
309 }
310 }
311 }
312 else {
315 fTrackHeed->NewTrack(x_cm, y_cm, z_cm, time, dx, dy, dz);
316
317 while (
fTrackHeed->GetCluster(xc, yc, zc, tc, nc, ec, extra)) {
318 if (zc < lTube && zc > -lTube && sqrt(xc * xc + yc * yc) < rTube) {
321 for (int cl = 0; cl < nc; cl++) {
322 double xe, ye, ze, te;
323 double ee, dxe, dye, dze;
324 fTrackHeed->GetElectron(cl, xe, ye, ze, te, ee, dxe, dye, dze);
325 if (ze < lTube && ze > -lTube && sqrt(xe * xe + ye * ye) < rTube) {
326
327
329 double newTime = te;
330 if (newTime < time) {
331 newTime += time;
332 }
334 "e-", ee, newTime, xe, ye, ze, dxe, dye, dze));
335 }
336
337 fDrift->DriftElectron(xe, ye, ze, te);
338
339 double xe1, ye1, ze1, te1;
340 double xe2, ye2, ze2, te2;
341
342 int status;
343 fDrift->GetElectronEndpoint(
344 0, xe1, ye1, ze1, te1, xe2, ye2, ze2, te2, status);
345
346 if (0 < xe2 && xe2 < rWire) {
347 xe2 += 2 * rWire;
348 }
349 if (0 > xe2 && xe2 > -rWire) {
350 xe2 += -2 * rWire;
351 }
352 if (0 < ye2 && ye2 < rWire) {
353 ye2 += 2 * rWire;
354 }
355 if (0 > ye2 && ye2 > -rWire) {
356 ye2 += -2 * rWire;
357 }
358
359 double e2 = 0.1;
360 fAvalanche->AvalancheElectron(xe2, ye2, ze2, te2, e2, 0, 0, 0);
361
362 int ne = 0, ni = 0;
365 }
366 }
367 }
368 }
369 }
372 }
373}