168{
171
174
176 {
177 return;
178 }
179
183 if(!isScatProjToProj)
184 {
185 gammaEnergy = adjointPrimKinEnergy;
188 if(Emin >= Emax)
189 return;
190 projectileKinEnergy = Emin * std::pow(Emax / Emin,
G4UniformRand());
192 }
193 else
194 {
199 if(Emin >= Emax)
200 return;
201 G4double f1 = (Emin - adjointPrimKinEnergy) / Emin;
202 G4double f2 = (Emax - adjointPrimKinEnergy) / Emax / f1;
203 projectileKinEnergy =
204 adjointPrimKinEnergy / (1. - f1 * std::pow(f2,
G4UniformRand()));
205 gammaEnergy = projectileKinEnergy - adjointPrimKinEnergy;
206 diffCSUsed =
207 fLastCZ * adjointPrimKinEnergy / projectileKinEnergy / gammaEnergy;
208 }
209
210
211
212
213
214
215
218 {
220 }
221
222
223
224
225
226
227
230 w_corr *= diffCS / diffCSUsed;
231
236
237
239 G4double projectileTotalEnergy = projectileM0 + projectileKinEnergy;
241 projectileTotalEnergy * projectileTotalEnergy - projectileM0 * projectileM0;
242 G4double projectileP = std::sqrt(projectileP2);
243
244
245
248
249
258
259 if(isScatProjToProj)
260 {
262 (projectileTotalEnergy - adjointPrimTotalEnergy) *
265 G4double cost1 = std::cos(dirProd.
angle(projectileMomentum));
266 G4double sint1 = std::sqrt(1. - cost1 * cost1);
267 projectileMomentum =
268 G4ThreeVector(std::cos(phi) * sint1, std::sin(phi) * sint1, cost1) *
269 projectileP;
270 }
271
273
274 if(!isScatProjToProj)
275 {
279 }
280 else
281 {
284 }
285}
CLHEP::Hep3Vector G4ThreeVector
double angle(const Hep3Vector &) const
Hep3Vector & rotateUz(const Hep3Vector &)
G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd) override
G4double GetPostStepWeightCorrection()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() 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
G4double fOutsideWeightFactor
G4bool fInModelWeightCorr
G4ParticleDefinition * fAdjEquivDirectPrimPart
G4MaterialCutsCouple * fCurrentCouple
G4Material * fCurrentMaterial
G4double GetHighEnergyLimit()
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
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)
G4double energy(const ThreeVector &p, const G4double m)