65 G4ClassificationOfNewTrack classification = fWaiting;
68 Double_t buffer = 500;
72 int ppdg = aTrack->GetParentID();
73 TString process(
"NA");
74 if (ppdg) process = (TString)aTrack->GetCreatorProcess()->GetProcessName();
78 if (aTrack->GetParentID() == 0) {
79 G4ParticleDefinition* particleType = aTrack->GetDefinition();
80 if (((particleType == G4MuonPlus::MuonPlusDefinition()) ||
81 (particleType == G4MuonMinus::MuonMinusDefinition())) &&
82 !volName.Contains(
"unknown")) {
83 classification = fUrgent;
86 if (volName.Contains(
"unknown")) classification = fKill;
91 if (aTrack->GetTrackStatus() == fSuspend) {
break; }
93 if ((aTrack->GetDefinition()->GetPDGEncoding() == 2112 ||
94 aTrack->GetDefinition()->GetPDGEncoding() == 130 ||
95 aTrack->GetDefinition()->GetPDGEncoding() == 310 ||
96 aTrack->GetDefinition()->GetPDGEncoding() == 311 ||
97 aTrack->GetDefinition()->GetPDGEncoding() == 3122) &&
98 (aTrack->GetParentID() == 1) && !volName.Contains(
"unknown")) {
100 const G4ThreeVector tr4Pos = aTrack->GetPosition();
102 const TVector3 trPos(tr4Pos.x() / CLHEP::cm, tr4Pos.y() / CLHEP::cm, tr4Pos.z() / CLHEP::cm);
104 classification = fUrgent;
107 if (trPos.X() < (geom->
DetHalfWidth() * 2.0 + buffer) && trPos.X() > (-buffer) &&
110 trPos.Z() < (geom->
DetLength() + buffer) && trPos.Z() > (-buffer))
113 classification = fUrgent;
119 classification = fKill;
125 if (volName.Contains(
"unknown")) classification = fKill;
133 if (aTrack->GetParentID() == 0 && !volName.Contains(
"unknown")) {
134 classification = fUrgent;
139 classification = fUrgent;
140 if (
fStack & 0
x4 && aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni")) {
141 classification = fKill;
145 else if (volName.Contains(
"unknown")) {
146 classification = fKill;
150 if (aTrack->GetDefinition()->GetPDGEncoding() == 11 &&
151 aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni")) {
152 classification = fKill;
156 classification = fKill;
160 return classification;
std::string GetLArTPCVolumeName(TPCID const &tpcid=tpc_zero) const
Return the name of specified LAr TPC volume.
Length_t DetHalfWidth(TPCID const &tpcid=tpc_zero) const
Returns the half width of the active volume of the specified TPC.
std::string InsideTPC(const G4Track *aTrack)
Length_t DetLength(TPCID const &tpcid=tpc_zero) const
Returns the length of the active volume of the specified TPC.
Float_t x4[n_points_geant4]
Length_t DetHalfHeight(TPCID const &tpcid=tpc_zero) const
Returns the half height of the active volume of the specified TPC.