79 twoln10(2.0*
G4Log(10.0)),
80 fAlphaTlimit(1*
CLHEP::GeV),
81 fProtonTlimit(10*
CLHEP::GeV)
98 if(p != particle) { SetupParameters(p); }
108 if(
nullptr == fParticleChange) {
111 (pname ==
"proton" || pname ==
"GenericIon" || pname ==
"alpha")) {
116 pname ==
"GenericIon") { isIon =
true; }
117 if(pname ==
"alpha") { isAlpha =
true; }
155 isIon = (!isAlpha && q > 1.1);
157 ratio = electron_mass_c2/mass;
158 static const G4double aMag = 1./(0.5*eplus*CLHEP::hbar_Planck*CLHEP::c_squared);
160 magMoment2 = magmom*magmom - 1.0;
165 if(spin == 0.0 && mass < CLHEP::GeV) { x = 0.736*CLHEP::GeV; }
166 else if (mass > CLHEP::GeV) {
168 if(iz > 1) { x /= nist->
GetA27(iz); }
170 formfact = 2.0*CLHEP::electron_mass_c2/(x*x);
171 tlimit = 2.0/formfact;
193 G4double maxEnergy = std::min(tmax, maxKinEnergy);
194 if(cutEnergy < maxEnergy) {
196 G4double totEnergy = kineticEnergy + mass;
197 G4double energy2 = totEnergy*totEnergy;
198 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
200 cross = (maxEnergy - cutEnergy)/(cutEnergy*maxEnergy)
201 - beta2*
G4Log(maxEnergy/cutEnergy)/tmax;
204 if( 0.0 < spin ) { cross += 0.5*(maxEnergy - cutEnergy)/energy2; }
206 cross *= CLHEP::twopi_mc2_rcl2*chargeSquare/beta2;
253 const G4double cutEnergy = std::min(std::min(cut,tmax), tlimit);
274 if(
nullptr != fICRU90 && kineticEnergy < fProtonTlimit) {
275 if(material != currentMaterial) {
276 currentMaterial = material;
279 iICRU90 = fICRU90->
GetIndex(baseMaterial);
285 if(kineticEnergy <= fAlphaTlimit) {
288 const G4double e = kineticEnergy*CLHEP::proton_mass_c2/mass;
296 if(cutEnergy < tmax) {
297 dedx += (
G4Log(xc) + (1.0 - xc)*beta2)*CLHEP::twopi_mc2_rcl2
298 *(eDensity*chargeSquare/beta2);
301 if(dedx > 0.0) {
return dedx; }
305 G4double dedx =
G4Log(2.0*CLHEP::electron_mass_c2*bg2*cutEnergy/eexc2)
309 G4double del = 0.5*cutEnergy/(kineticEnergy + mass);
321 dedx *= CLHEP::twopi_mc2_rcl2*chargeSquare*eDensity/beta2;
330 dedx = std::max(dedx, 0.0);
346 if(isAlpha) {
return; }
350 if(eloss >= preKinEnergy || eloss < preKinEnergy*0.05) {
return; }
354 if(p != particle) { SetupParameters(p); }
355 if(!isIon) {
return; }
358 const G4double e = std::max(preKinEnergy - eloss*0.5, preKinEnergy*0.5);
384 const G4double maxKinEnergy = std::min(maxEnergy,tmax);
385 if(minKinEnergy >= maxKinEnergy) {
return; }
390 const G4double totEnergy = kineticEnergy + mass;
391 const G4double etot2 = totEnergy*totEnergy;
392 const G4double beta2 = kineticEnergy*(kineticEnergy + 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)= " << kineticEnergy
433 <<
" delEkin(MeV)= " << deltaKinEnergy
436 if(rndmEngineMod->
flat() > grej) {
return; }
450 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 kineticEnergy -= 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 EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, 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)
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()