66 DefineProjectileProperty();
95 adjointPrimKinEnergy, projectileKinEnergy,
103 G4double projectileTotalEnergy = projectileM0 + projectileKinEnergy;
105 projectileTotalEnergy * projectileTotalEnergy - projectileM0 * projectileM0;
114 companionM0 + projectileKinEnergy - adjointPrimKinEnergy;
116 companionTotalEnergy * companionTotalEnergy - companionM0 * companionM0;
120 (adjointPrimP * adjointPrimP + projectileP2 - companionP2) /
122 G4double P_perp = std::sqrt(projectileP2 - P_parallel * P_parallel);
126 G4ThreeVector(P_perp * std::cos(phi), P_perp * std::sin(phi), P_parallel);
127 projectileMomentum.
rotateUz(dir_parallel);
129 if(!isScatProjToProj)
162 if(!isScatProjToProj)
165 eEnergy = adjointPrimKinEnergy;
172 newCS = newCS * (b - a) / eEnergy;
184 G4double diff1 = Emin - adjointPrimKinEnergy;
185 G4double diff2 = Emax - adjointPrimKinEnergy;
187 G4double t1 = adjointPrimKinEnergy * (1. / diff1 - 1. / diff2);
188 G4double t2 = adjointPrimKinEnergy * (1. / Emin - 1. / Emax);
189 G4double t3 = 2. * std::log(Emax / Emin);
191 newCS = newCS * sum_t / adjointPrimKinEnergy / adjointPrimKinEnergy;
196 projectileKinEnergy = adjointPrimKinEnergy + 1. / (1. / diff1 - q);
201 projectileKinEnergy = 1. / (1. / Emin - q);
205 projectileKinEnergy = Emin * std::pow(Emax / Emin,
G4UniformRand());
207 eEnergy = projectileKinEnergy - adjointPrimKinEnergy;
210 G4double diffCS_perAtom_Used = twopi_mc2_rcl2 * fMass * adjointPrimKinEnergy /
211 projectileKinEnergy / projectileKinEnergy /
227 w_corr *= diffCS / diffCS_perAtom_Used;
229 if (isScatProjToProj &&
fTcutSecond>0.005) w_corr=1.;
240 G4double projectileTotalEnergy = projectileM0 + projectileKinEnergy;
242 projectileTotalEnergy * projectileTotalEnergy - projectileM0 * projectileM0;
251 companionM0 + projectileKinEnergy - adjointPrimKinEnergy;
253 companionTotalEnergy * companionTotalEnergy - companionM0 * companionM0;
257 (adjointPrimP * adjointPrimP + projectileP2 - companionP2) /
259 G4double P_perp = std::sqrt(projectileP2 - P_parallel * P_parallel);
263 G4ThreeVector(P_perp * std::cos(phi), P_perp * std::sin(phi), P_parallel);
264 projectileMomentum.
rotateUz(dir_parallel);
266 if(!isScatProjToProj)
291 if(kinEnergyProj > Emin_proj && kinEnergyProj <= Emax_proj)
296 G4double E2 = kinEnergyProd *1.0006;
298 if(kinEnergyProj > 2. * MeV)
313 dSigmadEprod = (sigma1 - sigma2) / (E2 - E1);
314 if(dSigmadEprod > 1.)
316 G4cout <<
"sigma1 " << kinEnergyProj / MeV <<
'\t' << kinEnergyProd / MeV
317 <<
'\t' << sigma1 <<
G4endl;
318 G4cout <<
"sigma2 " << kinEnergyProj / MeV <<
'\t' << kinEnergyProd / MeV
319 <<
'\t' << sigma2 <<
G4endl;
320 G4cout <<
"dsigma " << kinEnergyProj / MeV <<
'\t' << kinEnergyProd / MeV
321 <<
'\t' << dSigmadEprod <<
G4endl;
329 G4double deltaKinEnergy = kinEnergyProd;
333 G4double x = fFormFact * deltaKinEnergy;
336 G4double totEnergy = kinEnergyProj + fMass;
337 G4double etot2 = totEnergy * totEnergy;
338 G4double beta2 = kinEnergyProj * (kinEnergyProj + 2.0 * fMass) / etot2;
339 G4double f = 1.0 - beta2 * deltaKinEnergy / Tmax;
343 f1 = 0.5 * deltaKinEnergy * deltaKinEnergy / etot2;
350 G4double x2 = 0.5 * electron_mass_c2 * deltaKinEnergy / (fMass * fMass);
351 gg *= (1.0 + fMagMoment2 * (x2 - f1 / f) / (1.0 + x2));
355 G4cout <<
"### G4BetheBlochModel in Adjoint Sim WARNING: g= " << g
367void G4AdjointhIonisationModel::DefineProjectileProperty()
374 fMassRatio = electron_mass_c2 / fMass;
375 fOnePlusRatio2 = (1. + fMassRatio) * (1. + fMassRatio);
376 fOneMinusRatio2 = (1. - fMassRatio) * (1. - fMassRatio);
378 (0.5 * eplus * hbar_Planck * c_squared);
379 fMagMoment2 = magmom * magmom - 1.0;
384 if(fSpin == 0.0 && fMass < GeV)
392 fFormFact = 2.0 * electron_mass_c2 / (x * x);
409 if(!isScatProjToProj)
413 if(Emax_proj > Emin_proj && primEnergy >
fTcutSecond)
415 Cross *= (1. / Emin_proj - 1. / Emax_proj) / primEnergy;
425 G4double diff1 = Emin_proj - primEnergy;
426 G4double diff2 = Emax_proj - primEnergy;
428 (1. / diff1 + 1. / Emin_proj - 1. / diff2 - 1. / Emax_proj) / primEnergy;
430 2. * std::log(Emax_proj / Emin_proj) / primEnergy / primEnergy;
441 G4double Tmax = primAdjEnergy * fOnePlusRatio2 /
442 (fOneMinusRatio2 - 2. * fMassRatio * primAdjEnergy / fMass);
450 return primAdjEnergy + tcut;
464 (2. * primAdjEnergy - 4. * fMass +
465 std::sqrt(4. * primAdjEnergy * primAdjEnergy + 16. * fMass * fMass +
466 8. * primAdjEnergy * fMass * (1. / fMassRatio + fMassRatio))) /
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetPostStepWeightCorrection()
static G4AdjointCSManager * GetAdjointCSManager()
static G4AdjointElectron * AdjointElectron()
static G4AdjointProton * AdjointProton()
G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj) override
G4double GetSecondAdjEnergyMinForScatProjToProj(G4double primAdjEnergy, G4double tcut=0.) override
G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.) override
void RapidSampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange)
G4double GetSecondAdjEnergyMaxForScatProjToProj(G4double primAdjEnergy) override
void SampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange) override
~G4AdjointhIonisationModel() override
G4double GetSecondAdjEnergyMinForProdToProj(G4double primAdjEnergy) override
G4AdjointhIonisationModel(G4ParticleDefinition *pDef)
G4double GetSecondAdjEnergyMaxForProdToProj(G4double primAdjEnergy) override
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetTotalMomentum() const
G4double GetElectronDensity() const
G4double GetZ13(G4double Z) const
static G4NistManager * Instance()
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGMagneticMoment() const
G4double GetPDGMass() const
G4int GetLeptonNumber() const
const G4String & GetParticleName() const
G4double GetPDGSpin() const
static G4Proton * Proton()
G4double GetWeight() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4bool fSecondPartSameType
G4ParticleDefinition * fAdjEquivDirectSecondPart
G4ParticleDefinition * fAdjEquivDirectPrimPart
G4Material * fCurrentMaterial
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool isScatProjToProj)
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
G4bool fUseMatrixPerElement
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj)
G4VEmModel * fDirectModel
G4ParticleDefinition * fDirectPrimaryPart
G4bool fOneMatrixForAllElements
G4double SampleAdjSecEnergyFromCSMatrix(std::size_t MatrixIndex, G4double prim_energy, G4bool isScatProjToProj)
G4double GetHighEnergyLimit()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)