30 #include "CLHEP/Units/SystemOfUnits.h" 32 #include "Geant4/G4MuonMinus.hh" 33 #include "Geant4/G4MuonPlus.hh" 34 #include "Geant4/G4StackManager.hh" 35 #include "Geant4/G4String.hh" 36 #include "Geant4/G4ThreeVector.hh" 37 #include "Geant4/G4Track.hh" 38 #include "Geant4/G4TrackStatus.hh" 39 #include "Geant4/G4ParticleDefinition.hh" 40 #include "Geant4/G4VProcess.hh" 43 #include "RtypesCore.h" 68 G4ClassificationOfNewTrack
71 G4ClassificationOfNewTrack classification = fWaiting;
74 Double_t buffer = 500;
78 int ppdg = aTrack->GetParentID();
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();
110 classification = fUrgent;
114 trPos.X() < (geom->
DetHalfWidth()*2.0 + buffer) && trPos.X() > (-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;
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;
177 const G4ThreeVector tr4Pos = aTrack->GetPosition();
204 stackManager->ReClassify();
215 stackManager->ReClassify();
221 stackManager->ReClassify();
static constexpr double cm
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)
virtual ~LArStackingAction()
art framework interface to geometry description
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.
static constexpr double deg
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
virtual void PrepareNewEvent()
std::string VolumeName(geo::Point_t const &point) const
Returns the name of the deepest volume containing specified point.
std::string GetLArTPCVolumeName(geo::TPCID const &tpcid) const
Return the name of specified LAr TPC volume.