46void G4ErrorEnergyLoss::InstantiateEforExtrapolator()
53 delete theELossForExtrapolator;
69 G4double kinEnergyEnd = kinEnergyStart;
76 G4double kinEnergyHalfStep = kinEnergyStart - (kinEnergyStart-kinEnergyEnd)/2.;
80 G4cout <<
" G4ErrorEnergyLoss FWD end " << kinEnergyEnd
81 <<
" halfstep " << kinEnergyHalfStep <<
G4endl;
89 kinEnergyEnd = kinEnergyStart - (kinEnergyHalfStep - kinEnergyEnd );
91 kinEnergyEnd = theELossForExtrapolator->
EnergyAfterStep( kinEnergyStart,
95 G4double kinEnergyHalfStep = kinEnergyStart - (kinEnergyStart-kinEnergyEnd)/2.;
98 G4cout <<
" G4ErrorEnergyLoss BCKD end " << kinEnergyEnd
99 <<
" halfstep " << kinEnergyHalfStep <<
G4endl;
103 kinEnergyEnd = theELossForExtrapolator->
EnergyAfterStep( kinEnergyHalfStep,
107 kinEnergyEnd = kinEnergyStart - (kinEnergyHalfStep - kinEnergyEnd );
110 G4double edepo = kinEnergyEnd - kinEnergyStart;
114 G4cout <<
"AlongStepDoIt Estart= " << kinEnergyStart <<
" Eend " << kinEnergyEnd
115 <<
" Ediff " << kinEnergyStart-kinEnergyEnd <<
" step= " << step_length
116 <<
" mate= " << aMaterial->
GetName()
137 if( theStepLimit != 1. ) {
139 G4double kinEnergyLoss = kinEnergyStart;
144 kinEnergyLoss = - kinEnergyStart +
145 theELossForExtrapolator->
EnergyBeforeStep( kinEnergyStart, currentMinimumStep,
146 aMaterial, aParticleDef );
148 kinEnergyLoss = kinEnergyStart -
149 theELossForExtrapolator->
EnergyAfterStep( kinEnergyStart, currentMinimumStep,
150 aMaterial, aParticleDef );
154 G4cout <<
" G4ErrorEnergyLoss: currentMinimumStep " <<currentMinimumStep
155 <<
" kinEnergyLoss " << kinEnergyLoss
156 <<
" kinEnergyStart " << kinEnergyStart <<
G4endl;
158 if( kinEnergyLoss / kinEnergyStart > theStepLimit ) {
159 Step = theStepLimit / (kinEnergyLoss / kinEnergyStart) * currentMinimumStep;
162 G4cout <<
" G4ErrorEnergyLoss: limiting Step " << Step
163 <<
" energy loss fraction " << kinEnergyLoss / kinEnergyStart
164 <<
" > " << theStepLimit <<
G4endl;
@ G4ErrorMode_PropForwards
@ G4ErrorMode_PropBackwards
G4GLOB_DLL std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
G4double GetContinuousStepLimit(const G4Track &aTrack, G4double, G4double currentMinimumStep, G4double &) override
G4VParticleChange * AlongStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4ErrorEnergyLoss(const G4String &processName="G4ErrorEnergyLoss", G4ProcessType type=fElectromagnetic)
virtual ~G4ErrorEnergyLoss()
static G4ErrorPropagatorData * GetErrorPropagatorData()
G4ErrorMode GetMode() const
const G4String & GetName() const
void ProposeEnergy(G4double finalEnergy)
virtual void Initialize(const G4Track &)
const G4String & GetParticleName() const
G4double GetStepLength() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
const G4String & GetProcessName() const