77 twoln10(2.0*
G4Log(10.0)),
78 fAlphaTlimit(1*
CLHEP::GeV),
79 fProtonTlimit(10*
CLHEP::GeV)
96 if(p != particle) { SetupParameters(p); }
102 if(
nullptr == fParticleChange) {
105 (pname ==
"proton" || pname ==
"GenericIon" || pname ==
"alpha")) {
109 pname ==
"GenericIon") { isIon =
true; }
110 if(pname ==
"alpha") { isAlpha =
true; }
118 if(
IsMaster() &&
nullptr != fICRU90) {
130 if(isAlpha) {
return 1.0; }
153 isIon = (!isAlpha && q > 1.1);
155 ratio = electron_mass_c2/mass;
156 constexpr G4double aMag = 1./(0.5*eplus*CLHEP::hbar_Planck*CLHEP::c_squared);
158 magMoment2 = magmom*magmom - 1.0;
163 if(spin == 0.0 && mass < CLHEP::GeV) { x = 0.736*CLHEP::GeV; }
164 else if (mass > CLHEP::GeV) {
166 if(iz > 1) { x /= nist->
GetA27(iz); }
168 formfact = 2.0*CLHEP::electron_mass_c2/(x*x);
169 tlimit = 2.0/formfact;
191 const G4double cutEnergy = std::min(std::min(cut,tmax), tlimit);
192 const G4double maxEnergy = std::min(tmax, maxKinEnergy);
193 if(cutEnergy < maxEnergy) {
195 G4double totEnergy = kineticEnergy + mass;
196 G4double energy2 = totEnergy*totEnergy;
197 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
199 cross = (maxEnergy - cutEnergy)/(cutEnergy*maxEnergy)
200 - beta2*
G4Log(maxEnergy/cutEnergy)/tmax;
203 if( 0.0 < spin ) { cross += 0.5*(maxEnergy - cutEnergy)/energy2; }
205 cross *= CLHEP::twopi_mc2_rcl2*chargeSquare/beta2;
252 const G4double cutEnergy = std::min(std::min(cut,tmax), tlimit);
273 if(
nullptr != fICRU90 && kineticEnergy < fProtonTlimit) {
274 if(material != currentMaterial) {
275 currentMaterial = material;
278 iICRU90 = fICRU90->
GetIndex(baseMaterial);
284 if(kineticEnergy <= fAlphaTlimit) {
287 const G4double e = kineticEnergy*CLHEP::proton_mass_c2/mass;
295 if(cutEnergy < tmax) {
296 dedx += (
G4Log(xc) + (1.0 - xc)*beta2)*CLHEP::twopi_mc2_rcl2
297 *(eDensity*chargeSquare/beta2);
300 if(dedx > 0.0) {
return dedx; }
304 G4double dedx =
G4Log(2.0*CLHEP::electron_mass_c2*bg2*cutEnergy/eexc2)
308 G4double del = 0.5*cutEnergy/(kineticEnergy + mass);
320 dedx *= CLHEP::twopi_mc2_rcl2*chargeSquare*eDensity/beta2;
329 dedx = std::max(dedx, 0.0);
345 if(isAlpha) {
return; }
349 if(eloss >= preKinEnergy || eloss < preKinEnergy*0.05) {
return; }
353 if(p != particle) { SetupParameters(p); }
354 if(!isIon) {
return; }
357 const G4double e = std::max(preKinEnergy - eloss*0.5, preKinEnergy*0.5);
383 const G4double minKinEnergy = std::min(cut, tmax);
384 const G4double maxKinEnergy = std::min(maxEnergy, tmax);
385 if(minKinEnergy >= maxKinEnergy) {
return; }
390 const G4double totEnergy = kinEnergy + mass;
391 const G4double etot2 = totEnergy*totEnergy;
392 const G4double beta2 = kinEnergy*(kinEnergy + 2.0*mass)/etot2;
397 if( 0.0 < spin ) { fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2; }
405 deltaKinEnergy = minKinEnergy*maxKinEnergy
406 /(minKinEnergy*(1.0 - rndm[0]) + maxKinEnergy*rndm[0]);
408 f = 1.0 - beta2*deltaKinEnergy/tmax;
410 f1 = 0.5*deltaKinEnergy*deltaKinEnergy/etot2;
415 }
while( fmax*rndm[1] > f);
420 G4double x = formfact*deltaKinEnergy;
426 G4double x2 = 0.5*electron_mass_c2*deltaKinEnergy/(mass*mass);
427 grej *= (1.0 + magMoment2*(x2 - f1/f)/(1.0 + x2));
430 G4cout <<
"### G4BetheBlochModel WARNING: grej= " << grej
432 <<
" Ekin(MeV)= " << kinEnergy
433 <<
" delEkin(MeV)= " << deltaKinEnergy
436 if(rndmEngineMod->
flat() > grej) {
return; }
450 std::sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
451 G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
453 cost = std::min(cost, 1.0);
454 const G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost));
457 deltaDirection.
set(sint*std::cos(phi),sint*std::sin(phi), cost) ;
474 vdp->push_back(delta);
477 kinEnergy -= deltaKinEnergy;
479 finalP = finalP.
unit();
492 if(pd != particle) { SetupParameters(pd); }
494 return 2.0*CLHEP::electron_mass_c2*tau*(tau + 2.) /
495 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
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
void CorrectionsAlongStep(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, const G4double &length, G4double &eloss) override
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4double GetParticleCharge(const G4ParticleDefinition *p, const G4Material *mat, G4double kineticEnergy) override
G4double GetChargeSquareRatio() const
~G4BetheBlochModel() override
G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) override
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy) override
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
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 HighOrderCorrections(const G4ParticleDefinition *, const G4Material *, const G4double kineticEnergy, const G4double cutEnergy)
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, const G4double kineticEnergy)
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, const G4double kineticEnergy)
G4double ShellCorrection(const G4ParticleDefinition *, const G4Material *, const G4double kineticEnergy)
G4double IonBarkasCorrection(const G4ParticleDefinition *, const G4Material *, const 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 DensityCorrection(G4double x) const
G4double GetMeanExcitationEnergy() const
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
G4VEmAngularDistribution * GetAngularDistribution()
G4int SelectRandomAtomNumber(const G4Material *) const
void SetLowEnergyLimit(G4double)
void SetDeexcitationFlag(G4bool val)
void SetAngularDistribution(G4VEmAngularDistribution *)
G4bool UseAngularGeneratorFlag() const
G4ParticleChangeForLoss * GetParticleChangeForLoss()