| [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 | //
|
|---|
| [1196] | 26 | // $Id: G4CoulombScattering.cc,v 1.25 2009/10/28 10:14:13 vnivanch Exp $
|
|---|
| 27 | // GEANT4 tag $Name: geant4-09-03-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"
|
|---|
| [819] | 57 |
|
|---|
| 58 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|
| 59 |
|
|---|
| 60 | using namespace std;
|
|---|
| 61 |
|
|---|
| 62 | G4CoulombScattering::G4CoulombScattering(const G4String& name)
|
|---|
| [961] | 63 | : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV),
|
|---|
| [819] | 64 | isInitialised(false)
|
|---|
| 65 | {
|
|---|
| [961] | 66 | SetBuildTableFlag(true);
|
|---|
| [819] | 67 | SetStartFromNullFlag(false);
|
|---|
| 68 | SetIntegral(true);
|
|---|
| 69 | thEnergy = PeV;
|
|---|
| 70 | thEnergyElec = PeV;
|
|---|
| 71 | if(name == "CoulombScat") {
|
|---|
| 72 | thEnergy = 10.*MeV;
|
|---|
| 73 | thEnergyElec = 10.*GeV;
|
|---|
| 74 | }
|
|---|
| 75 | SetSecondaryParticle(G4Electron::Electron());
|
|---|
| [961] | 76 | SetProcessSubType(fCoulombScattering);
|
|---|
| [819] | 77 | }
|
|---|
| 78 |
|
|---|
| 79 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|
| 80 |
|
|---|
| 81 | G4CoulombScattering::~G4CoulombScattering()
|
|---|
| 82 | {}
|
|---|
| 83 |
|
|---|
| 84 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|
| 85 |
|
|---|
| [1055] | 86 | G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
|
|---|
| 87 | {
|
|---|
| 88 | return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
|
|---|
| 89 | }
|
|---|
| 90 |
|
|---|
| 91 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|
| 92 |
|
|---|
| [819] | 93 | void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
|
|---|
| 94 | {
|
|---|
| [961] | 95 | // second initialisation
|
|---|
| 96 | if(isInitialised) {
|
|---|
| 97 | G4VEmModel* mod = GetModelByIndex(0);
|
|---|
| 98 | mod->SetPolarAngleLimit(PolarAngleLimit());
|
|---|
| 99 | mod = GetModelByIndex(1);
|
|---|
| 100 | if(mod) mod->SetPolarAngleLimit(PolarAngleLimit());
|
|---|
| 101 |
|
|---|
| 102 | // first initialisation
|
|---|
| 103 | } else {
|
|---|
| [819] | 104 | isInitialised = true;
|
|---|
| 105 | aParticle = p;
|
|---|
| 106 | G4double mass = p->GetPDGMass();
|
|---|
| [1196] | 107 | G4String name = p->GetParticleName();
|
|---|
| [819] | 108 | if (mass > GeV || p->GetParticleType() == "nucleus") {
|
|---|
| [961] | 109 | SetBuildTableFlag(false);
|
|---|
| [819] | 110 | verboseLevel = 0;
|
|---|
| 111 | } else {
|
|---|
| 112 | if(name != "e-" && name != "e+" &&
|
|---|
| 113 | name != "mu+" && name != "mu-" && name != "pi+" &&
|
|---|
| 114 | name != "kaon+" && name != "proton" ) verboseLevel = 0;
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 | G4double emin = MinKinEnergy();
|
|---|
| 118 | G4double emax = MaxKinEnergy();
|
|---|
| [1196] | 119 | // G4gCoulombScatteringModel* model = new G4hCoulombScatteringModel();
|
|---|
| 120 | G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
|
|---|
| 121 | model->SetPolarAngleLimit(PolarAngleLimit());
|
|---|
| 122 | model->SetLowEnergyLimit(emin);
|
|---|
| 123 | model->SetHighEnergyLimit(emax);
|
|---|
| 124 | AddEmModel(1, model);
|
|---|
| 125 | /*
|
|---|
| 126 |
|
|---|
| [819] | 127 | G4double eth = thEnergy;
|
|---|
| 128 | if(mass < MeV) eth = thEnergyElec;
|
|---|
| 129 | if(eth > emin) {
|
|---|
| [961] | 130 | G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
|
|---|
| 131 | model->SetPolarAngleLimit(PolarAngleLimit());
|
|---|
| [819] | 132 | model->SetLowEnergyLimit(emin);
|
|---|
| 133 | model->SetHighEnergyLimit(std::min(eth,emax));
|
|---|
| 134 | AddEmModel(1, model);
|
|---|
| 135 | }
|
|---|
| 136 | if(eth < emax) {
|
|---|
| [961] | 137 | G4CoulombScatteringModel* model = new G4CoulombScatteringModel();
|
|---|
| 138 | model->SetPolarAngleLimit(PolarAngleLimit());
|
|---|
| [819] | 139 | model->SetLowEnergyLimit(eth);
|
|---|
| 140 | model->SetHighEnergyLimit(emax);
|
|---|
| 141 | AddEmModel(2, model);
|
|---|
| 142 | }
|
|---|
| [1196] | 143 | */
|
|---|
| [819] | 144 | }
|
|---|
| 145 | }
|
|---|
| 146 |
|
|---|
| 147 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|
| 148 |
|
|---|
| 149 | void G4CoulombScattering::PrintInfo()
|
|---|
| 150 | {
|
|---|
| [961] | 151 | G4cout << " " << PolarAngleLimit()/degree
|
|---|
| [1196] | 152 | << " < Theta(degree) < 180"
|
|---|
| [961] | 153 | << ", Eth(MeV)= ";
|
|---|
| [1196] | 154 |
|
|---|
| [819] | 155 | if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec;
|
|---|
| 156 | else G4cout << thEnergy;
|
|---|
| 157 |
|
|---|
| 158 | if(q2Max < DBL_MAX) G4cout << "; q2Max(GeV^2)= " << q2Max/(GeV*GeV);
|
|---|
| 159 | G4cout << G4endl;
|
|---|
| 160 | }
|
|---|
| 161 |
|
|---|
| 162 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
|---|