15 aTrack->SetUserInformation(trkInfo);
19 auto motherInfo =
static_cast<const TrackInformation *
>(mother.GetUserInformation());
21 LogDebug(
"SimG4CoreApplication") <<
"MCTruthUtil called for " << aTrack->GetTrackID() <<
" mother " 22 << motherInfo->isPrimary() <<
" flag " <<
flag;
26 trkInfo->setPrimary(
true);
27 trkInfo->setStoreTrack();
28 trkInfo->setGenParticlePID(aTrack->GetDefinition()->GetPDGEncoding());
29 trkInfo->setGenParticleP(aTrack->GetMomentum().mag());
30 trkInfo->setMCTruthID(aTrack->GetTrackID());
33 trkInfo->setGenParticlePID(motherInfo->genParticlePID());
34 trkInfo->setGenParticleP(motherInfo->genParticleP());
35 trkInfo->setMCTruthID(motherInfo->mcTruthID());
40 trkInfo->setStoreTrack();
41 trkInfo->setIDonCaloSurface(aTrack->GetTrackID(),
42 motherInfo->getIDCaloVolume(),
43 motherInfo->getIDLastVolume(),
44 aTrack->GetDefinition()->GetPDGEncoding(),
45 aTrack->GetMomentum().mag());
48 trkInfo->setIDonCaloSurface(motherInfo->getIDonCaloSurface(),
49 motherInfo->getIDCaloVolume(),
50 motherInfo->getIDLastVolume(),
51 motherInfo->caloSurfaceParticlePID(),
52 motherInfo->caloSurfaceParticleP());
56 if (motherInfo->hasCastorHit()) {
57 trkInfo->setCastorHitPID(motherInfo->getCastorHitPID());
62 if ((motherInfo->storeTrack() && motherInfo->isFromTtoBTL()) || motherInfo->isBTLdaughter()) {
63 trkInfo->setBTLdaughter();
64 trkInfo->setIdAtBTLentrance(motherInfo->idAtBTLentrance());
65 LogDebug(
"SimG4CoreApplication") <<
"NewTrackAction: secondary in BTL " << trkInfo->isBTLdaughter()
66 <<
" from mother ID " << trkInfo->idAtBTLentrance();
70 aTrack->SetUserInformation(trkInfo);
75 G4String
tName(aTrack->GetVolume()->GetLogicalVolume()->GetRegion()->GetName());
76 if (
tName ==
"FastTimerRegionBTL" ||
tName ==
"FastTimerRegionSensBTL") {
static void secondary(G4Track *aSecondary, const G4Track &mother, int)
static bool isInBTL(const G4Track *)
static void primary(G4Track *aPrimary)