6 #include "G4LogicalVolumeStore.hh"
7 #include "G4ParticleTable.hh"
8 #include "G4PhysicalVolumeStore.hh"
9 #include "G4RegionStore.hh"
10 #include "G4UnitsTable.hh"
11 #include "G4SystemOfUnits.hh"
33 maxTrackTime =
p.getParameter<
double>(
"MaxTrackTime") * CLHEP::ns;
35 maxTrackTimes =
p.getParameter<std::vector<double> >(
"MaxTrackTimes");
36 maxTimeNames =
p.getParameter<std::vector<std::string> >(
"MaxTimeNames");
38 ekinMins =
p.getParameter<std::vector<double> >(
"EkinThresholds");
39 ekinNames =
p.getParameter<std::vector<std::string> >(
"EkinNames");
40 ekinParticles =
p.getParameter<std::vector<std::string> >(
"EkinParticles");
46 <<
" MaxTrackTime = " <<
maxTrackTime / CLHEP::ns <<
" ns;"
62 <<
"SteppingAction: Number of DeadRegions where all trackes are killed " <<
ndeadRegions;
97 G4Track* theTrack = aStep->GetTrack();
100 const G4StepPoint* preStep = aStep->GetPreStepPoint();
101 const G4StepPoint* postStep = aStep->GetPostStepPoint();
109 <<
"Track #" << theTrack->GetTrackID() <<
" " << theTrack->GetDefinition()->GetParticleName()
110 <<
" E(MeV)= " << preStep->GetKineticEnergy() /
MeV
111 <<
" is killed due to edep=NaN inside PV: " << preStep->GetPhysicalVolume()->GetName() <<
" at "
112 << theTrack->GetPosition() <<
" StepLen(mm)= " << aStep->GetStepLength();
122 if (
sAlive == tstat && postStep->GetPhysicalVolume() !=
nullptr) {
123 const G4Region* theRegion = preStep->GetPhysicalVolume()->GetLogicalVolume()->GetRegion();
141 G4double kinEnergy = theTrack->GetKineticEnergy();
143 theTrack->GetDefinition()->GetPDGCharge() != 0.0 && kinEnergy > 0.0 &&
144 theTrack->GetNextVolume()->GetLogicalVolume()->GetMaterial()->GetDensity() <=
theCriticalDensity) {
151 math::XYZVectorD pos((preStep->GetPosition()).
x(), (preStep->GetPosition()).
y(), (preStep->GetPosition()).
z());
154 (preStep->GetMomentum()).
y(),
155 (preStep->GetMomentum()).
z(),
156 preStep->GetTotalEnergy());
158 uint32_t
id = theTrack->GetTrackID();
160 std::pair<math::XYZVectorD, math::XYZTLorentzVectorD>
p(
pos, mom);
164 theTrack->SetTrackStatus(fStopAndKill);
176 const G4StepPoint* sp = aStep->GetPostStepPoint();
177 const G4LogicalVolume* lv = sp->GetPhysicalVolume()->GetLogicalVolume();
178 double ekin = sp->GetKineticEnergy();
179 int pCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
195 const G4PhysicalVolumeStore*
pvs = G4PhysicalVolumeStore::GetInstance();
197 std::vector<G4VPhysicalVolume*>::const_iterator pvcite;
198 for (pvcite =
pvs->begin(); pvcite !=
pvs->end(); ++pvcite) {
199 if ((*pvcite)->GetName() ==
"Tracker")
201 if ((*pvcite)->GetName() ==
"CALO")
209 LogDebug(
"SimG4CoreApplication") <<
"Tracker vol name " <<
tracker->GetName();
211 LogDebug(
"SimG4CoreApplication") <<
"Calorimeter vol name " <<
calo->GetName();
215 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
219 std::vector<G4LogicalVolume*>::const_iterator lvcite;
220 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
222 if ((*lvcite)->GetName() == (G4String)(
ekinNames[
i])) {
235 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
245 const G4RegionStore* rs = G4RegionStore::GetInstance();
248 std::vector<G4Region*>::const_iterator rcite;
249 for (rcite = rs->begin(); rcite != rs->end(); ++rcite) {
260 std::vector<G4Region*>::const_iterator rcite;
261 for (rcite = rs->begin(); rcite != rs->end(); ++rcite) {
282 typ =
" in dead region ";
285 typ =
" out of time window ";
288 typ =
" low energy limit ";
291 typ =
" low energy limit in vacuum ";
294 typ =
" energy deposition is NaN ";
297 typ =
" very forward track ";
302 G4VPhysicalVolume*
pv = aTrack->GetNextVolume();
304 vname =
pv->GetLogicalVolume()->GetName();
305 rname =
pv->GetLogicalVolume()->GetRegion()->GetName();
309 <<
"Track #" << aTrack->GetTrackID() <<
" " << aTrack->GetDefinition()->GetParticleName()
310 <<
" E(MeV)= " << aTrack->GetKineticEnergy() /
MeV <<
" T(ns)= " << aTrack->GetGlobalTime() / ns
311 <<
" is killed due to " << typ <<
" inside LV: " << vname <<
" (" <<
rname <<
") at " << aTrack->GetPosition();