6 #include "G4LogicalVolumeStore.hh"
7 #include "G4ParticleTable.hh"
8 #include "G4PhysicalVolumeStore.hh"
9 #include "G4RegionStore.hh"
10 #include "G4UnitsTable.hh"
11 #include "G4SystemOfUnits.hh"
32 maxTrackTime =
p.getParameter<
double>(
"MaxTrackTime") * CLHEP::ns;
33 maxTrackTimes =
p.getParameter<std::vector<double> >(
"MaxTrackTimes");
34 maxTimeNames =
p.getParameter<std::vector<std::string> >(
"MaxTimeNames");
36 ekinMins =
p.getParameter<std::vector<double> >(
"EkinThresholds");
37 ekinNames =
p.getParameter<std::vector<std::string> >(
"EkinNames");
38 ekinParticles =
p.getParameter<std::vector<std::string> >(
"EkinParticles");
44 <<
" MaxTrackTime = " <<
maxTrackTime / CLHEP::ns <<
" ns";
58 <<
"SteppingAction: Number of DeadRegions where all trackes are killed " <<
ndeadRegions;
93 G4Track* theTrack = aStep->GetTrack();
96 G4StepPoint* postStep = aStep->GetPostStepPoint();
98 if (
sAlive == tstat && postStep->GetPhysicalVolume() !=
nullptr) {
99 G4StepPoint* preStep = aStep->GetPreStepPoint();
100 const G4Region* theRegion = preStep->GetPhysicalVolume()->GetLogicalVolume()->GetRegion();
113 <<
"Track #" << theTrack->GetTrackID() <<
" " << theTrack->GetDefinition()->GetParticleName()
114 <<
" E(MeV)= " << preStep->GetKineticEnergy() /
MeV
115 <<
" is killed due to edep=NaN inside PV: " << preStep->GetPhysicalVolume()->GetName() <<
" at "
116 << theTrack->GetPosition() <<
" StepLen(mm)= " << aStep->GetStepLength();
131 G4double kinEnergy = theTrack->GetKineticEnergy();
133 theTrack->GetDefinition()->GetPDGCharge() != 0.0 && kinEnergy > 0.0 &&
134 theTrack->GetNextVolume()->GetLogicalVolume()->GetMaterial()->GetDensity() <=
theCriticalDensity) {
141 math::XYZVectorD pos((preStep->GetPosition()).
x(), (preStep->GetPosition()).
y(), (preStep->GetPosition()).
z());
144 (preStep->GetMomentum()).
y(),
145 (preStep->GetMomentum()).
z(),
146 preStep->GetTotalEnergy());
148 uint32_t
id = theTrack->GetTrackID();
150 std::pair<math::XYZVectorD, math::XYZTLorentzVectorD>
p(
pos, mom);
154 theTrack->SetTrackStatus(fStopAndKill);
167 const G4StepPoint* sp = aStep->GetPostStepPoint();
168 G4LogicalVolume* lv = sp->GetPhysicalVolume()->GetLogicalVolume();
176 double ekin = sp->GetKineticEnergy();
177 int pCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
188 const G4PhysicalVolumeStore*
pvs = G4PhysicalVolumeStore::GetInstance();
190 std::vector<G4VPhysicalVolume*>::const_iterator pvcite;
191 for (pvcite =
pvs->begin(); pvcite !=
pvs->end(); ++pvcite) {
192 if ((*pvcite)->GetName() ==
"Tracker")
194 if ((*pvcite)->GetName() ==
"CALO")
202 LogDebug(
"SimG4CoreApplication") <<
"Tracker vol name " <<
tracker->GetName();
204 LogDebug(
"SimG4CoreApplication") <<
"Calorimeter vol name " <<
calo->GetName();
208 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
212 std::vector<G4LogicalVolume*>::const_iterator lvcite;
213 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
215 if ((*lvcite)->GetName() == (G4String)(
ekinNames[
i])) {
228 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
238 const G4RegionStore* rs = G4RegionStore::GetInstance();
241 std::vector<G4Region*>::const_iterator rcite;
242 for (rcite = rs->begin(); rcite != rs->end(); ++rcite) {
253 std::vector<G4Region*>::const_iterator rcite;
254 for (rcite = rs->begin(); rcite != rs->end(); ++rcite) {
275 typ =
" in dead region ";
278 typ =
" out of time window ";
281 typ =
" low energy limit ";
284 typ =
" low energy limit in vacuum ";
287 typ =
" energy deposition is NaN ";
292 G4VPhysicalVolume*
pv = aTrack->GetNextVolume();
294 vname =
pv->GetLogicalVolume()->GetName();
295 rname =
pv->GetLogicalVolume()->GetRegion()->GetName();
299 <<
"Track #" << aTrack->GetTrackID() <<
" " << aTrack->GetDefinition()->GetParticleName()
300 <<
" E(MeV)= " << aTrack->GetKineticEnergy() /
MeV <<
" T(ns)= " << aTrack->GetGlobalTime() / ns
301 <<
" is killed due to " << typ <<
" inside LV: " << vname <<
" (" <<
rname <<
") at " << aTrack->GetPosition();