58void G4AdjointBremsstrahlungModel::Initialize()
81 if(fEmModelManagerForFwdModels)
82 delete fEmModelManagerForFwdModels;
109 adjointPrimKinEnergy, projectileKinEnergy,
114 G4double projectileTotalEnergy = projectileM0 + projectileKinEnergy;
116 projectileTotalEnergy * projectileTotalEnergy - projectileM0 * projectileM0;
117 G4double projectileP = std::sqrt(projectileP2);
127 G4double theta = u * electron_mass_c2 / projectileTotalEnergy;
134 G4ThreeVector(std::cos(phi) * sint, std::sin(phi) * sint, cost) *
139 (projectileTotalEnergy - adjointPrimTotalEnergy) *
142 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
143 G4double sint1 = std::sqrt(1. - cost1 * cost1);
145 G4ThreeVector(std::cos(phi) * sint1, std::sin(phi) * sint1, cost1) *
151 if(!isScatProjToProj)
183 if(!isScatProjToProj)
185 gammaEnergy = adjointPrimKinEnergy;
190 projectileKinEnergy = Emin * std::pow(Emax / Emin,
G4UniformRand());
201 G4double f1 = (Emin - adjointPrimKinEnergy) / Emin;
202 G4double f2 = (Emax - adjointPrimKinEnergy) / Emax / f1;
203 projectileKinEnergy =
204 adjointPrimKinEnergy / (1. - f1 * std::pow(f2,
G4UniformRand()));
205 gammaEnergy = projectileKinEnergy - adjointPrimKinEnergy;
207 fLastCZ * adjointPrimKinEnergy / projectileKinEnergy / gammaEnergy;
230 w_corr *= diffCS / diffCSUsed;
239 G4double projectileTotalEnergy = projectileM0 + projectileKinEnergy;
241 projectileTotalEnergy * projectileTotalEnergy - projectileM0 * projectileM0;
242 G4double projectileP = std::sqrt(projectileP2);
262 (projectileTotalEnergy - adjointPrimTotalEnergy) *
265 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
266 G4double sint1 = std::sqrt(1. - cost1 * cost1);
268 G4ThreeVector(std::cos(phi) * sint1, std::sin(phi) * sint1, cost1) *
274 if(!isScatProjToProj)
294 if(!fIsDirectModelInitialised)
296 fEmModelManagerForFwdModels->
Initialise(fElectron, fGamma, 0);
297 fIsDirectModelInitialised =
true;
300 aMaterial, kinEnergyProj, kinEnergyProd);
308 static constexpr G4double maxEnergy = 100. * MeV / 2.718281828459045;
310 if(!fIsDirectModelInitialised)
312 fEmModelManagerForFwdModels->
Initialise(fElectron, fGamma, 0);
313 fIsDirectModelInitialised =
true;
324 if(!isScatProjToProj)
328 if(Emax_proj > Emin_proj && primEnergy >
fTcutSecond)
336 if(Emax_proj > Emin_proj)
337 Cross = fLastCZ * std::log((Emax_proj - primEnergy) * Emin_proj /
338 Emax_proj / (Emin_proj - primEnergy));
CLHEP::Hep3Vector G4ThreeVector
double angle(const Hep3Vector &) const
Hep3Vector & rotateUz(const Hep3Vector &)
~G4AdjointBremsstrahlungModel() override
void SampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange) override
G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd) override
G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj) override
void RapidSampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange)
G4AdjointBremsstrahlungModel()
G4double GetPostStepWeightCorrection()
static G4AdjointCSManager * GetAdjointCSManager()
static G4AdjointElectron * AdjointElectron()
static G4AdjointGamma * AdjointGamma()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
static G4Electron * Electron()
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fm, const G4Region *r)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4int verb)
const G4Material * GetMaterial() const
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGMass() const
G4double GetWeight() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double fOutsideWeightFactor
virtual G4double GetSecondAdjEnergyMaxForProdToProj(G4double primAdjEnergy)
void SetUseMatrixPerElement(G4bool aBool)
G4bool fSecondPartSameType
G4double fCsBiasingFactor
G4ParticleDefinition * fAdjEquivDirectSecondPart
void SetUseMatrix(G4bool aBool)
G4bool fInModelWeightCorr
virtual G4double GetSecondAdjEnergyMinForScatProjToProj(G4double primAdjEnergy, G4double tcut=0.)
G4ParticleDefinition * fAdjEquivDirectPrimPart
G4MaterialCutsCouple * fCurrentCouple
virtual G4double GetSecondAdjEnergyMaxForScatProjToProj(G4double primAdjEnergy)
G4Material * fCurrentMaterial
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool isScatProjToProj)
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj)
G4VEmModel * fDirectModel
virtual G4double GetSecondAdjEnergyMinForProdToProj(G4double primAdjEnergy)
G4ParticleDefinition * fDirectPrimaryPart
G4double SampleAdjSecEnergyFromCSMatrix(std::size_t MatrixIndex, G4double prim_energy, G4bool isScatProjToProj)
G4double GetHighEnergyLimit()
void SetApplyCutInRange(G4bool aBool)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)