[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1055] | 26 | // $Id: G4eplusAnnihilation.cc,v 1.30 2009/02/20 12:06:37 vnivanch Exp $ |
---|
[1228] | 27 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[819] | 28 | // |
---|
| 29 | // ------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // GEANT4 Class file |
---|
| 32 | // |
---|
| 33 | // |
---|
| 34 | // File name: G4eplusAnnihilation |
---|
| 35 | // |
---|
| 36 | // Author: Vladimir Ivanchenko on base of Michel Maire code |
---|
| 37 | // |
---|
| 38 | // Creation date: 02.08.2004 |
---|
| 39 | // |
---|
| 40 | // Modifications: |
---|
| 41 | // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) |
---|
| 42 | // 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko) |
---|
| 43 | // 03-05-05 suppress Integral option (mma) |
---|
| 44 | // 04-05-05 Make class to be default (V.Ivanchenko) |
---|
| 45 | // 25-01-06 remove cut dependance in AtRestDoIt (mma) |
---|
| 46 | // 09-08-06 add SetModel(G4VEmModel*) (mma) |
---|
| 47 | // 12-09-06, move SetModel(G4VEmModel*) in G4VEmProcess (mma) |
---|
| 48 | // |
---|
| 49 | |
---|
| 50 | // |
---|
| 51 | // ------------------------------------------------------------------- |
---|
| 52 | // |
---|
| 53 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 54 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 55 | |
---|
| 56 | #include "G4eplusAnnihilation.hh" |
---|
| 57 | #include "G4MaterialCutsCouple.hh" |
---|
| 58 | #include "G4Gamma.hh" |
---|
| 59 | #include "G4PhysicsVector.hh" |
---|
| 60 | #include "G4PhysicsLogVector.hh" |
---|
| 61 | #include "G4eeToTwoGammaModel.hh" |
---|
| 62 | |
---|
| 63 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 64 | |
---|
| 65 | using namespace std; |
---|
| 66 | |
---|
| 67 | G4eplusAnnihilation::G4eplusAnnihilation(const G4String& name) |
---|
| 68 | : G4VEmProcess(name), isInitialised(false) |
---|
| 69 | { |
---|
[961] | 70 | SetProcessSubType(fAnnihilation); |
---|
[819] | 71 | enableAtRestDoIt = true; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 75 | |
---|
| 76 | G4eplusAnnihilation::~G4eplusAnnihilation() |
---|
| 77 | {} |
---|
| 78 | |
---|
| 79 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 80 | |
---|
[1055] | 81 | G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p) |
---|
| 82 | { |
---|
| 83 | return (&p == G4Positron::Positron()); |
---|
| 84 | } |
---|
| 85 | |
---|
| 86 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 87 | |
---|
| 88 | G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength( |
---|
| 89 | const G4Track&, G4ForceCondition* condition) |
---|
| 90 | { |
---|
| 91 | *condition = NotForced; |
---|
| 92 | return 0.0; |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 96 | |
---|
[819] | 97 | void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*) |
---|
| 98 | { |
---|
| 99 | if(!isInitialised) { |
---|
| 100 | isInitialised = true; |
---|
| 101 | SetBuildTableFlag(true); |
---|
| 102 | SetStartFromNullFlag(false); |
---|
| 103 | SetSecondaryParticle(G4Gamma::Gamma()); |
---|
[961] | 104 | if(!Model()) SetModel(new G4eeToTwoGammaModel()); |
---|
| 105 | Model()->SetLowEnergyLimit(MinKinEnergy()); |
---|
| 106 | Model()->SetHighEnergyLimit(MaxKinEnergy()); |
---|
[819] | 107 | AddEmModel(1, Model()); |
---|
| 108 | } |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 112 | |
---|
| 113 | void G4eplusAnnihilation::PrintInfo() |
---|
[961] | 114 | {} |
---|
[819] | 115 | |
---|
| 116 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 117 | |
---|
| 118 | G4VParticleChange* G4eplusAnnihilation::AtRestDoIt(const G4Track& aTrack, |
---|
| 119 | const G4Step& ) |
---|
| 120 | // |
---|
| 121 | // Performs the e+ e- annihilation when both particles are assumed at rest. |
---|
| 122 | // It generates two back to back photons with energy = electron_mass. |
---|
| 123 | // The angular distribution is isotropic. |
---|
| 124 | // GEANT4 internal units |
---|
| 125 | // |
---|
| 126 | // Note : Effects due to binding of atomic electrons are negliged. |
---|
| 127 | { |
---|
| 128 | fParticleChange.InitializeForPostStep(aTrack); |
---|
| 129 | |
---|
| 130 | fParticleChange.SetNumberOfSecondaries(2); |
---|
| 131 | |
---|
| 132 | G4double cosTeta = 2.*G4UniformRand()-1. , sinTeta = sqrt(1.-cosTeta*cosTeta); |
---|
| 133 | G4double phi = twopi * G4UniformRand(); |
---|
| 134 | G4ThreeVector direction (sinTeta*cos(phi), sinTeta*sin(phi), cosTeta); |
---|
| 135 | fParticleChange.AddSecondary( new G4DynamicParticle (G4Gamma::Gamma(), |
---|
| 136 | direction, electron_mass_c2) ); |
---|
| 137 | fParticleChange.AddSecondary( new G4DynamicParticle (G4Gamma::Gamma(), |
---|
| 138 | -direction, electron_mass_c2) ); |
---|
| 139 | // Kill the incident positron |
---|
| 140 | // |
---|
| 141 | fParticleChange.ProposeTrackStatus(fStopAndKill); |
---|
| 142 | return &fParticleChange; |
---|
| 143 | } |
---|
| 144 | |
---|
| 145 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|