51 theDirectStdBremModel = aModel;
54 isDirectModelInitialised =
false;
57 theEmModelManagerForFwdModels->
AddEmModel(1, theDirectStdBremModel, f, r);
60 highKinEnergy= 1.*GeV;
61 lowKinEnergy = 1.0*keV;
87 isDirectModelInitialised =
false;
90 theEmModelManagerForFwdModels->
AddEmModel(1, theDirectStdBremModel, f, r);
93 highKinEnergy= 1.*GeV;
94 lowKinEnergy = 1.0*keV;
104{
if (theDirectStdBremModel)
delete theDirectStdBremModel;
105 if (theEmModelManagerForFwdModels)
delete theEmModelManagerForFwdModels;
111 G4bool IsScatProjToProjCase,
128 IsScatProjToProjCase);
133 adjointPrimKinEnergy,
135 IsScatProjToProjCase);
141 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
142 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
143 G4double projectileP = std::sqrt(projectileP2);
149 const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ;
154 G4double theta = u*electron_mass_c2/projectileTotalEnergy;
162 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint,std::sin(phi)*sint,cost)*projectileP;
163 if (IsScatProjToProjCase) {
166 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
167 G4double sint1 = std::sqrt(1.-cost1*cost1);
168 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
176 if (!IsScatProjToProjCase ){
189 G4bool IsScatProjToProjCase,
207 if (!IsScatProjToProjCase){
208 gammaEnergy=adjointPrimKinEnergy;
211 if (Emin>=Emax)
return;
212 projectileKinEnergy=Emin*std::pow(Emax/Emin,
G4UniformRand());
218 if (Emin>=Emax)
return;
219 G4double f1=(Emin-adjointPrimKinEnergy)/Emin;
220 G4double f2=(Emax-adjointPrimKinEnergy)/Emax/f1;
221 projectileKinEnergy=adjointPrimKinEnergy/(1.-f1*std::pow(f2,
G4UniformRand()));
222 gammaEnergy=projectileKinEnergy-adjointPrimKinEnergy;
223 diffCSUsed=lastCZ*adjointPrimKinEnergy/projectileKinEnergy/gammaEnergy;
252 w_corr*=diffCS/diffCSUsed;
265 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
266 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
267 G4double projectileP = std::sqrt(projectileP2);
302 if (IsScatProjToProjCase) {
305 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
306 G4double sint1 = std::sqrt(1.-cost1*cost1);
307 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
312 if (!IsScatProjToProjCase ){
327{
if (!isDirectModelInitialised) {
329 isDirectModelInitialised =
true;
362 if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){
364 dCrossEprod=sigma/kinEnergyProd/std::log(kinEnergyProj/keV);
386 G4double E1=kinEnergyProd,E2=kinEnergyProd*1.001;
391 dCrossEprod += theAtomNumDensityVector[i] * (
C1-
C2)/dE;
401 G4bool IsScatProjToProjCase)
402{
if (!isDirectModelInitialised) {
404 isDirectModelInitialised =
true;
411 if (!IsScatProjToProjCase ){
419 if (Emax_proj>Emin_proj) Cross= lastCZ*std::log((Emax_proj-primEnergy)*Emin_proj/Emax_proj/(Emin_proj-primEnergy));
427 G4bool IsScatProjToProjCase)
std::vector< G4Element * > G4ElementVector
CLHEP::Hep3Vector G4ThreeVector
double angle(const Hep3Vector &) const
Hep3Vector & rotateUz(const Hep3Vector &)
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
~G4AdjointBremsstrahlungModel()
G4double DiffCrossSectionPerVolumePrimToSecondApproximated2(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4double DiffCrossSectionPerVolumePrimToSecondApproximated1(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
void RapidSampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4AdjointBremsstrahlungModel()
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
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 *, const G4Region *)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() 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
void SetUseMatrixPerElement(G4bool aBool)
G4VEmModel * theDirectEMModel
void SetUseMatrix(G4bool aBool)
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4bool second_part_of_same_type
G4double additional_weight_correction_factor_for_post_step_outside_model
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
G4ParticleDefinition * theDirectPrimaryPartDef
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4Material * currentMaterial
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
G4bool correct_weight_for_post_step_in_model
G4double CS_biasing_factor
G4double currentTcutForDirectSecond
G4MaterialCutsCouple * currentCouple
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
void SetApplyCutInRange(G4bool aBool)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
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)