73 G4ClassificationOfNewTrack classification = fWaiting;
76 Double_t buffer = 500;
80 int ppdg = aTrack->GetParentID();
81 TString process(
"NA");
82 if (ppdg) process = (TString)aTrack->GetCreatorProcess()->GetProcessName();
87 if (aTrack->GetParentID()==0)
89 G4ParticleDefinition *particleType = aTrack->GetDefinition();
90 if( ((particleType==G4MuonPlus::MuonPlusDefinition())
91 || (particleType==G4MuonMinus::MuonMinusDefinition())
93 && !volName.Contains(
"unknown")
95 classification = fUrgent;
98 if (volName.Contains(
"unknown")) classification = fKill;
103 if(aTrack->GetTrackStatus()==fSuspend) {
break; }
105 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"))
108 const G4ThreeVector tr4Pos = aTrack->GetPosition();
110 const TVector3 trPos(tr4Pos.x()/CLHEP::cm,tr4Pos.y()/CLHEP::cm,tr4Pos.z()/CLHEP::cm);
112 classification = fUrgent;
116 trPos.X() < (geom->
DetHalfWidth()*2.0 + buffer) && trPos.X() > (-buffer) &&
118 trPos.Z() < (geom->
DetLength() + buffer) && trPos.Z() > (-buffer)
121 { classification = fUrgent;
break; }
125 { classification = fKill;
break; }
131 if (volName.Contains(
"unknown")) classification = fKill;
139 if(aTrack->GetParentID() == 0 && !volName.Contains(
"unknown")){
140 classification = fUrgent;
146 classification = fUrgent;
148 aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni")
151 classification = fKill;
155 else if (volName.Contains(
"unknown") ){
156 classification = fKill;
160 if(aTrack->GetDefinition()->GetPDGEncoding()==11
161 && aTrack->GetCreatorProcess()->GetProcessName().contains(
"muIoni") )
163 classification = fKill;
167 classification = fKill;
171 return classification;
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
std::string InsideTPC(const G4Track *aTrack)
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
std::string GetLArTPCVolumeName(geo::TPCID const &tpcid) const
Return the name of specified LAr TPC volume.