Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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//
29// GEANT4 Class file
30//
31//
32// File name: G4hIonisation
33//
34// Author: Laszlo Urban
35//
36// Creation date: 30.05.1997
37//
38// Modified by Laszlo Urban, Michel Maire and Vladimir Ivanchenko
39//
40//
41// -------------------------------------------------------------------
42//
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
45
46#include "G4hIonisation.hh"
48#include "G4SystemOfUnits.hh"
49#include "G4Electron.hh"
50#include "G4Proton.hh"
51#include "G4AntiProton.hh"
52#include "G4BraggModel.hh"
53#include "G4BetheBlochModel.hh"
54#include "G4IonFluctuations.hh"
56#include "G4BohrFluctuations.hh"
57#include "G4UnitsTable.hh"
58#include "G4PionPlus.hh"
59#include "G4PionMinus.hh"
60#include "G4KaonPlus.hh"
61#include "G4KaonMinus.hh"
62#include "G4ICRU73QOModel.hh"
63#include "G4EmParameters.hh"
64
65//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
66
67using namespace std;
68
71 isInitialised(false)
72{
75 mass = 0.0;
76 ratio = 0.0;
77 eth = 2*MeV;
78}
79
80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
81
83{}
84
85//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
86
88{
89 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&
90 !p.IsShortLived());
91}
92
93//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
94
96 const G4Material*,
97 G4double cut)
98{
99 G4double x = 0.5*cut/electron_mass_c2;
100 G4double gam = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
101 return mass*(gam - 1.0);
102}
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105
107 const G4ParticleDefinition* part,
108 const G4ParticleDefinition* bpart)
109{
110 if(!isInitialised) {
111
112 const G4ParticleDefinition* theBaseParticle = nullptr;
113 G4String pname = part->GetParticleName();
114 G4double q = part->GetPDGCharge();
115
116 //G4cout << " G4hIonisation::InitialiseEnergyLossProcess " << pname
117 // << " " << bpart << G4endl;
118
119 // standard base particles
120 if(part == bpart || pname == "proton" ||
121 pname == "anti_proton" ||
122 pname == "pi+" || pname == "pi-" ||
123 pname == "kaon+" || pname == "kaon-" || pname == "GenericIon"
124 || pname == "He3" || pname == "alpha")
125 {
126 theBaseParticle = nullptr;
127 }
128 // select base particle
129 else if(bpart == nullptr) {
130
131 if(part->GetPDGSpin() == 0.0) {
132 if(q > 0.0) { theBaseParticle = G4KaonPlus::KaonPlus(); }
133 else { theBaseParticle = G4KaonMinus::KaonMinus(); }
134 } else {
135 if(q > 0.0) { theBaseParticle = G4Proton::Proton(); }
136 else { theBaseParticle = G4AntiProton::AntiProton(); }
137 }
138
139 // base particle defined by interface
140 } else {
141 theBaseParticle = bpart;
142 }
143 SetBaseParticle(theBaseParticle);
144
145 mass = part->GetPDGMass();
146 ratio = electron_mass_c2/mass;
147 eth = 2.0*MeV*mass/proton_mass_c2;
148
150 G4double emin = std::min(param->MinKinEnergy(), 0.1*eth);
151 G4double emax = std::max(param->MaxKinEnergy(), 100*eth);
152
153 if(emin != param->MinKinEnergy() || emax != param->MaxKinEnergy()) {
154 SetMinKinEnergy(emin);
155 SetMaxKinEnergy(emax);
156 G4int bin = G4lrint(param->NumberOfBinsPerDecade()*std::log10(emax/emin));
157 SetDEDXBinning(bin);
158 }
159
160 if (!EmModel(0)) {
161 if(q > 0.0) { SetEmModel(new G4BraggModel()); }
162 else { SetEmModel(new G4ICRU73QOModel()); }
163 }
164 EmModel(0)->SetLowEnergyLimit(emin);
167
169
170 if (!EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
171 EmModel(1)->SetLowEnergyLimit(eth);
172 EmModel(1)->SetHighEnergyLimit(emax);
173 AddEmModel(1, EmModel(1), FluctModel());
174
175 isInitialised = true;
176 }
177}
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
180
182{}
183
184//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
185
186void G4hIonisation::ProcessDescription(std::ostream& out) const
187{
188 out << " Ionisation";
190}
191
192//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@ fIonisation
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4AntiProton * AntiProton()
Definition: G4AntiProton.cc:92
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4EmParameters * Instance()
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4double MaxKinEnergy() const
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:757
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:764
void SetMaxKinEnergy(G4double e)
void SetFluctModel(G4VEmFluctuationModel *)
virtual void ProcessDescription(std::ostream &outFile) const override
void SetDEDXBinning(G4int nbins)
void SetEmModel(G4VEmModel *, G4int index=0)
G4VEmModel * EmModel(size_t index=0) const
void SetBaseParticle(const G4ParticleDefinition *p)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=nullptr)
void SetSecondaryParticle(const G4ParticleDefinition *p)
G4VEmFluctuationModel * FluctModel()
void SetMinKinEnergy(G4double e)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:406
virtual ~G4hIonisation()
virtual G4bool IsApplicable(const G4ParticleDefinition &p) override
virtual void ProcessDescription(std::ostream &) const override
virtual void PrintInfo() final
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *p, const G4Material *, G4double cut) final
G4hIonisation(const G4String &name="hIoni")
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *) override
int G4lrint(double ad)
Definition: templates.hh:134