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
407
409 double particleCharge(0.);
410 double particleMass(0.);
411
412 if (particle) {
413 particleCharge =
particle->charge();
414 particleMass =
particle->mass().value();
415
418 }
419 }
420 else {
421
423 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
424 <<" is not a nucleus and could not be retrieved from PartPropSvc. Assuming mass and charge as pion. Please investigate." );
425 particleCharge = 1.;
427 }
428 else {
429 particleCharge =
MC::charge(particleEncoding);
430
435 particleMass = std::abs( Z*Mp+(A-Z)*Mn );
436
437 if (!alreadyPrintedPDGcodeWarning) {
438 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
439 <<" could not be retrieved from PartPropSvc (unexpected ion)."
440 <<" Please Investigate the PDGTABLE.MeV file."
441 <<" Calculating mass and charge from pdg code."
442 <<" The result is: Charge = "<<particleCharge<<" Mass = "<<particleMass<<"MeV" );
443 alreadyPrintedPDGcodeWarning = true;
444 }
445 }
446 }
447
448 if (!particleCharge) { continue; }
449
450 if (!particleMass) {
451 ATH_MSG_WARNING (
"Ignoring ionization from particle with pdg code "<<particleEncoding
452 <<" since it appears to be a massless charged particle. Please investigate." );
453 continue;
454 }
455
456
457
458
459
460 const double scaledKineticEnergy( static_cast<double>((*theHit)->GetKineticEnergy()) * ( CLHEP::proton_mass_c2 / particleMass ));
461
463 (*theHit)->GetPreStepX(),(*theHit)->GetPreStepY(),(*theHit)->GetPreStepZ(),
464 (*theHit)->GetPostStepX(),(*theHit)->GetPostStepY(),(*theHit)->GetPostStepZ(),
466
467 }
468 }
469
471
473
474
475
476
477
478
479
480
482
484
486
488
489
491
493
494
495
496
497
499
501
502
504 {
505 outdigit = TRTDigit(hitID, 0);
506 return;
507 }
508
509
510 double lowthreshold, noiseamplitude;
513 } else {
515 noiseamplitude = 0.0;
516 }
517
518
520}
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, const int &hitID, const std::vector< cluster > &clusters, std::vector< TRTElectronicsProcessing::Deposit > &deposits, 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....
void addClustersFromStep(const double &scaledKineticEnergy, const double &particleCharge, const double &timeOfHit, const double &prex, const double &prey, const double &prez, const double &postx, const double &posty, const 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.
std::vector< TRTElectronicsProcessing::Deposit > m_depositList
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