265{
266
268
270 const int hitID((*i)->GetHitID());
273
274
275
276 const bool isECA (region==3);
277 const bool isECB (region==4);
278
280
282
283
284
285
286
287
288
289
291
293
295
297
298
300
301
303 {
304
305 const TimedHitPtr<TRTUncompressedHit> *theHit = &(*hit_iter);
306
308
309
310
311
312 double timeOfHit(0.0);
314 const double globalHitTime(
hitTime(*theHit));
315 const double globalTime = static_cast<double>((*theHit)->GetGlobalTime());
316 const double bunchCrossingTime(globalHitTime - globalTime);
319 }
320
321
322
323
324 const int particleEncoding((*theHit)->GetParticleEncoding());
325
326
327 if (particleEncoding == 0)
328 {
329
330
331
332
335 ATH_MSG_WARNING (
"Ignoring sim. particle with pdgcode 0. This warning is only shown once per job" );
336 }
337 continue;
338 }
339
340
341
343
345
346
347
348
349
350 if ( energyDeposit<30.0 ) {
351
352
353
354 double ArEmulationScaling_BA = 0.05;
355 double ArEmulationScaling_ECA = 0.20;
356 double ArEmulationScaling_ECB = 0.20;
357
358
359 double KrEmulationScaling_BA = 0.20;
360 double KrEmulationScaling_ECA = 0.39;
361 double KrEmulationScaling_ECB = 0.39;
362
363 if (isBarrel) {
364 double trEfficiencyBarrel =
m_settings->trEfficiencyBarrel(strawGasType);
365 double hitx = TRThitGlobalPos[0];
366 double hity = TRThitGlobalPos[1];
367 double hitz = TRThitGlobalPos[2];
368 double hitEta = std::abs(
log(
tan(0.5*atan2(sqrt(hitx*hitx+hity*hity),hitz))));
369 if ( hitEta < 0.5 ) { trEfficiencyBarrel *= ( 0.833333+0.6666667*hitEta*hitEta ); }
370
371 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyBarrel *= ArEmulationScaling_BA; }
372 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyBarrel *= KrEmulationScaling_BA; }
373 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyBarrel ) continue;
374 }
375 else {
376 if (isECA) {
377 double trEfficiencyEndCapA =
m_settings->trEfficiencyEndCapA(strawGasType);
378
379 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyEndCapA *= ArEmulationScaling_ECA; }
380 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyEndCapA *= KrEmulationScaling_ECA; }
381 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyEndCapA ) continue;
382 }
383 if (isECB) {
384 double trEfficiencyEndCapB =
m_settings->trEfficiencyEndCapB(strawGasType);
385
386 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyEndCapB *= ArEmulationScaling_ECB; }
387 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyEndCapB *= KrEmulationScaling_ECB; }
388 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyEndCapB ) continue;
389 }
390 }
391 }
392
393
394 m_clusterlist.emplace_back( energyDeposit*CLHEP::keV, timeOfHit, (*theHit)->GetPostStepX(), (*theHit)->GetPostStepY(), (*theHit)->GetPostStepZ() );
395
396
397
398 }
401 ) {
402
403 m_clusterlist.emplace_back( (*theHit)->GetEnergyDeposit()*CLHEP::keV, timeOfHit, (*theHit)->GetPostStepX(), (*theHit)->GetPostStepY(), (*theHit)->GetPostStepZ() );
404 }
405 else {
406
408 double particleCharge(0.);
409 double particleMass(0.);
410
411 if (particle) {
412 particleCharge =
particle->charge();
413 particleMass =
particle->mass().value();
414
417 }
418 }
419 else {
420
422 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
423 <<" is not a nucleus and could not be retrieved from PartPropSvc. Assuming mass and charge as pion. Please investigate." );
424 particleCharge = 1.;
426 }
427 else {
428 particleCharge =
MC::charge(particleEncoding);
429
434 particleMass = std::abs( Z*Mp+(A-Z)*Mn );
435
436 if (!alreadyPrintedPDGcodeWarning) {
437 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
438 <<" could not be retrieved from PartPropSvc (unexpected ion)."
439 <<" Please Investigate the PDGTABLE.MeV file."
440 <<" Calculating mass and charge from pdg code."
441 <<" The result is: Charge = "<<particleCharge<<" Mass = "<<particleMass<<"MeV" );
442 alreadyPrintedPDGcodeWarning = true;
443 }
444 }
445 }
446
447 if (!particleCharge) { continue; }
448
449 if (!particleMass) {
450 ATH_MSG_WARNING (
"Ignoring ionization from particle with pdg code "<<particleEncoding
451 <<" since it appears to be a massless charged particle. Please investigate." );
452 continue;
453 }
454
455
456
457
458
459 const double scaledKineticEnergy( static_cast<double>((*theHit)->GetKineticEnergy()) * ( CLHEP::proton_mass_c2 / particleMass ));
460
462 (*theHit)->GetPreStepX(),(*theHit)->GetPreStepY(),(*theHit)->GetPreStepZ(),
463 (*theHit)->GetPostStepX(),(*theHit)->GetPostStepY(),(*theHit)->GetPostStepZ(),
465
466 }
467 }
468
470
472
473
474
475
476
477
478
479
481
483
485
487
488
490
492
493
494
495
496
498
500
501
503 {
504 outdigit = TRTDigit(hitID, 0);
505 return;
506 }
507
508
509 double lowthreshold, noiseamplitude;
512 } else {
514 noiseamplitude = 0.0;
515 }
516
517
519}
float hitTime(const AFP_SIDSimHit &hit)
Amg::Vector3D getGlobalPosition(int hitID, const TimedHitPtr< TRTUncompressedHit > *theHit, const InDetDD::TRT_DetElementContainer *detElements)
std::vector< cluster > m_clusterlist
void ClustersToDeposits(MagField::AtlasFieldCache &fieldCache, int hitID, const std::vector< cluster > &clusters, std::vector< TRTElectronicsProcessing::Deposit > &deposits, const Amg::Vector3D &TRThitGlobalPos, double m_cosmicEventPhase, int strawGasType, CLHEP::HepRandomEngine *rndmEngine)
Transform the ioniation clusters along the particle trajectory inside a straw to energy deposits (i....
std::vector< TRTElectronicsProcessing::Deposit > m_depositList
void addClustersFromStep(double scaledKineticEnergy, double particleCharge, double timeOfHit, double prex, double prey, double prez, double postx, double posty, double postz, std::vector< cluster > &clusterlist, int strawGasType, CLHEP::HepRandomEngine *rndmEngine, CLHEP::HepRandomEngine *paiRndmEngine)
This is the main function for re-simulation of the ionisation in the active gas via the PAI model.
TimedHitCollection< TRTUncompressedHit >::const_iterator hitCollConstIter
int numberOfProtons(const T &p)
bool isGenericMultichargedParticle(const T &p)
In addition, there is a need to identify ”Q-ball” and similar very exotic (multi-charged) particles w...
bool isPhoton(const T &p)
bool isMonopole(const T &p)
PDG rule 11i Magnetic monopoles and dyons are assumed to have one unit of Dirac monopole charge and a...
double charge(const T &p)
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
double baryonNumber(const T &p)
constexpr double protonMassInMeV
the mass of the proton (in MeV)
constexpr double chargedPionMassInMeV
the mass of the charged pion (in MeV)
constexpr double neutronMassInMeV
the mass of the neutron (in MeV)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses