79 currentMaterial(nullptr),
80 baseMaterial(nullptr),
82 twoln10(2.0*
G4Log(10.0)),
83 fAlphaTlimit(
CLHEP::GeV),
84 fProtonTlimit(10*
CLHEP::GeV),
88 fParticleChange =
nullptr;
90 SetParticle(theElectron);
121 if(
nullptr == fParticleChange) {
155void G4BetheBlochModel::SetupParameters()
161 corrFactor = chargeSquare;
162 ratio = electron_mass_c2/mass;
163 static const G4double aMag = 1./(0.5*eplus*hbar_Planck*c_squared);
165 magMoment2 = magmom*magmom - 1.0;
171 formfact = (spin == 0.0 && mass < GeV) ? 1.181e-6 : 1.548e-6;
174 formfact = 3.969e-6*x*x;
176 tlimit = std::sqrt(0.414/formfact +
177 electron_mass_c2*electron_mass_c2) - electron_mass_c2;
199 G4double maxEnergy = std::min(tmax,maxKinEnergy);
200 if(cutEnergy < maxEnergy) {
202 G4double totEnergy = kineticEnergy + mass;
203 G4double energy2 = totEnergy*totEnergy;
204 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
206 cross = (maxEnergy - cutEnergy)/(cutEnergy*maxEnergy)
207 - beta2*
G4Log(maxEnergy/cutEnergy)/tmax;
210 if( 0.0 < spin ) { cross += 0.5*(maxEnergy - cutEnergy)/energy2; }
212 cross *= twopi_mc2_rcl2*chargeSquare/beta2;
255 G4double cutEnergy = std::min(cut,tmax);
270 if(material != currentMaterial) {
271 currentMaterial = material;
274 iICRU90 = fICRU90->
GetIndex(baseMaterial);
277 G4double e = kineticEnergy*proton_mass_c2/mass;
279 if(chargeSquare > 1.1 && e < fAlphaTlimit) {
282 }
else if(chargeSquare < 1.1 && e < fProtonTlimit) {
286 if(cutEnergy < tmax) {
287 dedx += (
G4Log(xc) + (1.0 - xc)*beta2)*twopi_mc2_rcl2
289 return std::max(chargeSquare*dedx, 0.0);
294 G4double dedx =
G4Log(2.0*electron_mass_c2*bg2*cutEnergy/eexc2)
298 G4double del = 0.5*cutEnergy/(kineticEnergy + mass);
310 dedx *= twopi_mc2_rcl2*chargeSquare*eDensity/beta2;
319 dedx = std::max(dedx, 0.0);
339 G4double e = preKinEnergy - eloss*0.5;
340 if(e < preKinEnergy*0.75) { e = preKinEnergy*0.75; }
349 if(!fICRU90 || fICRU90->
GetIndex(baseMaterial) < 0) {
352 G4double elossnew = eloss*qfactor + highOrder;
353 eloss = std::max(std::min(elossnew,preKinEnergy),eloss*0.5);
372 G4double maxKinEnergy = std::min(maxEnergy,tmax);
373 if(minKinEnergy >= maxKinEnergy) {
return; }
378 G4double totEnergy = kineticEnergy + mass;
379 G4double etot2 = totEnergy*totEnergy;
380 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2;
385 if( 0.0 < spin ) { fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2; }
393 deltaKinEnergy = minKinEnergy*maxKinEnergy
394 /(minKinEnergy*(1.0 - rndm[0]) + maxKinEnergy*rndm[0]);
396 f = 1.0 - beta2*deltaKinEnergy/tmax;
398 f1 = 0.5*deltaKinEnergy*deltaKinEnergy/etot2;
403 }
while( fmax*rndm[1] > f);
408 G4double x = formfact*deltaKinEnergy*(deltaKinEnergy + 2*electron_mass_c2);
414 G4double x2 = 0.5*electron_mass_c2*deltaKinEnergy/(mass*mass);
415 grej *= (1.0 + magMoment2*(x2 - f1/f)/(1.0 + x2));
418 G4cout <<
"### G4BetheBlochModel WARNING: grej= " << grej
420 <<
" Ekin(MeV)= " << kineticEnergy
421 <<
" delEkin(MeV)= " << deltaKinEnergy
424 if(rndmEngineMod->
flat() > grej) {
return; }
440 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
441 G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
443 if(cost > 1.0) { cost = 1.0; }
444 G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
448 deltaDirection.
set(sint*cos(phi),sint*sin(phi), cost) ;
466 vdp->push_back(delta);
469 kineticEnergy -= deltaKinEnergy;
471 finalP = finalP.
unit();
485 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
486 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
487 return std::min(tmax,tlimit);
G4double G4Log(G4double x)
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
virtual void flatArray(const int size, double *vect)=0
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double &eloss, G4double &, G4double length) override
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
virtual G4double GetParticleCharge(const G4ParticleDefinition *p, const G4Material *mat, G4double kineticEnergy) override
virtual ~G4BetheBlochModel()
G4double GetChargeSquareRatio() const
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) override
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy) override
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) override
G4BetheBlochModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="BetheBloch")
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
G4double GetTotalMomentum() const
static G4Electron * Electron()
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double IonHighOrderCorrections(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
G4double IonBarkasCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double HighOrderCorrections(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4double cutEnergy)
G4double ShellCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
static G4EmParameters * Instance()
G4double GetElectronicDEDXforProton(const G4Material *, G4double kinEnergy) const
G4int GetIndex(const G4Material *) const
G4double GetElectronicDEDXforAlpha(const G4Material *, G4double scaledKinEnergy) const
G4double GetMeanExcitationEnergy() const
G4double DensityCorrection(G4double x)
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
const G4Material * GetMaterial() const
G4double GetDensity() const
const G4Material * GetBaseMaterial() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const
G4ICRU90StoppingData * GetICRU90StoppingData()
G4double GetA27(G4int Z) const
static G4NistManager * Instance()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
G4double GetPDGMagneticMoment() const
G4double GetPDGMass() const
G4int GetLeptonNumber() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4double GetPDGSpin() const
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
G4VEmFluctuationModel * GetModelOfFluctuations()
G4VEmAngularDistribution * GetAngularDistribution()
G4int SelectRandomAtomNumber(const G4Material *)
void SetLowEnergyLimit(G4double)
void SetDeexcitationFlag(G4bool val)
void SetAngularDistribution(G4VEmAngularDistribution *)
G4bool UseAngularGeneratorFlag() const
G4ParticleChangeForLoss * GetParticleChangeForLoss()