15 G4LogicalVolume *volume = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();
21 G4int modeType =
static_cast<const MyPrimaryGenerator*
>(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction())->GetModeType();
30 SteppingForLuDecayBulkSignature(step, volume, detectorConstruction);
34 SteppingForCosmicRaysDetectors(step, volume, detectorConstruction);
43 if(volume != fScoringVolume)
47 if(step->GetTrack()->GetParticleDefinition()->GetPDGEncoding()==-22)
51 if(step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary)
53 G4double newtimein = step->GetPreStepPoint()->GetGlobalTime();
54 G4ThreeVector newposin = step->GetPreStepPoint()->GetPosition();
56 G4double newtimeinter = step->GetPostStepPoint()->GetGlobalTime();
57 G4ThreeVector newposinter = step->GetPostStepPoint()->GetPosition();
63 G4double edep = step->GetTotalEnergyDeposit();
68 G4double dx = step->GetStepLength();
71 G4ThreeVector maxedeppos = (step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition())/2;
77 void MySteppingAction::SteppingForCosmicRaysDetectors(
const G4Step *step, G4LogicalVolume *volume,
const MyDetectorConstruction *detectorConstruction)
80 G4LogicalVolume *fCosmicVolume = detectorConstruction->GetCosmicTriggerVolume();
83 if(!fCosmicVolume || volume != fCosmicVolume)
87 if(step->GetTrack()->GetTrackID() != 1)
91 G4bool isUpOrBottom = step->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber();
98 step->GetTrack()->SetTrackStatus(fStopAndKill);
104 void MySteppingAction::SetTimeOfDecay(
const G4Step *step)
107 if(step->GetTrack()->GetParentID() == 0 && step->IsFirstStepInVolume())
109 G4double newtimein = step->GetPreStepPoint()->GetGlobalTime();
110 G4ThreeVector newposin = step->GetPreStepPoint()->GetPosition();
116 if(step->GetTrack()->GetParentID() == 0 && step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType() == 6)
118 const auto* fDecayProducts = step->GetSecondaryInCurrentStep();
120 for(
auto i = 0; i < fDecayProducts->size(); i++)
122 G4Track* modifiableTrack =
const_cast<G4Track*
>((*fDecayProducts)[i]);
123 modifiableTrack->SetGlobalTime(0.);
130 void MySteppingAction::SteppingForLuDecayBulkSignature(
const G4Step *step, G4LogicalVolume *volume,
const MyDetectorConstruction *detectorConstruction)
133 G4LogicalVolume *fSiVolume = detectorConstruction->GetDecayTriggerVolume();
136 if(volume != fSiVolume)
140 if(step->GetTrack()->GetParticleDefinition()->GetPDGEncoding() != 11)
144 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.