71 G4ClassificationOfNewTrack classification = fWaiting;
72 art::ServiceHandle<geo::Geometry const> geom;
74 Double_t buffer = 500;
78 int ppdg = aTrack->GetParentID();
79 TString process(
"NA");
80 if (ppdg) process = (TString)aTrack->GetCreatorProcess()->GetProcessName();
85 if (aTrack->GetParentID()==0)
87 G4ParticleDefinition *particleType = aTrack->GetDefinition();
88 if( ((particleType==G4MuonPlus::MuonPlusDefinition())
89 || (particleType==G4MuonMinus::MuonMinusDefinition())
91 && !volName.Contains(
"unknown")
93 classification = fUrgent;
96 if (volName.Contains(
"unknown")) classification = fKill;
101 if(aTrack->GetTrackStatus()==fSuspend) {
break; }
103 if ((aTrack->GetDefinition()->GetPDGEncoding()==2112 || aTrack->GetDefinition()->GetPDGEncoding()==130 || aTrack->GetDefinition()->GetPDGEncoding()==310 || aTrack->GetDefinition()->GetPDGEncoding()==311 || aTrack->GetDefinition()->GetPDGEncoding()==3122 ) && (aTrack->GetParentID()==1) && !volName.Contains(
"unknown"))
106 const G4ThreeVector tr4Pos = aTrack->GetPosition();
108 const TVector3 trPos(tr4Pos.x()/CLHEP::cm,tr4Pos.y()/CLHEP::cm,tr4Pos.z()/CLHEP::cm);
110 classification = fUrgent;
114 trPos.X() < (geom->DetHalfWidth()*2.0 + buffer) && trPos.X() > (-buffer) &&
115 trPos.Y() < (geom->DetHalfHeight()*2.0 + buffer) && trPos.Y() > (-geom->DetHalfHeight()*2.0 - buffer) &&
116 trPos.Z() < (geom->DetLength() + buffer) && trPos.Z() > (-buffer)
119 { classification = fUrgent;
break; }
123 { classification = fKill;
break; }
129 if (volName.Contains(
"unknown")) classification = fKill;
137 if(aTrack->GetParentID() == 0 && !volName.Contains(
"unknown")){
138 classification = fUrgent;
142 if(volName.Contains(geom->GetLArTPCVolumeName()) && aTrack->GetParentID()!=0)
144 classification = fUrgent;
146 aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni")
149 classification = fKill;
153 else if (volName.Contains(
"unknown") ){
154 classification = fKill;
158 if(aTrack->GetDefinition()->GetPDGEncoding()==11
159 && aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni") )
161 classification = fKill;
165 classification = fKill;
169 return classification;
std::string InsideTPC(const G4Track *aTrack)