88{
89 fParticleChange->Initialize(track);
90
91
92
93 if(fCopyGammaForForced)
94 {
96 fParticleChange->AddSecondary(
98 fParticleChange->SetParentWeightByProcess(false);
99 fParticleChange->SetSecondaryWeightByProcess(false);
100 }
101 else
102 {
103
104 G4VEmAdjointModel* theSelectedModel = nullptr;
105 G4bool is_scat_proj_to_proj_case =
false;
107 if(!fAdjointComptonModel && !fAdjointBremModel)
108 return fParticleChange;
109 if(!fAdjointComptonModel)
110 {
111 theSelectedModel = fAdjointBremModel;
112 is_scat_proj_to_proj_case = false;
113
114
117 }
118 else if(!fAdjointBremModel)
119 {
120 theSelectedModel = fAdjointComptonModel;
121 is_scat_proj_to_proj_case = true;
122 }
123 else
124 {
125 G4double bremAdjCS = fAdjointBremModel->AdjointCrossSection(
128 {
129 theSelectedModel = fAdjointBremModel;
130 is_scat_proj_to_proj_case = false;
131 factor=bremAdjCS/fLastAdjCS/0.5;
132 }
133 else
134 {
135 theSelectedModel = fAdjointComptonModel;
136 is_scat_proj_to_proj_case = true;
137 factor=(fLastAdjCS-bremAdjCS)/fLastAdjCS/0.5;
138 }
139 }
140
141
143 (1. - std::exp(fNbAdjIntLength - fTotNbAdjIntLength)) / fLastAdjCS/fCSBias;
144
145
147 theSelectedModel
149 factor*fLastAdjCS * invEffectiveAdjointCS);
151 fParticleChange);
153
154 fContinueGammaAsNewFreeFlight = true;
155 }
156 return fParticleChange;
157}
G4ThreeVector GetMomentum() const
virtual void SampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange)=0
void SetAdditionalWeightCorrectionFactorForPostStepOutsideModel(G4double factor)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj)
void SetCorrectWeightForPostStepInModel(G4bool aBool)