Geant4-11
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 "G4UnitsTable.hh"
57#include "G4PionPlus.hh"
58#include "G4PionMinus.hh"
59#include "G4KaonPlus.hh"
60#include "G4KaonMinus.hh"
61#include "G4ICRU73QOModel.hh"
62#include "G4EmParameters.hh"
63
64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
65
68 isInitialised(false)
69{
72 mass = 0.0;
73 ratio = 0.0;
74 eth = 2*CLHEP::MeV;
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
80{}
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83
85{
86 return true;
87}
88
89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
90
92 const G4Material*,
93 G4double cut)
94{
95 G4double x = 0.5*cut/electron_mass_c2;
96 G4double gam = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
97 return mass*(gam - 1.0);
98}
99
100//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
101
103 const G4ParticleDefinition* part,
104 const G4ParticleDefinition* bpart)
105{
106 if(!isInitialised) {
107
108 const G4ParticleDefinition* theBaseParticle = nullptr;
110 G4double q = part->GetPDGCharge();
111
112 //G4cout << " G4hIonisation::InitialiseEnergyLossProcess " << pname
113 // << " " << bpart << G4endl;
114
115 // define base particle
116 if(part == bpart) {
117 theBaseParticle = nullptr;
118 } else if(nullptr != bpart) {
119 theBaseParticle = bpart;
120
121 } else if(pname == "proton" || pname == "anti_proton" ||
122 pname == "pi+" || pname == "pi-" ||
123 pname == "kaon+" || pname == "kaon-" ||
124 pname == "GenericIon" || pname == "alpha") {
125 // no base particles
126 theBaseParticle = nullptr;
127
128 } else {
129 // select base particle
130 if(part->GetPDGSpin() == 0.0) {
131 if(q > 0.0) { theBaseParticle = G4KaonPlus::KaonPlus(); }
132 else { theBaseParticle = G4KaonMinus::KaonMinus(); }
133 } else {
134 if(q > 0.0) { theBaseParticle = G4Proton::Proton(); }
135 else { theBaseParticle = G4AntiProton::AntiProton(); }
136 }
137 }
138 SetBaseParticle(theBaseParticle);
139
140 mass = part->GetPDGMass();
143
145 G4double emin = std::min(param->MinKinEnergy(), 0.1*eth);
146 G4double emax = std::max(param->MaxKinEnergy(), 100*eth);
147
148 if(emin != param->MinKinEnergy() || emax != param->MaxKinEnergy()) {
149 SetMinKinEnergy(emin);
151 G4int bin = G4lrint(param->NumberOfBinsPerDecade()*std::log10(emax/emin));
152 SetDEDXBinning(bin);
153 }
154
155 if (nullptr == EmModel(0)) {
156 if(q > 0.0) { SetEmModel(new G4BraggModel()); }
157 else { SetEmModel(new G4ICRU73QOModel()); }
158 }
159 EmModel(0)->SetLowEnergyLimit(emin);
162
163 if (nullptr == FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
164
165 if (nullptr == EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
168 AddEmModel(1, EmModel(1), FluctModel());
169
170 isInitialised = true;
171 }
172}
173
174//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
175
176void G4hIonisation::ProcessDescription(std::ostream& out) const
177{
178 out << " Ionisation";
180}
181
182//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
static const G4double emax
@ fIonisation
static constexpr double MeV
Definition: G4SIunits.hh:200
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:767
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:774
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
void SetMaxKinEnergy(G4double e)
void SetFluctModel(G4VEmFluctuationModel *)
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)
G4VEmFluctuationModel * FluctModel() const
void SetSecondaryParticle(const G4ParticleDefinition *p)
void SetMinKinEnergy(G4double e)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:406
G4bool isInitialised
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
static constexpr double MeV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const char * name(G4int ptype)
string pname
Definition: eplot.py:33
float electron_mass_c2
Definition: hepunit.py:273
float proton_mass_c2
Definition: hepunit.py:274
int G4lrint(double ad)
Definition: templates.hh:134