67{
68
69
71
72
73
76
78 return;
79 }
80
81
82
84 if (!WithRapidSampling ) {
86
89 adjointPrimKinEnergy,
90 projectileKinEnergy,
91 IsScatProjToProjCase);
92 }
93 else {
94
96 if (IsScatProjToProjCase) {
99 }
100 else {
103 }
104 projectileKinEnergy = Emin*std::pow(Emax/Emin,
G4UniformRand());
105
106
107
110
112 G4double used_diffCS=
lastCS*std::log(Emax/Emin)/projectileKinEnergy;
113 G4double needed_diffCS=adjointPrimKinEnergy/projectileKinEnergy;
116 new_weight*=needed_diffCS/used_diffCS;
120
121
122 }
123
124
125
126
127
128
129
130
132 G4double projectileTotalEnergy = projectileM0+projectileKinEnergy;
133 G4double projectileP2 = projectileTotalEnergy*projectileTotalEnergy - projectileM0*projectileM0;
134
135
136
137
138
140 if (IsScatProjToProjCase) {
142 }
143 G4double companionTotalEnergy =companionM0+ projectileKinEnergy-adjointPrimKinEnergy;
144 G4double companionP2 = companionTotalEnergy*companionTotalEnergy - companionM0*companionM0;
145
146
147
148
149 G4double P_parallel = (adjointPrimP*adjointPrimP + projectileP2 - companionP2)/(2.*adjointPrimP);
150 G4double P_perp = std::sqrt( projectileP2 - P_parallel*P_parallel);
154 projectileMomentum.
rotateUz(dir_parallel);
155
156
157
158 if (!IsScatProjToProjCase ){
161
162 }
163 else {
166 }
167
168
169
170
171}
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetTotalMomentum() 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
virtual G4double DiffCrossSectionPerVolumePrimToScatPrim(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyScatProj)
G4double lastAdjointCSForProdToProjCase
G4double lastAdjointCSForScatProjToProjCase
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4Material * currentMaterial
G4double currentTcutForDirectSecond
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)