15 G4LogicalVolume *volume = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();
21 G4int modeType =
static_cast<const MyPrimaryGenerator*
>(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction())->GetModeType();
30 SteppingForLuDecayBulkSignature(step, volume, detectorConstruction);
33 SteppingForCosmicRaysDetectors(step, volume, detectorConstruction);
42 if(volume != fScoringVolume)
46 if(step->GetTrack()->GetParticleDefinition()->GetPDGEncoding()==-22)
50 if(step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary)
52 G4double newtimein = step->GetPreStepPoint()->GetGlobalTime();
53 G4ThreeVector newposin = step->GetPreStepPoint()->GetPosition();
55 G4double newtimeinter = step->GetPostStepPoint()->GetGlobalTime();
56 G4ThreeVector newposinter = step->GetPostStepPoint()->GetPosition();
62 G4double edep = step->GetTotalEnergyDeposit();
67 G4double dx = step->GetStepLength();
70 G4ThreeVector maxedeppos = (step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition())/2;
76 void MySteppingAction::SteppingForCosmicRaysDetectors(
const G4Step *step, G4LogicalVolume *volume,
const MyDetectorConstruction *detectorConstruction)
79 G4LogicalVolume *fCosmicVolume = detectorConstruction->GetCosmicTriggerVolume();
82 if(!fCosmicVolume || volume != fCosmicVolume)
86 if(step->GetTrack()->GetTrackID() != 1)
90 G4bool isUpOrBottom = step->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber();
97 step->GetTrack()->SetTrackStatus(fStopAndKill);
103 void MySteppingAction::SetTimeOfDecay(
const G4Step *step)
106 if(step->GetTrack()->GetParentID() == 0 && step->IsFirstStepInVolume())
108 G4double newtimein = step->GetPreStepPoint()->GetGlobalTime();
109 G4ThreeVector newposin = step->GetPreStepPoint()->GetPosition();
115 if(step->GetTrack()->GetParentID() == 0 && step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType() == 6)
117 const auto* fDecayProducts = step->GetSecondaryInCurrentStep();
119 for(
auto i = 0; i < fDecayProducts->size(); i++)
121 G4Track* modifiableTrack =
const_cast<G4Track*
>((*fDecayProducts)[i]);
122 modifiableTrack->SetGlobalTime(0.);
129 void MySteppingAction::SteppingForLuDecayBulkSignature(
const G4Step *step, G4LogicalVolume *volume,
const MyDetectorConstruction *detectorConstruction)
132 G4LogicalVolume *fSiVolume = detectorConstruction->GetDecayTriggerVolume();
135 if(volume != fSiVolume)
139 if(step->GetTrack()->GetParticleDefinition()->GetPDGEncoding() != 11)
143 if(step->GetPreStepPoint()->GetTouchableHandle()->GetVolume(2)->GetTranslation().z() >
GS::zScintillator || step->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber(2) != 57)
Mandatory user initialization concrete class of G4VUserDetectorConstruction. It represents the whole ...
G4LogicalVolume * GetScoringVolume() const
Get the scoring volume. It will be used by MySteppingAction::UserSteppingAction().
User action concrete class of G4UserEventAction. In addition to defining procedures executed at the s...
void SetArrivalandFirstInteraction(G4double newtimein, G4ThreeVector newposin, G4double newtimeinter, G4ThreeVector newposinter)
Stores the time and the position of arrival to the crystal of the primary gamma.
void AddEdep(G4double edep)
For every G4Step inside the crystal it sums the energy deposit.
void SetMaxEdep(G4double edepondx, G4ThreeVector maxedeppos)
Stores the maximum deposit of energy per unit length and its position inside the crystal.
Mandatory user action concrete class of G4VUserPrimaryGeneratorAction. It defines the settings for th...
void UserSteppingAction(const G4Step *step) override
For every step updates and stores quantities about the physics inside the crystal by calling the meth...
MyEventAction * fEventAction
Pointer to the MyEventAction object.
MySteppingAction(MyEventAction *eventAction)
Constructor of the class.
constexpr G4double zScintillator
z-position of the scintillator crystal.
Declaration of the class MySteppingAction.