7 #include "G4VParticleChange.hh"
8 #include "G4ProcessManager.hh"
9 #include "G4ProcessVector.hh"
10 #include "G4VProcess.hh"
11 #include "G4GPILSelection.hh"
37 particleChange->UpdateStepForPostStep(const_cast<G4Step *> (&step));
54 G4TrackVector* fSecondary = (
const_cast<G4Step *
> (&
step))->GetfSecondary();
55 G4int nSecondarySave = fSecondary->size();
58 G4Track* tempSecondaryTrack;
60 for(G4int DSecLoop=0 ; DSecLoop< num2ndaries; DSecLoop++){
64 tempSecondaryTrack->SetCreatorProcess( pRegProcess );
67 fSecondary->push_back( tempSecondaryTrack );
84 pmanager = track.GetDefinition()->GetProcessManager();
86 G4double testGPIL = DBL_MAX;
87 G4double fStepLength = 0.0;
88 G4ForceCondition fForceCondition = InActivated;
90 fStepLength = step.GetStepLength();
98 const G4TrackStatus keepStatus = track.GetTrackStatus();
100 (
const_cast<G4Track *
> (&track))->SetTrackStatus(fPostponeToNextEvent);
105 if (
fProcess->GetProcessType() == fParameterisation ) {
108 testGPIL =
fProcess->PostStepGPIL(track,fStepLength,&fForceCondition );
113 if( fForceCondition == ExclusivelyForced) {
118 for(G4int DSecLoop=0 ; DSecLoop< nsec ; DSecLoop++){
119 G4Track* tempSecondaryTrack =
particleChange->GetSecondary(DSecLoop);
120 delete tempSecondaryTrack;
127 (
const_cast<G4Step *
> (&
step))->SetStepLength(testGPIL);
128 (
const_cast<G4Track *
> (&track))->SetStepLength(testGPIL);
130 step.GetPostStepPoint()->SetStepStatus(fExclusivelyForcedProc);;
131 step.GetPostStepPoint()->SetProcessDefinedStep(
fProcess);
132 step.GetPostStepPoint()->SetSafety(0.0);
138 particleChange->UpdateStepForPostStep(const_cast<G4Step *> (&step));
141 (
const_cast<G4Step *
> (&
step))->UpdateTrack();
145 step.GetPostStepPoint()->SetSafety(0.0);
148 (
const_cast<G4Track *
> (&track))->SetTrackStatus(
particleChange->GetTrackStatus() );
152 (
const_cast<G4Track *
> (&track))->SetTrackStatus(keepStatus);
164 G4TrackVector::iterator itv = fSecondary->begin();
165 itv += nSecondarySave;
168 fSecondary->erase(itv,itv+num2ndaries);
177 std::cout <<
" GflashHadronWrapperProcess ProcessName, PreStepPosition, preStepPoint KE, PostStepPoint KE, DeltaEnergy Nsec \n "
178 << step.GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() <<
" "
179 << step.GetPostStepPoint()->GetPosition() <<
" "
180 << step.GetPreStepPoint()->GetKineticEnergy()/GeV <<
" "
181 << step.GetPostStepPoint()->GetKineticEnergy()/GeV <<
" "
182 << step.GetDeltaEnergy()/GeV <<
" "
GflashHadronWrapperProcess(G4String processName)
G4ProcessVector * fProcessVector
virtual ~GflashHadronWrapperProcess()
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step)
G4ProcessManager * pmanager
void Print(const G4Step &astep)
G4VParticleChange * particleChange