24 #include "Randomize.hh" 25 #include "G4PhysicalConstants.hh" 26 #include "G4SystemOfUnits.hh" 27 #include "G4ParticleChangeForLoss.hh" 28 #include "G4Electron.hh" 29 #include "G4DynamicParticle.hh" 30 #include "G4ProductionCutsTable.hh" 31 #include "G4MaterialCutsCouple.hh" 43 : G4VEmModel(nam),G4VEmFluctuationModel(nam),
48 beta2lim(betalim*betalim),
49 bg2lim(beta2lim*(1.0 + beta2lim))
59 G4cout <<
"### Monopole ionisation model with d-electron production, Gmag= " 60 << magCharge/eplus << G4endl;
69 if(IsMaster()) {
delete dedx0; }
82 SetLowEnergyLimit(emin);
83 SetHighEnergyLimit(emax);
95 if(!
dedx0) {
dedx0 =
new std::vector<G4double>; }
96 G4ProductionCutsTable* theCoupleTable=
97 G4ProductionCutsTable::GetProductionCutsTable();
98 G4int numOfCouples = theCoupleTable->GetTableSize();
100 if(n < numOfCouples) {
dedx0->resize(numOfCouples); }
101 G4Pow* g4calc = G4Pow::GetInstance();
104 for(G4int
i=0;
i<numOfCouples; ++
i) {
106 const G4Material* material =
107 theCoupleTable->GetMaterialCutsCouple(
i)->GetMaterial();
108 G4double eDensity = material->GetElectronDensity();
109 G4double vF = electron_Compton_length*g4calc->A13(3.*
pi*
pi*eDensity);
111 (G4Log(2*vF/fine_structure_const) - 0.5)/vF;
120 const G4MaterialCutsCouple* couple)
122 return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
129 const G4ParticleDefinition*
p,
130 G4double kineticEnergy,
135 G4double cutEnergy =
std::min(tmax, maxEnergy);
136 cutEnergy =
std::max(LowEnergyLimit(), cutEnergy);
137 G4double
tau = kineticEnergy /
mass;
138 G4double gam = tau + 1.0;
139 G4double bg2 = tau * (tau + 2.0);
140 G4double beta2 = bg2 / (gam * gam);
144 G4double dedx = (*dedx0)[CurrentCouple()->GetIndex()]*
beta;
154 G4double dedx1 = (*dedx0)[CurrentCouple()->GetIndex()]*
betalow;
158 G4double kapa2 = beta -
betalow;
160 dedx = (kapa1*dedx1 + kapa2*dedx2)/(kapa1 + kapa2);
173 G4double eDensity = material->GetElectronDensity();
174 G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
178 0.5*(G4Log(2.0*electron_mass_c2*bg2*cutEnergy/(eexc*eexc)) -1.0);
182 if(
nmpl > 1) { k = 0.346; }
185 const G4double
B[7] = { 0.0, 0.248, 0.672, 1.022, 1.243, 1.464, 1.685};
187 dedx += 0.5 * k - B[
nmpl];
191 dedx -= material->GetIonisation()->DensityCorrection(x);
204 const G4ParticleDefinition*
p,
205 G4double kineticEnergy,
207 G4double maxKinEnergy)
212 G4double cutEnergy =
std::max(LowEnergyLimit(), cut);
222 const G4ParticleDefinition*
p,
223 G4double kineticEnergy,
224 G4double
Z, G4double,
237 const G4MaterialCutsCouple*,
238 const G4DynamicParticle* dp,
239 G4double minKinEnergy,
242 G4double kineticEnergy = dp->GetKineticEnergy();
245 G4double maxKinEnergy =
std::min(maxEnergy,tmax);
246 if(minKinEnergy >= maxKinEnergy) {
return; }
252 G4double totEnergy = kineticEnergy +
mass;
253 G4double etot2 = totEnergy*totEnergy;
254 G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*
mass)/etot2;
257 G4double
q = G4UniformRand();
258 G4double deltaKinEnergy = minKinEnergy*maxKinEnergy
259 /(minKinEnergy*(1.0 -
q) + maxKinEnergy*q);
262 G4double totMomentum = totEnergy*
sqrt(beta2);
263 G4double deltaMomentum =
264 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
265 G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
266 (deltaMomentum * totMomentum);
269 G4double sint =
sqrt((1.0 - cost)*(1.0 + cost));
271 G4double
phi = twopi * G4UniformRand() ;
273 G4ThreeVector deltaDirection(sint*
cos(phi),sint*
sin(phi), cost);
274 const G4ThreeVector& direction = dp->GetMomentumDirection();
275 deltaDirection.rotateUz(direction);
278 G4DynamicParticle*
delta =
279 new G4DynamicParticle(
theElectron,deltaDirection,deltaKinEnergy);
281 vdp->push_back(delta);
284 kineticEnergy -= deltaKinEnergy;
285 G4ThreeVector finalP = direction*totMomentum - deltaDirection*deltaMomentum;
286 finalP = finalP.unit();
295 const G4MaterialCutsCouple* couple,
296 const G4DynamicParticle* dp,
302 G4double loss = meanLoss;
304 G4double twomeanLoss = meanLoss + meanLoss;
306 if(twomeanLoss < siga) {
309 loss = twomeanLoss*G4UniformRand();
310 x = (loss - meanLoss)/siga;
312 }
while (1.0 - 0.5*x*x < G4UniformRand());
315 loss = G4RandGauss::shoot(meanLoss,siga);
317 }
while (0.0 > loss || loss > twomeanLoss);
326 const G4DynamicParticle* dp,
331 G4double
tau = dp->GetKineticEnergy()/
mass;
333 G4double electronDensity = material->GetElectronDensity();
334 G4double gam = tau + 1.0;
335 G4double invbeta2 = (gam*gam)/(tau * (tau+2.0));
336 siga = (invbeta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
349 return 2.0*electron_mass_c2*tau*(tau + 2.);
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
const G4ParticleDefinition * monopole
G4double ComputeDEDXAhlen(const G4Material *material, G4double bg2, G4double cut)
Sin< T >::type sin(const T &t)
CMSmplIonisationWithDeltaModel(G4double mCharge, const G4String &nam="mplIonisationWithDelta")
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
static std::vector< G4double > * dedx0
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
void SetParticle(const G4ParticleDefinition *p)
G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmax, G4double length, G4double meanLoss) override
Cos< T >::type cos(const T &t)
G4ParticleDefinition * theElectron
Abs< T >::type abs(const T &t)
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
static const std::string B
~CMSmplIonisationWithDeltaModel() override
G4ParticleChangeForLoss * fParticleChange
static const double tmax[3]
G4double pi_hbarc2_over_mc2
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) override
G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double tmax, G4double length) override
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy) override
G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *couple) override
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override