73 fPostStepAdjointCS = fTotAdjointCS;
80 for(fIndexElement = 0; fIndexElement < nelm - 1; ++fIndexElement)
82 if(rand_CS < fXsec[fIndexElement])
87 G4int nShells = (*theElementVector)[fIndexElement]->GetNbOfAtomicShells();
88 rand_CS = fShellProb[fIndexElement][nShells - 1] *
G4UniformRand();
90 for(i = 0; i < nShells - 1; ++i)
92 if(rand_CS < fShellProb[fIndexElement][i])
96 electronEnergy + (*theElementVector)[fIndexElement]->GetAtomicShell(i);
103 G4double gamma = 1. + electronEnergy / electron_mass_c2;
106 G4double beta = std::sqrt(gamma * gamma - 1.) / gamma;
107 G4double b = 0.5 * gamma * (gamma - 1.) * (gamma - 2.);
109 G4double rndm, term, greject, grejsup;
111 grejsup = gamma * gamma * (1. + b - beta * b);
113 grejsup = gamma * gamma * (1. + b + beta * b);
118 cos_theta = (rndm + beta) / (rndm * beta + 1.);
119 term = 1. - beta * cos_theta;
120 greject = (1. - cos_theta * cos_theta) * (1. + b * term) / (term * term);
126 G4double sin_theta = std::sqrt(1. - cos_theta * cos_theta);
128 G4double dirx = sin_theta * std::cos(phi);
129 G4double diry = sin_theta * std::sin(phi);
132 adjoint_gammaDirection.
rotateUz(electronDirection);
136 gammaEnergy, isScatProjToProj);
156 w_corr *= fPostStepAdjointCS / fPreStepAdjointCS;
158 new_weight *= w_corr * projectileKinEnergy / adjointPrimKinEnergy;
173 if(aCouple !=
fCurrentCouple || fCurrenteEnergy != electronEnergy)
176 DefineCurrentMaterialAndElectronEnergy(aCouple, electronEnergy);
179 const G4double* theAtomNumDensityVector =
182 for(fIndexElement = 0; fIndexElement < nelm; ++fIndexElement)
185 (*theElementVector)[fIndexElement], electronEnergy) *
186 theAtomNumDensityVector[fIndexElement];
187 fXsec[fIndexElement] = fTotAdjointCS;
190 totBiasedAdjointCS = std::min(fTotAdjointCS, 0.01);
191 fFactorCSBiasing = totBiasedAdjointCS / fTotAdjointCS;
193 return totBiasedAdjointCS;
207 adjointCS += CS / gammaEnergy;
208 fShellProb[fIndexElement][0] = adjointCS;
209 for(
G4int i = 1; i < nShells; ++i)
213 if(electronEnergy < Bi1 - Bi)
215 gammaEnergy = electronEnergy + Bi;
217 gammaEnergy,
Z, 0., 0., 0.);
219 adjointCS += CS / gammaEnergy;
221 fShellProb[fIndexElement][i] = adjointCS;
223 adjointCS *= electronEnergy;
228void G4AdjointPhotoElectricModel::DefineCurrentMaterialAndElectronEnergy(
233 fCurrenteEnergy = anEnergy;
std::vector< const G4Element * > G4ElementVector
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetPostStepWeightCorrection()
static G4AdjointCSManager * GetAdjointCSManager()
static G4AdjointElectron * AdjointElectron()
static G4AdjointGamma * AdjointGamma()
void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool isScatProjToProj) override
G4AdjointPhotoElectricModel()
G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj) override
void SampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange) override
~G4AdjointPhotoElectricModel() override
G4double AdjointCrossSectionPerAtom(const G4Element *anElement, G4double electronEnergy)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4int GetNbOfAtomicShells() const
G4double GetAtomicShell(G4int index) const
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
void AddSecondary(G4Track *aSecondary)
G4double GetWeight() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4bool fSecondPartSameType
G4ParticleDefinition * fAdjEquivDirectSecondPart
void SetUseMatrix(G4bool aBool)
G4ParticleDefinition * fAdjEquivDirectPrimPart
G4MaterialCutsCouple * fCurrentCouple
G4Material * fCurrentMaterial
G4VEmModel * fDirectModel
G4ParticleDefinition * fDirectPrimaryPart
void SetApplyCutInRange(G4bool aBool)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetCurrentCouple(const G4MaterialCutsCouple *)
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)