[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 | // |
---|
[1315] | 26 | // $Id: G4CoulombScattering.cc,v 1.28 2010/05/25 18:41:12 vnivanch Exp $ |
---|
| 27 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ |
---|
[819] | 28 | // |
---|
| 29 | // ------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // GEANT4 Class file |
---|
| 32 | // |
---|
| 33 | // |
---|
| 34 | // File name: G4CoulombScattering |
---|
| 35 | // |
---|
| 36 | // Author: Vladimir Ivanchenko |
---|
| 37 | // |
---|
| 38 | // Creation date: 22.08.2004 |
---|
| 39 | // |
---|
| 40 | // Modifications: |
---|
| 41 | // 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and |
---|
| 42 | // G4CoulombScatteringModel |
---|
| 43 | // |
---|
| 44 | |
---|
| 45 | // |
---|
| 46 | // ------------------------------------------------------------------- |
---|
| 47 | // |
---|
| 48 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 49 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 50 | |
---|
| 51 | #include "G4CoulombScattering.hh" |
---|
| 52 | #include "G4CoulombScatteringModel.hh" |
---|
| 53 | #include "G4eCoulombScatteringModel.hh" |
---|
[1196] | 54 | //#include "G4hCoulombScatteringModel.hh" |
---|
[819] | 55 | #include "G4Electron.hh" |
---|
[1196] | 56 | #include "G4Proton.hh" |
---|
[1315] | 57 | #include "G4LossTableManager.hh" |
---|
[819] | 58 | |
---|
| 59 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 60 | |
---|
| 61 | using namespace std; |
---|
| 62 | |
---|
| 63 | G4CoulombScattering::G4CoulombScattering(const G4String& name) |
---|
[961] | 64 | : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV), |
---|
[819] | 65 | isInitialised(false) |
---|
| 66 | { |
---|
[1315] | 67 | // G4cout << "G4CoulombScattering constructor "<< G4endl; |
---|
[961] | 68 | SetBuildTableFlag(true); |
---|
[819] | 69 | SetStartFromNullFlag(false); |
---|
| 70 | SetIntegral(true); |
---|
| 71 | thEnergy = PeV; |
---|
| 72 | thEnergyElec = PeV; |
---|
| 73 | if(name == "CoulombScat") { |
---|
| 74 | thEnergy = 10.*MeV; |
---|
| 75 | thEnergyElec = 10.*GeV; |
---|
| 76 | } |
---|
| 77 | SetSecondaryParticle(G4Electron::Electron()); |
---|
[961] | 78 | SetProcessSubType(fCoulombScattering); |
---|
[819] | 79 | } |
---|
| 80 | |
---|
| 81 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 82 | |
---|
| 83 | G4CoulombScattering::~G4CoulombScattering() |
---|
| 84 | {} |
---|
| 85 | |
---|
| 86 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 87 | |
---|
[1055] | 88 | G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p) |
---|
| 89 | { |
---|
| 90 | return (p.GetPDGCharge() != 0.0 && !p.IsShortLived()); |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 94 | |
---|
[819] | 95 | void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p) |
---|
| 96 | { |
---|
[1315] | 97 | //G4cout << "### G4CoulombScattering::InitialiseProcess : " |
---|
| 98 | // << p->GetParticleName() << G4endl; |
---|
| 99 | G4double a = |
---|
| 100 | G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi; |
---|
| 101 | q2Max = 0.5*a*a; |
---|
| 102 | |
---|
[961] | 103 | // second initialisation |
---|
| 104 | if(isInitialised) { |
---|
| 105 | G4VEmModel* mod = GetModelByIndex(0); |
---|
| 106 | mod->SetPolarAngleLimit(PolarAngleLimit()); |
---|
| 107 | mod = GetModelByIndex(1); |
---|
[1315] | 108 | if(mod) { mod->SetPolarAngleLimit(PolarAngleLimit()); } |
---|
[961] | 109 | |
---|
| 110 | // first initialisation |
---|
| 111 | } else { |
---|
[819] | 112 | isInitialised = true; |
---|
| 113 | aParticle = p; |
---|
| 114 | G4double mass = p->GetPDGMass(); |
---|
[1196] | 115 | G4String name = p->GetParticleName(); |
---|
[1315] | 116 | //G4cout << name << " type: " << p->GetParticleType() |
---|
| 117 | //<< " mass= " << mass << G4endl; |
---|
[819] | 118 | if (mass > GeV || p->GetParticleType() == "nucleus") { |
---|
[961] | 119 | SetBuildTableFlag(false); |
---|
[1315] | 120 | if(name != "GenericIon") { SetVerboseLevel(0); } |
---|
[819] | 121 | } else { |
---|
| 122 | if(name != "e-" && name != "e+" && |
---|
| 123 | name != "mu+" && name != "mu-" && name != "pi+" && |
---|
[1315] | 124 | name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); } |
---|
[819] | 125 | } |
---|
| 126 | |
---|
| 127 | G4double emin = MinKinEnergy(); |
---|
| 128 | G4double emax = MaxKinEnergy(); |
---|
[1196] | 129 | // G4gCoulombScatteringModel* model = new G4hCoulombScatteringModel(); |
---|
| 130 | G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel(); |
---|
| 131 | model->SetPolarAngleLimit(PolarAngleLimit()); |
---|
| 132 | model->SetLowEnergyLimit(emin); |
---|
| 133 | model->SetHighEnergyLimit(emax); |
---|
| 134 | AddEmModel(1, model); |
---|
| 135 | /* |
---|
| 136 | |
---|
[819] | 137 | G4double eth = thEnergy; |
---|
| 138 | if(mass < MeV) eth = thEnergyElec; |
---|
| 139 | if(eth > emin) { |
---|
[961] | 140 | G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel(); |
---|
| 141 | model->SetPolarAngleLimit(PolarAngleLimit()); |
---|
[819] | 142 | model->SetLowEnergyLimit(emin); |
---|
| 143 | model->SetHighEnergyLimit(std::min(eth,emax)); |
---|
| 144 | AddEmModel(1, model); |
---|
| 145 | } |
---|
| 146 | if(eth < emax) { |
---|
[961] | 147 | G4CoulombScatteringModel* model = new G4CoulombScatteringModel(); |
---|
| 148 | model->SetPolarAngleLimit(PolarAngleLimit()); |
---|
[819] | 149 | model->SetLowEnergyLimit(eth); |
---|
| 150 | model->SetHighEnergyLimit(emax); |
---|
| 151 | AddEmModel(2, model); |
---|
| 152 | } |
---|
[1196] | 153 | */ |
---|
[819] | 154 | } |
---|
| 155 | } |
---|
| 156 | |
---|
| 157 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 158 | |
---|
| 159 | void G4CoulombScattering::PrintInfo() |
---|
| 160 | { |
---|
[961] | 161 | G4cout << " " << PolarAngleLimit()/degree |
---|
[1196] | 162 | << " < Theta(degree) < 180" |
---|
[961] | 163 | << ", Eth(MeV)= "; |
---|
[1196] | 164 | |
---|
[819] | 165 | if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec; |
---|
| 166 | else G4cout << thEnergy; |
---|
| 167 | |
---|
[1315] | 168 | if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; } |
---|
[819] | 169 | G4cout << G4endl; |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|