52 theDirectStdBremModel = aModel;
55 isDirectModelInitialised =
false;
58 theEmModelManagerForFwdModels->
AddEmModel(1, theDirectStdBremModel, f, r);
61 highKinEnergy= 1.*
GeV;
62 lowKinEnergy = 1.0*
keV;
99 isDirectModelInitialised =
false;
102 theEmModelManagerForFwdModels->
AddEmModel(1, theDirectStdBremModel, f, r);
105 highKinEnergy= 1.*
GeV;
106 lowKinEnergy = 1.0*
keV;
117 {
if (theDirectStdBremModel)
delete theDirectStdBremModel;
118 if (theEmModelManagerForFwdModels)
delete theEmModelManagerForFwdModels;
124 G4bool IsScatProjToProjCase,
141 IsScatProjToProjCase);
146 adjointPrimKinEnergy,
148 IsScatProjToProjCase);
154 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
155 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
156 G4double projectileP = std::sqrt(projectileP2);
162 const G4double a1 = 0.625 , a2 = 3.*a1 ,
d = 27. ;
175 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint,std::sin(phi)*sint,cost)*projectileP;
176 if (IsScatProjToProjCase) {
179 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
180 G4double sint1 = std::sqrt(1.-cost1*cost1);
181 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
189 if (!IsScatProjToProjCase ){
202 G4bool IsScatProjToProjCase,
220 if (!IsScatProjToProjCase){
221 gammaEnergy=adjointPrimKinEnergy;
224 if (Emin>=Emax)
return;
225 projectileKinEnergy=Emin*std::pow(Emax/Emin,
G4UniformRand());
231 if (Emin>=Emax)
return;
233 G4double f2=(Emax-adjointPrimKinEnergy)/Emax/f1;
235 projectileKinEnergy=adjointPrimKinEnergy/(1.-f1*std::pow(f2,
G4UniformRand()));
236 gammaEnergy=projectileKinEnergy-adjointPrimKinEnergy;
237 diffCSUsed=lastCZ*adjointPrimKinEnergy/projectileKinEnergy/gammaEnergy;
254 w_corr*=diffCS/diffCSUsed;
264 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
265 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
266 G4double projectileP = std::sqrt(projectileP2);
272 const G4double a1 = 0.625 , a2 = 3.*a1 ,
d = 27. ;
285 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint,std::sin(phi)*sint,cost)*projectileP;
286 if (IsScatProjToProjCase) {
289 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
290 G4double sint1 = std::sqrt(1.-cost1*cost1);
291 projectileMomentum=
G4ThreeVector(std::cos(phi)*sint1,std::sin(phi)*sint1,cost1)*projectileP;
299 if (!IsScatProjToProjCase ){
315 {
if (!isDirectModelInitialised) {
317 isDirectModelInitialised =
true;
349 if (kinEnergyProj>Emin_proj && kinEnergyProj<=Emax_proj){
351 dCrossEprod=sigma/kinEnergyProd/std::log(kinEnergyProj/
keV);
373 G4double E1=kinEnergyProd,E2=kinEnergyProd*1.001;
378 dCrossEprod += theAtomNumDensityVector[i] * (C1-C2)/dE;
402 G4bool IsScatProjToProjCase)
403 {
if (!isDirectModelInitialised) {
405 isDirectModelInitialised =
true;
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)
static G4AdjointGamma * AdjointGamma()
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
std::vector< G4Element * > G4ElementVector
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
double angle(const Hep3Vector &) const
~G4AdjointBremsstrahlungModel()
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetTotalEnergy() const
G4double GetPostStepWeightCorrection()
const G4DynamicParticle * GetDynamicParticle() const
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
G4ParticleDefinition * theDirectPrimaryPartDef
void ProposeParentWeight(G4double finalWeight)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
static G4AdjointElectron * AdjointElectron()
G4double CS_biasing_factor
G4Material * currentMaterial
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
const G4ElementVector * GetElementVector() const
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
void SetUseMatrixPerElement(G4bool aBool)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4VEmModel * theDirectEMModel
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector & rotateUz(const Hep3Vector &)
void RapidSampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
G4AdjointBremsstrahlungModel()
void SetUseMatrix(G4bool aBool)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4double * GetAtomicNumDensityVector() const
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4double DiffCrossSectionPerVolumePrimToSecondApproximated2(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4double GetPDGMass() const
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
void ProposeEnergy(G4double finalEnergy)
void AddSecondary(G4Track *aSecondary)
G4double GetWeight() const
G4double DiffCrossSectionPerVolumePrimToSecondApproximated1(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
static G4Electron * Electron()
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
size_t GetNumberOfElements() const
G4double currentTcutForDirectSecond
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void SetApplyCutInRange(G4bool aBool)
void ProposeTrackStatus(G4TrackStatus status)
static G4AdjointCSManager * GetAdjointCSManager()
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
const G4Material * GetMaterial() const
G4bool second_part_of_same_type