23 #include "Randomize.hh"
24 #include "G4PhysicalConstants.hh"
25 #include "G4SystemOfUnits.hh"
26 #include "G4ParticleChangeForLoss.hh"
27 #include "G4Electron.hh"
28 #include "G4DynamicParticle.hh"
29 #include "G4ProductionCutsTable.hh"
30 #include "G4MaterialCutsCouple.hh"
42 G4VEmFluctuationModel(nam),
47 beta2lim(betalim * betalim),
48 bg2lim(beta2lim * (1.0 + beta2lim)) {
52 }
else if (
nmpl < 1) {
60 G4cout <<
"### Monopole ionisation model with d-electron production, Gmag= " <<
magCharge / eplus << G4endl;
80 SetLowEnergyLimit(emin);
81 SetHighEnergyLimit(emax);
95 dedx0 =
new std::vector<G4double>;
97 G4ProductionCutsTable* theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
98 G4int numOfCouples = theCoupleTable->GetTableSize();
100 if (
n < numOfCouples) {
101 dedx0->resize(numOfCouples);
103 G4Pow* g4calc = G4Pow::GetInstance();
106 for (G4int
i = 0;
i < numOfCouples; ++
i) {
107 const G4Material* material = theCoupleTable->GetMaterialCutsCouple(
i)->GetMaterial();
108 G4double eDensity = material->GetElectronDensity();
109 G4double vF2 = 2 * electron_Compton_length * g4calc->A13(3. *
pi *
pi * eDensity);
118 return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
124 const G4ParticleDefinition*
p,
125 G4double kineticEnergy,
132 cutEnergy =
std::max(LowEnergyLimit(), cutEnergy);
133 G4double
tau = kineticEnergy /
mass;
134 G4double gam =
tau + 1.0;
135 G4double bg2 =
tau * (
tau + 2.0);
136 G4double beta2 = bg2 / (gam * gam);
140 G4double dedx = (*dedx0)[CurrentCouple()->GetIndex()] *
beta;
149 G4double dedx1 = (*dedx0)[CurrentCouple()->GetIndex()] *
betalow;
155 dedx = (kapa1 * dedx1 + kapa2 * dedx2) / (kapa1 + kapa2);
165 G4double cutEnergy) {
166 G4double eDensity = material->GetElectronDensity();
167 G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
170 G4double dedx = 0.5 * (G4Log(2.0 * electron_mass_c2 * bg2 * cutEnergy / (eexc * eexc)) - 1.0);
179 const G4double
B[7] = {0.0, 0.248, 0.672, 1.022, 1.243, 1.464, 1.685};
181 dedx += 0.5 *
k -
B[
nmpl];
185 dedx -= material->GetIonisation()->DensityCorrection(
x);
197 G4double kineticEnergy,
199 G4double maxKinEnergy) {
205 G4double cutEnergy =
std::max(LowEnergyLimit(),
cut);
214 G4double kineticEnergy,
226 const G4MaterialCutsCouple*,
227 const G4DynamicParticle*
dp,
228 G4double minKinEnergy,
230 G4double kineticEnergy =
dp->GetKineticEnergy();
234 if (minKinEnergy >= maxKinEnergy) {
242 G4double totEnergy = kineticEnergy +
mass;
243 G4double etot2 = totEnergy * totEnergy;
244 G4double beta2 = kineticEnergy * (kineticEnergy + 2.0 *
mass) / etot2;
247 G4double
q = G4UniformRand();
248 G4double deltaKinEnergy = minKinEnergy * maxKinEnergy / (minKinEnergy * (1.0 -
q) + maxKinEnergy *
q);
251 G4double totMomentum = totEnergy *
sqrt(beta2);
252 G4double deltaMomentum =
sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0 * electron_mass_c2));
253 G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) / (deltaMomentum * totMomentum);
256 G4double sint =
sqrt((1.0 - cost) * (1.0 + cost));
258 G4double
phi = twopi * G4UniformRand();
260 G4ThreeVector deltaDirection(sint *
cos(
phi), sint *
sin(
phi), cost);
261 const G4ThreeVector& direction =
dp->GetMomentumDirection();
262 deltaDirection.rotateUz(direction);
265 G4DynamicParticle*
delta =
new G4DynamicParticle(
theElectron, deltaDirection, deltaKinEnergy);
267 vdp->push_back(
delta);
270 kineticEnergy -= deltaKinEnergy;
271 G4ThreeVector finalP = direction * totMomentum - deltaDirection * deltaMomentum;
272 finalP = finalP.unit();
281 const G4DynamicParticle*
dp,
286 G4double loss = meanLoss;
288 G4double twomeanLoss = meanLoss + meanLoss;
290 if (twomeanLoss < siga) {
293 loss = twomeanLoss * G4UniformRand();
294 x = (loss - meanLoss) / siga;
296 }
while (1.0 - 0.5 *
x *
x < G4UniformRand());
299 loss = G4RandGauss::shoot(meanLoss, siga);
301 }
while (0.0 > loss || loss > twomeanLoss);
309 const G4DynamicParticle*
dp,
313 G4double
tau =
dp->GetKineticEnergy() /
mass;
315 G4double electronDensity = material->GetElectronDensity();
316 G4double gam =
tau + 1.0;
317 G4double invbeta2 = (gam * gam) / (
tau * (
tau + 2.0));
318 siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 *
tmax * length * electronDensity *
chargeSquare;
326 G4double
tau = kinEnergy /
mass;
327 return 2.0 * electron_mass_c2 *
tau * (
tau + 2.);