File indexing completed on 2025-02-27 09:18:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #include "G4RDPhotoElectricAngularGeneratorSauterGavrila.hh"
0052 #include "Randomize.hh"
0053 #include "G4PhysicalConstants.hh"
0054
0055
0056
0057 G4RDPhotoElectricAngularGeneratorSauterGavrila::G4RDPhotoElectricAngularGeneratorSauterGavrila(const G4String& name):G4RDVPhotoElectricAngularDistribution(name)
0058 {;}
0059
0060
0061
0062 G4RDPhotoElectricAngularGeneratorSauterGavrila::~G4RDPhotoElectricAngularGeneratorSauterGavrila()
0063 {;}
0064
0065
0066
0067 G4ThreeVector G4RDPhotoElectricAngularGeneratorSauterGavrila::GetPhotoElectronDirection(const G4ThreeVector& direction, const G4double eKineticEnergy, const G4ThreeVector&, const G4int) const
0068 {
0069
0070
0071
0072
0073
0074 G4double costeta = 1.;
0075 G4double Phi = twopi * G4UniformRand();
0076 G4double cosphi = std::cos(Phi);
0077 G4double sinphi = std::sin(Phi);
0078 G4double sinteta = 0;
0079 G4double gamma = 1. + eKineticEnergy/electron_mass_c2;
0080
0081 if (gamma > 5.) {
0082 G4ThreeVector direction (sinteta*cosphi, sinteta*sinphi, costeta);
0083 return direction;
0084 }
0085
0086 G4double beta = std::sqrt(gamma*gamma-1.)/gamma;
0087 G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
0088
0089 G4double rndm,term,greject,grejsup;
0090 if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*b);
0091 else grejsup = gamma*gamma*(1.+b+beta*b);
0092
0093 do { rndm = 1.-2*G4UniformRand();
0094 costeta = (rndm+beta)/(rndm*beta+1.);
0095 term = 1.-beta*costeta;
0096 greject = (1.-costeta*costeta)*(1.+b*term)/(term*term);
0097 } while(greject < G4UniformRand()*grejsup);
0098
0099
0100 sinteta = std::sqrt(1.-costeta*costeta);
0101 G4ThreeVector photoelectrondirection (sinteta*cosphi, sinteta*sinphi, costeta);
0102 photoelectrondirection.rotateUz(direction);
0103 return photoelectrondirection;
0104 }
0105
0106
0107
0108 void G4RDPhotoElectricAngularGeneratorSauterGavrila::PrintGeneratorInformation() const
0109 {
0110 G4cout << "\n" << G4endl;
0111 G4cout << "" << G4endl;
0112 G4cout << "Re-implementation of the photolectric angular distribution" << G4endl;
0113 G4cout << "developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect" << G4endl;
0114 G4cout << "It computes the theta distribution of the emitted electron, with respect to the" << G4endl;
0115 G4cout << "incident Gamma, using the Sauter-Gavrila distribution for the K-shell\n" << G4endl;
0116 }