112 G4bool IsScatProjToProjCase,
129 IsScatProjToProjCase);
134 adjointPrimKinEnergy,
136 IsScatProjToProjCase);
142 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
143 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
144 G4double projectileP = std::sqrt(projectileP2);
150 const G4double a1 = 0.625 , a2 = 3.*a1 ,
d = 27. ;
163 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint,std::sin(phi)*sint,cost)*projectileP;
164 if (IsScatProjToProjCase) {
167 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
168 G4double sint1 = std::sqrt(1.-cost1*cost1);
169 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
177 if (!IsScatProjToProjCase ){
190 G4bool IsScatProjToProjCase,
208 if (!IsScatProjToProjCase){
209 gammaEnergy=adjointPrimKinEnergy;
212 if (Emin>=Emax)
return;
213 projectileKinEnergy=Emin*std::pow(Emax/Emin,
G4UniformRand());
219 if (Emin>=Emax)
return;
221 G4double f2=(Emax-adjointPrimKinEnergy)/Emax/f1;
222 projectileKinEnergy=adjointPrimKinEnergy/(1.-f1*std::pow(f2,
G4UniformRand()));
223 gammaEnergy=projectileKinEnergy-adjointPrimKinEnergy;
224 diffCSUsed=
lastCZ*adjointPrimKinEnergy/projectileKinEnergy/gammaEnergy;
253 w_corr*=diffCS/diffCSUsed;
266 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
267 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
268 G4double projectileP = std::sqrt(projectileP2);
303 if (IsScatProjToProjCase) {
306 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
307 G4double sint1 = std::sqrt(1.-cost1*cost1);
308 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
313 if (!IsScatProjToProjCase ){
363 if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){
365 dCrossEprod=sigma/kinEnergyProd/std::log(kinEnergyProj/
keV);
387 G4double E1=kinEnergyProd,E2=kinEnergyProd*1.001;
392 dCrossEprod += theAtomNumDensityVector[i] * (C1-
C2)/dE;
402 G4bool IsScatProjToProjCase)
412 if (!IsScatProjToProjCase ){
420 if (Emax_proj>Emin_proj) Cross=
lastCZ*std::log((Emax_proj-primEnergy)*Emin_proj/Emax_proj/(Emin_proj-primEnergy));
428 G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
static const G4double Emin
G4bool second_part_of_same_type
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
CLHEP::Hep3Vector G4ThreeVector
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
static constexpr double MeV
G4double CS_biasing_factor
void SetApplyCutInRange(G4bool aBool)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
static constexpr double keV
G4EmModelManager * theEmModelManagerForFwdModels
G4Material * currentMaterial
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
const G4ThreeVector & GetMomentumDirection() const
const G4ElementVector * GetElementVector() const
static G4AdjointElectron * AdjointElectron()
void SetSecondaryWeightByProcess(G4bool)
Hep3Vector & rotateUz(const Hep3Vector &)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void RapidSampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
G4double DiffCrossSectionPerVolumePrimToSecondApproximated2(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4double GetPDGMass() const
G4double additional_weight_correction_factor_for_post_step_outside_model
void AddSecondary(G4Track *aSecondary)
static G4AdjointGamma * AdjointGamma()
G4double currentTcutForDirectSecond
G4MaterialCutsCouple * currentCouple
G4double GetWeight() const
double angle(const Hep3Vector &) const
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4VEmModel * theDirectStdBremModel
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
~G4AdjointBremsstrahlungModel()
static constexpr double electron_mass_c2
G4double GetPostStepWeightCorrection()
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
static constexpr double twopi
void ProposeEnergy(G4double finalEnergy)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
static G4Electron * Electron()
static G4AdjointCSManager * GetAdjointCSManager()
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4bool correct_weight_for_post_step_in_model
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
G4AdjointBremsstrahlungModel()
G4VEmModel * theDirectEMModel
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
std::vector< G4Element * > G4ElementVector
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
static const G4double Emax
G4double GetKineticEnergy() const
G4bool isDirectModelInitialised
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
G4VEmAngularDistribution * GetAngularDistribution()
const G4Material * GetMaterial() const
const G4double * GetAtomicNumDensityVector() const
G4double GetTotalEnergy() const
G4ParticleDefinition * theDirectPrimaryPartDef
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
void SetUseMatrixPerElement(G4bool aBool)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
void ProposeTrackStatus(G4TrackStatus status)
static constexpr double GeV
const G4DynamicParticle * GetDynamicParticle() const
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
size_t GetNumberOfElements() const
G4double DiffCrossSectionPerVolumePrimToSecondApproximated1(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
void SetUseMatrix(G4bool aBool)
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)