00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id$ 00027 // 00028 // ------------------------------------------------------------------- 00029 // 00030 // GEANT4 Class file 00031 // 00032 // 00033 // File name: G4eplusAnnihilation 00034 // 00035 // Author: Vladimir Ivanchenko on base of Michel Maire code 00036 // 00037 // Creation date: 02.08.2004 00038 // 00039 // Modifications: 00040 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) 00041 // 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko) 00042 // 03-05-05 suppress Integral option (mma) 00043 // 04-05-05 Make class to be default (V.Ivanchenko) 00044 // 25-01-06 remove cut dependance in AtRestDoIt (mma) 00045 // 09-08-06 add SetModel(G4VEmModel*) (mma) 00046 // 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma) 00047 // 30-05-12 propagate parent weight to secondaries (D. Sawkey) 00048 // 00049 00050 // 00051 // ------------------------------------------------------------------- 00052 // 00053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00055 00056 #include "G4eplusAnnihilation.hh" 00057 #include "G4PhysicalConstants.hh" 00058 #include "G4MaterialCutsCouple.hh" 00059 #include "G4Gamma.hh" 00060 #include "G4PhysicsVector.hh" 00061 #include "G4PhysicsLogVector.hh" 00062 #include "G4eeToTwoGammaModel.hh" 00063 00064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00065 00066 using namespace std; 00067 00068 G4eplusAnnihilation::G4eplusAnnihilation(const G4String& name) 00069 : G4VEmProcess(name), isInitialised(false) 00070 { 00071 theGamma = G4Gamma::Gamma(); 00072 SetIntegral(true); 00073 SetBuildTableFlag(false); 00074 SetStartFromNullFlag(false); 00075 SetSecondaryParticle(theGamma); 00076 SetProcessSubType(fAnnihilation); 00077 enableAtRestDoIt = true; 00078 } 00079 00080 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00081 00082 G4eplusAnnihilation::~G4eplusAnnihilation() 00083 {} 00084 00085 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00086 00087 G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p) 00088 { 00089 return (&p == G4Positron::Positron()); 00090 } 00091 00092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00093 00094 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength( 00095 const G4Track&, G4ForceCondition* condition) 00096 { 00097 *condition = NotForced; 00098 return 0.0; 00099 } 00100 00101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00102 00103 void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*) 00104 { 00105 if(!isInitialised) { 00106 isInitialised = true; 00107 if(!EmModel(1)) { SetEmModel(new G4eeToTwoGammaModel(),1); } 00108 EmModel(1)->SetLowEnergyLimit(MinKinEnergy()); 00109 EmModel(1)->SetHighEnergyLimit(MaxKinEnergy()); 00110 AddEmModel(1, EmModel(1)); 00111 } 00112 } 00113 00114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00115 00116 void G4eplusAnnihilation::PrintInfo() 00117 {} 00118 00119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00120 00121 G4VParticleChange* G4eplusAnnihilation::AtRestDoIt(const G4Track& aTrack, 00122 const G4Step& ) 00123 // 00124 // Performs the e+ e- annihilation when both particles are assumed at rest. 00125 // It generates two back to back photons with energy = electron_mass. 00126 // The angular distribution is isotropic. 00127 // GEANT4 internal units 00128 // 00129 // Note : Effects due to binding of atomic electrons are negliged. 00130 { 00131 fParticleChange.InitializeForPostStep(aTrack); 00132 00133 G4double cosTeta = 2.*G4UniformRand()-1.; 00134 G4double sinTeta = sqrt((1.-cosTeta)*(1.0 + cosTeta)); 00135 G4double phi = twopi * G4UniformRand(); 00136 G4ThreeVector dir(sinTeta*cos(phi), sinTeta*sin(phi), cosTeta); 00137 phi = twopi * G4UniformRand(); 00138 G4ThreeVector pol(cos(phi), sin(phi), 0.0); 00139 pol.rotateUz(dir); 00140 00141 fParticleChange.ProposeWeight(aTrack.GetWeight()); 00142 // add gammas 00143 fParticleChange.SetNumberOfSecondaries(2); 00144 G4DynamicParticle* dp = 00145 new G4DynamicParticle(theGamma, dir, electron_mass_c2); 00146 dp->SetPolarization(pol.x(),pol.y(),pol.z()); 00147 fParticleChange.AddSecondary(dp); 00148 00149 dp = new G4DynamicParticle(theGamma,-dir, electron_mass_c2); 00150 dp->SetPolarization(-pol.x(),-pol.y(),-pol.z()); 00151 fParticleChange.AddSecondary(dp); 00152 00153 // Kill the incident positron 00154 // 00155 fParticleChange.ProposeTrackStatus(fStopAndKill); 00156 return &fParticleChange; 00157 } 00158 00159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....