Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: G4eeToTwoGammaModel.cc,v 1.15 2009-04-09 18:41:18 vnivanch Exp $ >> 27 // GEANT4 tag $Name: geant4-09-04-patch-01 $ 26 // 28 // 27 // ------------------------------------------- 29 // ------------------------------------------------------------------- 28 // 30 // 29 // GEANT4 Class file 31 // GEANT4 Class file 30 // 32 // 31 // 33 // 32 // File name: G4eeToTwoGammaModel 34 // File name: G4eeToTwoGammaModel 33 // 35 // 34 // Author: Vladimir Ivanchenko on base 36 // Author: Vladimir Ivanchenko on base of Michel Maire code 35 // 37 // 36 // Creation date: 02.08.2004 38 // Creation date: 02.08.2004 37 // 39 // 38 // Modifications: 40 // Modifications: 39 // 08-04-05 Major optimisation of internal int 41 // 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko) 40 // 18-04-05 Compute CrossSectionPerVolume (V.I 42 // 18-04-05 Compute CrossSectionPerVolume (V.Ivanchenko) 41 // 06-02-06 ComputeCrossSectionPerElectron, Co 43 // 06-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma) 42 // 29-06-06 Fix problem for zero energy incide 44 // 29-06-06 Fix problem for zero energy incident positron (V.Ivanchenko) 43 // 20-10-06 Add theGamma as a member (V.Ivanch 45 // 20-10-06 Add theGamma as a member (V.Ivanchenko) 44 // 18-01-20 Introduce thermal model of annihil << 45 // 46 // 46 // 47 // 47 // Class Description: 48 // Class Description: 48 // 49 // 49 // Implementation of e+ annihilation into 2 ga 50 // Implementation of e+ annihilation into 2 gamma 50 // 51 // 51 // The secondaries Gamma energies are sampled 52 // The secondaries Gamma energies are sampled using the Heitler cross section. 52 // 53 // 53 // A modified version of the random number tec 54 // A modified version of the random number techniques of Butcher & Messel 54 // is used (Nuc Phys 20(1960),15). 55 // is used (Nuc Phys 20(1960),15). 55 // 56 // 56 // GEANT4 internal units. 57 // GEANT4 internal units. 57 // 58 // 58 // Note 1: The initial electron is assumed fre << 59 // Note 1: The initial electron is assumed free and at rest. 59 // is not defined << 60 // 60 // 61 // Note 2: The annihilation processes producin 61 // Note 2: The annihilation processes producing one or more than two photons are 62 // ignored, as negligible compared to 62 // ignored, as negligible compared to the two photons process. 63 63 >> 64 >> 65 64 // 66 // 65 // ------------------------------------------- 67 // ------------------------------------------------------------------- 66 // 68 // 67 //....oooOO0OOooo........oooOO0OOooo........oo 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 68 //....oooOO0OOooo........oooOO0OOooo........oo 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 69 71 70 #include "G4eeToTwoGammaModel.hh" 72 #include "G4eeToTwoGammaModel.hh" 71 #include "G4PhysicalConstants.hh" << 72 #include "G4SystemOfUnits.hh" << 73 #include "G4TrackStatus.hh" 73 #include "G4TrackStatus.hh" 74 #include "G4Electron.hh" 74 #include "G4Electron.hh" 75 #include "G4Positron.hh" 75 #include "G4Positron.hh" 76 #include "G4Gamma.hh" 76 #include "G4Gamma.hh" 77 #include "Randomize.hh" 77 #include "Randomize.hh" 78 #include "G4RandomDirection.hh" << 79 #include "G4ParticleChangeForGamma.hh" 78 #include "G4ParticleChangeForGamma.hh" 80 #include "G4EmParameters.hh" << 81 #include "G4Log.hh" << 82 #include "G4Exp.hh" << 83 79 84 //....oooOO0OOooo........oooOO0OOooo........oo 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 81 >> 82 using namespace std; >> 83 86 G4eeToTwoGammaModel::G4eeToTwoGammaModel(const 84 G4eeToTwoGammaModel::G4eeToTwoGammaModel(const G4ParticleDefinition*, 87 const 85 const G4String& nam) 88 : G4VEmModel(nam), 86 : G4VEmModel(nam), 89 pi_rcl2(CLHEP::pi*CLHEP::classic_electr_ra << 87 pi_rcl2(pi*classic_electr_radius*classic_electr_radius), >> 88 isInitialised(false) 90 { 89 { 91 theGamma = G4Gamma::Gamma(); 90 theGamma = G4Gamma::Gamma(); 92 fParticleChange = nullptr; << 93 } 91 } 94 92 95 //....oooOO0OOooo........oooOO0OOooo........oo 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 94 97 G4eeToTwoGammaModel::~G4eeToTwoGammaModel() = << 95 G4eeToTwoGammaModel::~G4eeToTwoGammaModel() >> 96 {} 98 97 99 //....oooOO0OOooo........oooOO0OOooo........oo 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 100 99 101 void G4eeToTwoGammaModel::Initialise(const G4P 100 void G4eeToTwoGammaModel::Initialise(const G4ParticleDefinition*, 102 const G4D 101 const G4DataVector&) 103 { 102 { 104 if (nullptr != fParticleChange) { return; } << 103 if(isInitialised) return; 105 fParticleChange = GetParticleChangeForGamma( 104 fParticleChange = GetParticleChangeForGamma(); >> 105 isInitialised = true; 106 } 106 } 107 107 108 //....oooOO0OOooo........oooOO0OOooo........oo 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 109 110 G4double << 110 G4double G4eeToTwoGammaModel::ComputeCrossSectionPerElectron( 111 G4eeToTwoGammaModel::ComputeCrossSectionPerEle << 111 const G4ParticleDefinition*, >> 112 G4double kineticEnergy, >> 113 G4double, G4double) 112 { 114 { 113 // Calculates the cross section per electron 115 // Calculates the cross section per electron of annihilation into two photons 114 // from the Heilter formula. 116 // from the Heilter formula. 115 << 117 116 G4double ekin = std::max(CLHEP::eV, kinetic << 118 G4double tau = kineticEnergy/electron_mass_c2; 117 << 118 G4double tau = ekin/CLHEP::electron_mass_c << 119 G4double gam = tau + 1.0; 119 G4double gam = tau + 1.0; 120 G4double gamma2= gam*gam; 120 G4double gamma2= gam*gam; 121 G4double bg2 = tau * (tau+2.0); 121 G4double bg2 = tau * (tau+2.0); 122 G4double bg = std::sqrt(bg2); << 122 G4double bg = sqrt(bg2); 123 123 124 G4double cross = pi_rcl2*((gamma2+4*gam+1.)* << 124 G4double cross = pi_rcl2*((gamma2+4*gam+1.)*log(gam+bg) - (gam+3.)*bg) 125 / (bg2*(gam+1.)); 125 / (bg2*(gam+1.)); 126 return cross; 126 return cross; 127 } 127 } 128 128 129 //....oooOO0OOooo........oooOO0OOooo........oo 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 130 130 131 G4double G4eeToTwoGammaModel::ComputeCrossSect 131 G4double G4eeToTwoGammaModel::ComputeCrossSectionPerAtom( 132 const G4Pa << 132 const G4ParticleDefinition* p, 133 G4double k 133 G4double kineticEnergy, G4double Z, 134 G4double, G4double, G4double) 134 G4double, G4double, G4double) 135 { 135 { 136 // Calculates the cross section per atom of 136 // Calculates the cross section per atom of annihilation into two photons 137 return Z*ComputeCrossSectionPerElectron(kine << 137 >> 138 G4double cross = Z*ComputeCrossSectionPerElectron(p,kineticEnergy); >> 139 return cross; 138 } 140 } 139 141 140 //....oooOO0OOooo........oooOO0OOooo........oo 142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 141 143 142 G4double G4eeToTwoGammaModel::CrossSectionPerV 144 G4double G4eeToTwoGammaModel::CrossSectionPerVolume( 143 const G4Material* material, 145 const G4Material* material, 144 const G4ParticleDefinition*, << 146 const G4ParticleDefinition* p, 145 G4double kineticEnergy, 147 G4double kineticEnergy, 146 G4double, G4double) 148 G4double, G4double) 147 { 149 { 148 // Calculates the cross section per volume o 150 // Calculates the cross section per volume of annihilation into two photons 149 return material->GetElectronDensity()*Comput << 151 >> 152 G4double eDensity = material->GetElectronDensity(); >> 153 G4double cross = eDensity*ComputeCrossSectionPerElectron(p,kineticEnergy); >> 154 return cross; 150 } 155 } 151 156 152 //....oooOO0OOooo........oooOO0OOooo........oo 157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 158 154 // Polarisation of gamma according to M.H.L.Pr << 159 void G4eeToTwoGammaModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp, 155 // Nature 4065 (1947) 435. << 156 << 157 void G4eeToTwoGammaModel::SampleSecondaries(st << 158 const G4MaterialCutsCouple*, 160 const G4MaterialCutsCouple*, 159 const G4DynamicParticle* dp, 161 const G4DynamicParticle* dp, 160 G4double, 162 G4double, 161 G4double) 163 G4double) 162 { 164 { 163 // kill primary positron << 165 G4double PositKinEnergy = dp->GetKineticEnergy(); 164 fParticleChange->SetProposedKineticEnergy(0. << 165 fParticleChange->ProposeTrackStatus(fStopAnd << 166 << 167 // Case at rest not considered anymore insid << 168 G4LorentzVector lv(dp->GetMomentum(), << 169 dp->GetKineticEnergy() + 2*CLHEP::ele << 170 G4double eGammaCMS = 0.5 * lv.mag(); << 171 << 172 G4ThreeVector dir1 = G4RandomDirection(); << 173 G4double phi = CLHEP::twopi * G4UniformRand( << 174 G4double cosphi = std::cos(phi); << 175 G4double sinphi = std::sin(phi); << 176 G4ThreeVector pol1(cosphi, sinphi, 0.0); << 177 pol1.rotateUz(dir1); << 178 G4LorentzVector lv1(eGammaCMS*dir1, eGammaCM << 179 << 180 G4ThreeVector pol2(-sinphi, cosphi, 0.0); << 181 pol2.rotateUz(dir1); << 182 << 183 // transformation to lab system << 184 lv1.boost(lv.boostVector()); << 185 lv -= lv1; << 186 166 187 //!!! boost of polarisation vector is not ye << 167 // Case at rest 188 << 168 if(PositKinEnergy == 0.0) { 189 // use constructors optimal for massless par << 169 G4double cost = 2.*G4UniformRand()-1.; 190 auto aGamma1 = new G4DynamicParticle(G4Gamma << 170 G4double sint = sqrt((1. - cost)*(1. + cost)); 191 aGamma1->SetPolarization(pol1); << 171 G4double phi = twopi * G4UniformRand(); 192 auto aGamma2 = new G4DynamicParticle(G4Gamma << 172 G4ThreeVector dir (sint*cos(phi), sint*sin(phi), cost); 193 aGamma2->SetPolarization(pol2); << 173 G4DynamicParticle* aGamma1 = new G4DynamicParticle(theGamma, 194 << 174 dir, electron_mass_c2); 195 vdp->push_back(aGamma1); << 175 G4DynamicParticle* aGamma2 = new G4DynamicParticle(theGamma, 196 vdp->push_back(aGamma2); << 176 -dir, electron_mass_c2); >> 177 vdp->push_back(aGamma1); >> 178 vdp->push_back(aGamma2); >> 179 >> 180 } else { >> 181 >> 182 G4ThreeVector PositDirection = dp->GetMomentumDirection(); >> 183 >> 184 G4double tau = PositKinEnergy/electron_mass_c2; >> 185 G4double gam = tau + 1.0; >> 186 G4double tau2 = tau + 2.0; >> 187 G4double sqgrate = sqrt(tau/tau2)*0.5; >> 188 G4double sqg2m1 = sqrt(tau*tau2); >> 189 >> 190 // limits of the energy sampling >> 191 G4double epsilmin = 0.5 - sqgrate; >> 192 G4double epsilmax = 0.5 + sqgrate; >> 193 G4double epsilqot = epsilmax/epsilmin; >> 194 >> 195 // >> 196 // sample the energy rate of the created gammas >> 197 // >> 198 G4double epsil, greject; >> 199 >> 200 do { >> 201 epsil = epsilmin*pow(epsilqot,G4UniformRand()); >> 202 greject = 1. - epsil + (2.*gam*epsil-1.)/(epsil*tau2*tau2); >> 203 } while( greject < G4UniformRand() ); >> 204 >> 205 // >> 206 // scattered Gamma angles. ( Z - axis along the parent positron) >> 207 // >> 208 >> 209 G4double cost = (epsil*tau2-1.)/(epsil*sqg2m1); >> 210 if(std::abs(cost) > 1.0) { >> 211 G4cout << "### G4eeToTwoGammaModel WARNING cost= " << cost >> 212 << " positron Ekin(MeV)= " << PositKinEnergy >> 213 << " gamma epsil= " << epsil >> 214 << G4endl; >> 215 if(cost > 1.0) cost = 1.0; >> 216 else cost = -1.0; >> 217 } >> 218 G4double sint = sqrt((1.+cost)*(1.-cost)); >> 219 G4double phi = twopi * G4UniformRand(); >> 220 >> 221 G4double dirx = sint*cos(phi) , diry = sint*sin(phi) , dirz = cost; >> 222 >> 223 // >> 224 // kinematic of the created pair >> 225 // >> 226 >> 227 G4double TotalAvailableEnergy = PositKinEnergy + 2.0*electron_mass_c2; >> 228 G4double Phot1Energy = epsil*TotalAvailableEnergy; >> 229 >> 230 G4ThreeVector Phot1Direction (dirx, diry, dirz); >> 231 Phot1Direction.rotateUz(PositDirection); >> 232 G4DynamicParticle* aGamma1 = >> 233 new G4DynamicParticle (theGamma,Phot1Direction, Phot1Energy); >> 234 vdp->push_back(aGamma1); >> 235 >> 236 G4double Phot2Energy =(1.-epsil)*TotalAvailableEnergy; >> 237 G4double PositP= sqrt(PositKinEnergy*(PositKinEnergy+2.*electron_mass_c2)); >> 238 G4ThreeVector dir = PositDirection*PositP - Phot1Direction*Phot1Energy; >> 239 G4ThreeVector Phot2Direction = dir.unit(); >> 240 >> 241 // create G4DynamicParticle object for the particle2 >> 242 G4DynamicParticle* aGamma2= >> 243 new G4DynamicParticle (theGamma,Phot2Direction, Phot2Energy); >> 244 vdp->push_back(aGamma2); >> 245 /* >> 246 G4cout << "Annihilation in fly: e0= " << PositKinEnergy >> 247 << " m= " << electron_mass_c2 >> 248 << " e1= " << Phot1Energy >> 249 << " e2= " << Phot2Energy << " dir= " << dir >> 250 << " -> " << Phot1Direction << " " >> 251 << Phot2Direction << G4endl; >> 252 */ >> 253 } >> 254 fParticleChange->SetProposedKineticEnergy(0.); >> 255 fParticleChange->ProposeTrackStatus(fStopAndKill); 197 } 256 } 198 257 199 //....oooOO0OOooo........oooOO0OOooo........oo 258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 200 259