263{
264
266
268 const int hitID((*i)->GetHitID());
271
272
273
274 const bool isECA (region==3);
275 const bool isECB (region==4);
276
278
280
281
282
283
284
285
286
287
289
291
293
295
296
298
299
301 {
302
303 const TimedHitPtr<TRTUncompressedHit> *theHit = &(*hit_iter);
304
306
307
308
309
310 double timeOfHit(0.0);
312 const double globalHitTime(
hitTime(*theHit));
313 const double globalTime = static_cast<double>((*theHit)->GetGlobalTime());
314 const double bunchCrossingTime(globalHitTime - globalTime);
317 }
318
319
320
321
322 const int particleEncoding((*theHit)->GetParticleEncoding());
323
324
325 if (particleEncoding == 0)
326 {
327
328
329
330
333 ATH_MSG_WARNING (
"Ignoring sim. particle with pdgcode 0. This warning is only shown once per job" );
334 }
335 continue;
336 }
337
338
339
341
343
344
345
346
347
348 if ( energyDeposit<30.0 ) {
349
350
351
352 double ArEmulationScaling_BA = 0.05;
353 double ArEmulationScaling_ECA = 0.20;
354 double ArEmulationScaling_ECB = 0.20;
355
356
357 double KrEmulationScaling_BA = 0.20;
358 double KrEmulationScaling_ECA = 0.39;
359 double KrEmulationScaling_ECB = 0.39;
360
361 if (isBarrel) {
362 double trEfficiencyBarrel =
m_settings->trEfficiencyBarrel(strawGasType);
363 double hitx = TRThitGlobalPos[0];
364 double hity = TRThitGlobalPos[1];
365 double hitz = TRThitGlobalPos[2];
366 double hitEta = std::abs(
log(
tan(0.5*atan2(sqrt(hitx*hitx+hity*hity),hitz))));
367 if ( hitEta < 0.5 ) { trEfficiencyBarrel *= ( 0.833333+0.6666667*hitEta*hitEta ); }
368
369 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyBarrel *= ArEmulationScaling_BA; }
370 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyBarrel *= KrEmulationScaling_BA; }
371 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyBarrel ) continue;
372 }
373 else {
374 if (isECA) {
375 double trEfficiencyEndCapA =
m_settings->trEfficiencyEndCapA(strawGasType);
376
377 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyEndCapA *= ArEmulationScaling_ECA; }
378 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyEndCapA *= KrEmulationScaling_ECA; }
379 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyEndCapA ) continue;
380 }
381 if (isECB) {
382 double trEfficiencyEndCapB =
m_settings->trEfficiencyEndCapB(strawGasType);
383
384 if ( strawGasType == 0 && emulationArflag ) { trEfficiencyEndCapB *= ArEmulationScaling_ECB; }
385 if ( strawGasType == 0 && emulationKrflag ) { trEfficiencyEndCapB *= KrEmulationScaling_ECB; }
386 if ( CLHEP::RandFlat::shoot(rndmEngine) > trEfficiencyEndCapB ) continue;
387 }
388 }
389 }
390
391
392 m_clusterlist.emplace_back( energyDeposit*CLHEP::keV, timeOfHit, (*theHit)->GetPostStepX(), (*theHit)->GetPostStepY(), (*theHit)->GetPostStepZ() );
393
394
395
396 }
399 ) {
400
401 m_clusterlist.emplace_back( (*theHit)->GetEnergyDeposit()*CLHEP::keV, timeOfHit, (*theHit)->GetPostStepX(), (*theHit)->GetPostStepY(), (*theHit)->GetPostStepZ() );
402 }
403 else {
404
405
407 double particleCharge(0.);
408 double particleMass(0.);
409
410 if (particle) {
411 particleCharge =
particle->charge();
412 particleMass =
particle->mass().value();
413
416 }
417 }
418 else {
419
421 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
422 <<" is not a nucleus and could not be retrieved from PartPropSvc. Assuming mass and charge as pion. Please investigate." );
423 particleCharge = 1.;
425 }
426 else {
427 particleCharge =
MC::charge(particleEncoding);
428
433 particleMass = std::abs( Z*Mp+(A-Z)*Mn );
434
435 if (!alreadyPrintedPDGcodeWarning) {
436 ATH_MSG_WARNING (
"Data for sim. particle with pdgcode "<<particleEncoding
437 <<" could not be retrieved from PartPropSvc (unexpected ion)."
438 <<" Please Investigate the PDGTABLE.MeV file."
439 <<" Calculating mass and charge from pdg code."
440 <<" The result is: Charge = "<<particleCharge<<" Mass = "<<particleMass<<"MeV" );
441 alreadyPrintedPDGcodeWarning = true;
442 }
443 }
444 }
445
446 if (!particleCharge) { continue; }
447
448 if (!particleMass) {
449 ATH_MSG_WARNING (
"Ignoring ionization from particle with pdg code "<<particleEncoding
450 <<" since it appears to be a massless charged particle. Please investigate." );
451 continue;
452 }
453
454
455
456
457
458 const double scaledKineticEnergy( static_cast<double>((*theHit)->GetKineticEnergy()) * ( CLHEP::proton_mass_c2 / particleMass ));
459
461 (*theHit)->GetPreStepX(),(*theHit)->GetPreStepY(),(*theHit)->GetPreStepZ(),
462 (*theHit)->GetPostStepX(),(*theHit)->GetPostStepY(),(*theHit)->GetPostStepZ(),
464
465 }
466 }
467
469
471
472
473
474
475
476
477
478
480
482
484
486
487
489
491
492
493
494
495
497
499
500
502 {
503 outdigit = TRTDigit(hitID, 0);
504 return;
505 }
506
507
508 double lowthreshold, noiseamplitude;
511 } else {
513 noiseamplitude = 0.0;
514 }
515
516
518}
float hitTime(const AFP_SIDSimHit &hit)
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.
Amg::Vector3D getGlobalPosition(int hitID, const TimedHitPtr< TRTUncompressedHit > *theHit)
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