33 #include "G4TrackStatus.hh" 34 #include "G4ParticleChange.hh" 72 G4bool IsScatProjToProjCase,
73 G4ParticleChange* fParticleChange)
74 {
if (IsScatProjToProjCase) return ;
103 for (i=0; i<nShells-1; i++){
117 G4double beta = std::sqrt(gamma*gamma-1.)/gamma;
118 G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
121 if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*
b);
122 else grejsup = gamma*gamma*(1.+b+beta*
b);
125 cos_theta = (rndm+beta)/(rndm*beta+1.);
126 term = 1.-beta*cos_theta;
127 greject = (1.-cos_theta*cos_theta)*(1.+b*term)/(term*term);
136 G4double sin_theta = std::sqrt(1.-cos_theta*cos_theta);
138 G4double dirx = sin_theta*std::cos(Phi),diry = sin_theta*std::sin(Phi),dirz = cos_theta;
140 adjoint_gammaDirection.
rotateUz(electronDirection);
146 CorrectPostStepWeight(fParticleChange, aTrack.GetWeight(), electronEnergy,gammaEnergy,IsScatProjToProjCase);
159 fParticleChange->ProposeTrackStatus(fStopAndKill);
160 fParticleChange->AddSecondary(anAdjointGamma);
182 new_weight*=projectileKinEnergy/adjointPrimKinEnergy;
183 fParticleChange->SetParentWeightByProcess(
false);
184 fParticleChange->SetSecondaryWeightByProcess(
false);
185 fParticleChange->ProposeParentWeight(new_weight);
193 G4bool IsScatProjToProjCase)
197 if (IsScatProjToProjCase)
return 0.;
228 G4bool IsScatProjToProjCase)
240 G4double gammaEnergy = electronEnergy+B0;
243 if (CS >0) adjointCS += CS/gammaEnergy;
245 for (i=1;i<nShells;i++){
250 if (electronEnergy <Bi_-Bi) {
251 gammaEnergy = electronEnergy+Bi;
254 if (CS>0) adjointCS +=CS/gammaEnergy;
259 adjointCS*=electronEnergy;
static G4AdjointGamma * AdjointGamma()
void DefineCurrentMaterialAndElectronEnergy(const G4MaterialCutsCouple *aCouple, G4double eEnergy)
G4double GetAtomicShell(G4int index) const
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
std::vector< G4Element * > G4ElementVector
const G4Material * GetMaterial() const
G4double GetPostStepWeightCorrection()
G4ParticleDefinition * theDirectPrimaryPartDef
~G4AdjointPhotoElectricModel()
G4PEEffectFluoModel * theDirectPEEffectModel
static G4AdjointElectron * AdjointElectron()
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4Material * currentMaterial
G4double totBiasedAdjointCS
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
G4double pre_step_AdjointCS
G4double GetKineticEnergy() const
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4double post_step_AdjointCS
const G4double * GetVecNbOfAtomsPerVolume() const
Hep3Vector & rotateUz(const Hep3Vector &)
static const double twopi
G4int GetNbOfAtomicShells() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double, G4double)
G4double AdjointCrossSectionPerAtom(const G4Element *anElement, G4double electronEnergy)
void SetUseMatrix(G4bool aBool)
G4MaterialCutsCouple * currentCouple
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
G4double shell_prob[40][40]
const G4ThreeVector & GetMomentumDirection() const
void SetCurrentCouple(const G4MaterialCutsCouple *)
size_t GetNumberOfElements() const
G4AdjointPhotoElectricModel()
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
size_t currentCoupleIndex
const G4ElementVector * GetElementVector() const
void SetApplyCutInRange(G4bool aBool)
static G4AdjointCSManager * GetAdjointCSManager()
size_t currentMaterialIndex
G4bool second_part_of_same_type