Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4hIonisation.cc
Go to the documentation of this file.
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//
26// -------------------------------------------------------------------
27//
28// GEANT4 Class file
29//
30//
31// File name: G4hIonisation
32//
33// Author: Laszlo Urban
34//
35// Creation date: 30.05.1997
36//
37// Modified by Laszlo Urban, Michel Maire and Vladimir Ivanchenko
38//
39// -------------------------------------------------------------------
40//
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43
44#include "G4hIonisation.hh"
46#include "G4SystemOfUnits.hh"
47#include "G4Electron.hh"
48#include "G4Proton.hh"
49#include "G4AntiProton.hh"
50#include "G4BraggModel.hh"
51#include "G4BetheBlochModel.hh"
52#include "G4EmStandUtil.hh"
53#include "G4PionPlus.hh"
54#include "G4PionMinus.hh"
55#include "G4KaonPlus.hh"
56#include "G4KaonMinus.hh"
57#include "G4ICRU73QOModel.hh"
58#include "G4EmParameters.hh"
59
60//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
61
64 isInitialised(false)
65{
68 mass = 0.0;
69 ratio = 0.0;
70 eth = 2*CLHEP::MeV;
71}
72
73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
74
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
80{
81 return true;
82}
83
84//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85
87 const G4Material*,
88 G4double cut)
89{
90 G4double x = 0.5*cut/electron_mass_c2;
91 G4double gam = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
92 return mass*(gam - 1.0);
93}
94
95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
96
98 const G4ParticleDefinition* part,
99 const G4ParticleDefinition* bpart)
100{
101 if(!isInitialised) {
102
103 const G4ParticleDefinition* theBaseParticle = nullptr;
104 G4String pname = part->GetParticleName();
105 G4double q = part->GetPDGCharge();
106
107 //G4cout << " G4hIonisation::InitialiseEnergyLossProcess " << pname
108 // << " " << bpart << G4endl;
109
110 // define base particle
111 if(part == bpart) {
112 theBaseParticle = nullptr;
113 } else if(nullptr != bpart) {
114 theBaseParticle = bpart;
115
116 } else if(pname == "proton" || pname == "anti_proton" ||
117 pname == "pi+" || pname == "pi-" ||
118 pname == "kaon+" || pname == "kaon-" ||
119 pname == "GenericIon" || pname == "alpha") {
120 // no base particles
121 theBaseParticle = nullptr;
122
123 } else {
124 // select base particle
125 if(part->GetPDGSpin() == 0.0) {
126 if(q > 0.0) { theBaseParticle = G4KaonPlus::KaonPlus(); }
127 else { theBaseParticle = G4KaonMinus::KaonMinus(); }
128 } else {
129 if(q > 0.0) { theBaseParticle = G4Proton::Proton(); }
130 else { theBaseParticle = G4AntiProton::AntiProton(); }
131 }
132 }
133 SetBaseParticle(theBaseParticle);
134
135 // model limit defined for protons
136 mass = part->GetPDGMass();
137 ratio = electron_mass_c2/mass;
138 eth = 2.0*MeV*mass/proton_mass_c2;
139
141 G4double emin = param->MinKinEnergy();
142 G4double emax = param->MaxKinEnergy();
143
144 // define model of energy loss fluctuations
145 if (nullptr == FluctModel()) {
146 G4bool ion = (pname == "GenericIon" || pname == "alpha");
148 }
149
150 if (nullptr == EmModel(0)) {
151 if(q > 0.0) { SetEmModel(new G4BraggModel()); }
152 else { SetEmModel(new G4ICRU73QOModel()); }
153 }
154 // to compute ranges correctly we have to use low-energy
155 // model even if activation limit is high
156 EmModel(0)->SetLowEnergyLimit(emin);
157
158 // high energy limit may be eth or DBL_MAX
159 G4double emax1 = (EmModel(0)->HighEnergyLimit() < emax) ? eth : emax;
160 EmModel(0)->SetHighEnergyLimit(emax1);
161 AddEmModel(1, EmModel(0), FluctModel());
162
163 // second model is used if the first does not cover energy range
164 if(emax1 < emax) {
165 if (nullptr == EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
166 EmModel(1)->SetLowEnergyLimit(emax1);
167
168 // for extremely heavy particles upper limit of the model
169 // should be increased
170 emax = std::max(emax, eth*10);
171 EmModel(1)->SetHighEnergyLimit(emax);
172 AddEmModel(2, EmModel(1), FluctModel());
173 }
174 isInitialised = true;
175 }
176}
177
178//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
179
180void G4hIonisation::ProcessDescription(std::ostream& out) const
181{
182 out << " Ionisation";
184}
185
186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@ fIonisation
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
static G4AntiProton * AntiProton()
Definition: G4AntiProton.cc:92
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4EmParameters * Instance()
G4double MinKinEnergy() const
G4double MaxKinEnergy() const
static G4VEmFluctuationModel * ModelOfFluctuations(G4bool isIon=false)
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:112
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:112
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4Proton * Proton()
Definition: G4Proton.cc:92
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:746
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:753
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
void SetFluctModel(G4VEmFluctuationModel *)
void ProcessDescription(std::ostream &outFile) const override
G4VEmModel * EmModel(std::size_t index=0) const
void SetEmModel(G4VEmModel *, G4int index=0)
void SetBaseParticle(const G4ParticleDefinition *p)
G4VEmFluctuationModel * FluctModel() const
void SetSecondaryParticle(const G4ParticleDefinition *p)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:410
G4bool IsApplicable(const G4ParticleDefinition &p) override
virtual void ProcessDescription(std::ostream &) const override
G4double MinPrimaryEnergy(const G4ParticleDefinition *p, const G4Material *, G4double cut) final
~G4hIonisation() override
G4hIonisation(const G4String &name="hIoni")
void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *) override