14 aTrack->SetUserInformation(trkInfo);
18 auto motherInfo =
static_cast<const TrackInformation *
>(mother.GetUserInformation());
23 trkInfo->setPrimary(
true);
24 trkInfo->setStoreTrack();
25 trkInfo->setGenParticlePID(aTrack->GetDefinition()->GetPDGEncoding());
26 trkInfo->setGenParticleP(aTrack->GetMomentum().mag());
27 trkInfo->setMCTruthID(aTrack->GetTrackID());
30 trkInfo->setGenParticlePID(motherInfo->genParticlePID());
31 trkInfo->setGenParticleP(motherInfo->genParticleP());
32 trkInfo->setMCTruthID(motherInfo->mcTruthID());
37 trkInfo->setStoreTrack();
38 trkInfo->setIDonCaloSurface(aTrack->GetTrackID(),
39 motherInfo->getIDCaloVolume(),
40 motherInfo->getIDLastVolume(),
41 aTrack->GetDefinition()->GetPDGEncoding(),
42 aTrack->GetMomentum().mag());
45 trkInfo->setIDonCaloSurface(motherInfo->getIDonCaloSurface(),
46 motherInfo->getIDCaloVolume(),
47 motherInfo->getIDLastVolume(),
48 motherInfo->caloSurfaceParticlePID(),
49 motherInfo->caloSurfaceParticleP());
53 if (motherInfo->hasCastorHit()) {
54 trkInfo->setCastorHitPID(motherInfo->getCastorHitPID());
58 if (!trkInfo->isPrimary() && !
isInBTL(aTrack)) {
59 trkInfo->setExtSecondary();
61 if (motherInfo->isExtSecondary()) {
62 trkInfo->setExtSecondary();
64 if (motherInfo->isBTLlooper()) {
65 trkInfo->setBTLlooper();
67 if (motherInfo->isInTrkFromBackscattering()) {
68 trkInfo->setInTrkFromBackscattering();
71 aTrack->SetUserInformation(trkInfo);
73 LogTrace(
"SimG4CoreApplication") <<
"MCTruthUtil called for " << aTrack->GetTrackID() <<
" mother " 74 << motherInfo->isPrimary() <<
" flag " <<
flag;
81 G4String
tName(aTrack->GetVolume()->GetLogicalVolume()->GetRegion()->GetName());
82 if (
tName ==
"FastTimerRegionBTL" ||
tName ==
"FastTimerRegionSensBTL") {
static void secondary(G4Track *aSecondary, const G4Track &mother, int)
static bool isInBTL(const G4Track *)
static void primary(G4Track *aPrimary)