87 EnergyRatio = finalTotalEnergy/initialTotalEnergy;
88 G4double gMaxEnergy = (
pi*initialTotalEnergy)*(
pi*initialTotalEnergy);
90 G4double Zeff = std::sqrt(static_cast<G4double>(Z) * (static_cast<G4double>(Z) + 1.0));
91 z = (0.00008116224*(std::pow(Zeff,0.3333333)));
94 rejection_argument1 = (1.0+EnergyRatio*EnergyRatio);
95 rejection_argument2 = - 2.0*EnergyRatio + 3.0*rejection_argument1;
96 rejection_argument3 = ((1-EnergyRatio)/(2.0*initialTotalEnergy*EnergyRatio))*
97 ((1-EnergyRatio)/(2.0*initialTotalEnergy*EnergyRatio));
107 gMaximum =
std::max(gMaximum,gfunctionEmax);
109 G4double rand, gfunctionTest, randTest;
113 rand = rand/(1-rand+1.0/gMaxEnergy);
117 }
while(randTest > (gfunctionTest/gMaximum));
119 theta = std::sqrt(rand)/initialTotalEnergy;
131 G4double gfunction = (4+std::log(rejection_argument3+(z/argument)))*
132 ((4*EnergyRatio*value/argument)-rejection_argument1)+rejection_argument2;
141 G4cout <<
"Bremsstrahlung Angular Generator is 2BS Generator from 2BS Koch & Motz distribution (Rev Mod Phys 31(4), 920 (1959))" <<
G4endl;
142 G4cout <<
"Sampling algorithm adapted from PIRS-0203" <<
G4endl;
G4RDGenerator2BS(const G4String &name)
void PrintGeneratorInformation() const
G4double PolarAngle(const G4double initial_energy, const G4double final_energy, const G4int Z)
G4GLOB_DLL std::ostream G4cout
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const XML_Char int const XML_Char * value
G4double RejectionFunction(G4double value) const