5 #include <phparameter/PHParameters.h>
15 #include <Geant4/G4Step.hh>
16 #include <Geant4/G4SystemOfUnits.hh>
28 , savevolpost(nullptr)
30 , saveprestepstatus(-1)
31 , savepoststepstatus(-1)
32 , active(params->get_int_param(
"active"))
33 , IsBlackHole(params->get_int_param(
"blackhole"))
34 , use_g4_steps(params->get_int_param(
"use_g4steps"))
35 , enable_track_filter(params->get_int_param(
"enable_track_filter"))
36 , filter_max_slope(params->get_double_param(
"filter_max_slope"))
37 , filter_min_energy(params->get_double_param(
"filter_min_energy"))
53 if(enable_track_filter == 0)
return false;
55 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
56 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
57 G4VPhysicalVolume* volume = touch->GetVolume();
59 if(!detector_->
IsInBlock(volume))
return false;
62 G4Track* aTrack = aStep->GetTrack();
64 if(aTrack->GetMomentumDirection()[2] < 0.)
66 aTrack->SetTrackStatus(fStopAndKill);
70 if(aTrack->GetTotalEnergy() < 1.*MeV)
72 aTrack->SetTrackStatus(fStopAndKill);
76 double z_pos = aTrack->GetPosition()[2]/cm;
77 if(z_pos > 0. && z_pos < 500.)
79 double minE = (500. - z_pos)/500.*filter_min_energy*GeV;
80 if(aTrack->GetTotalEnergy() < minE)
82 aTrack->SetTrackStatus(fStopAndKill);
bool IsInBlock(G4VPhysicalVolume *) const
virtual void SetInterfacePointers(PHCompositeNode *)
reimplemented from base class
virtual bool UserSteppingAction(const G4Step *, bool)
stepping action
virtual ~SQG4DipoleMagnetSteppingAction()
destructor
SQG4DipoleMagnetSteppingAction(SQG4DipoleMagnetDetector *, const PHParameters *parameters)
constructor