ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4hIonisation.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4hIonisation.cc
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"
47 #include "G4PhysicalConstants.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 
67 using namespace std;
68 
70  : G4VEnergyLossProcess(name),
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();
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);
166  AddEmModel(1, EmModel(0), new G4IonFluctuations());
167 
169 
170  if (!EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
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 
186 void G4hIonisation::ProcessDescription(std::ostream& out) const
187 {
188  out << " Ionisation";
190 }
191 
192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....