Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CoulombScattering.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: G4CoulombScattering
33//
34// Author: Vladimir Ivanchenko
35//
36// Creation date: 22.08.2004
37//
38// Modifications:
39// 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and
40// G4CoulombScatteringModel
41//
42
43//
44// -------------------------------------------------------------------
45//
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48
50#include "G4SystemOfUnits.hh"
53#include "G4Proton.hh"
54#include "G4EmParameters.hh"
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
57
70
71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
72
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84
86
87//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
88
93
94//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
95
97{
98 // second initialisation not allowed for the time being
99 // this means that polar angle limit change will not be appled
100 // after first initialisation
101 if(isInitialised) { return; }
102
104 G4double a = param->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
105 q2Max = 0.5*a*a;
106 G4double theta = param->MscThetaLimit();
107
108 // restricted or non-restricted cross section table
109 if(isCombined) {
110 if(theta == CLHEP::pi) {
111 // for restriced single scattering change cross section shape
114 }
115 } else {
116 SetSplineFlag(true);
118 }
119 isInitialised = true;
120 G4double mass = p->GetPDGMass();
121 G4String name = p->GetParticleName();
122
123 G4bool ion = false;
124 if (mass > CLHEP::GeV || p->GetParticleType() == "nucleus") {
125 SetBuildTableFlag(false);
126 ion = true;
127 if(name != "GenericIon") { SetVerboseLevel(0); }
128 } else {
129 if(name != "e-" && name != "e+" &&
130 name != "mu+" && name != "mu-" && name != "pi+" &&
131 name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
132 }
133 /*
134 G4cout << "### G4CoulombScattering::InitialiseProcess: "
135 << p->GetParticleName()
136 << " Emin(MeV)= " << MinKinEnergy()/MeV
137 << " Emax(TeV)= " << MaxKinEnergy()/TeV
138 << " nbins= " << LambdaBinning()
139 << " theta= " << theta
140 << " mass(MeV)= " << mass
141 << " isCombined=" << isCombined
142 << " ion=" << ion
143 << G4endl;
144 */
145 if(nullptr == EmModel(0)) {
146 if(ion) { SetEmModel(new G4IonCoulombScatteringModel()); }
147 else { SetEmModel(new G4eCoulombScatteringModel(isCombined)); }
148 }
149 G4VEmModel* model = EmModel(0);
150 G4double emin = std::max(param->MinKinEnergy(),model->LowEnergyLimit());
151 G4double emax = std::min(param->MaxKinEnergy(),model->HighEnergyLimit());
152 model->SetPolarAngleLimit(theta);
153 model->SetLowEnergyLimit(emin);
154 model->SetHighEnergyLimit(emax);
155 AddEmModel(1, model);
156}
157
158//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
159
161 const G4Material* mat)
162{
163 // Pure Coulomb scattering
164 G4double emin = 0.0;
165
166 // Coulomb scattering combined with multiple or hadronic scattering
168
169 if(0.0 < theta) {
170 G4double p2 = q2Max*mat->GetIonisation()->GetInvA23()/(1.0 - std::cos(theta));
171 G4double mass = part->GetPDGMass();
172 emin = p2/(std::sqrt(p2 + mass*mass) + mass);
173 }
174
175 return emin;
176}
177
178//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
179
180void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile) const
181{
182 G4double tetmin = G4EmParameters::Instance()->MscThetaLimit()/CLHEP::degree;
183 outFile << " ";
184 if(tetmin > 179.) { outFile << "ThetaMin(p)"; }
185 else { outFile << tetmin; }
186 outFile << " < Theta(degree) < 180";
187
188 if(q2Max < DBL_MAX) {
189 outFile << ", pLimit(GeV^1)= " << std::sqrt(q2Max)/GeV;
190 }
191 outFile << G4endl;
192}
193
194//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
195
196void G4CoulombScattering::ProcessDescription(std::ostream& out) const
197{
198 out <<
199 " Coulomb scattering. Simulation of elastic scattering\n" <<
200 " events individually. May be used in combination with multiple\n" <<
201 " scattering, where Coulomb scattering is used for hard (large angle)\n" <<
202 " collisions and multiple scattering for soft collisions.";
204}
205
206//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@ fCoulombScattering
@ fEmOnePeak
@ fEmDecreasing
@ fEmIncreasing
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
#define G4endl
Definition G4ios.hh:67
G4CoulombScattering(const G4String &name, G4bool combined)
G4bool IsApplicable(const G4ParticleDefinition &p) final
void ProcessDescription(std::ostream &) const override
void StreamProcessInfo(std::ostream &outFile) const override
~G4CoulombScattering() override
G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *) final
void InitialiseProcess(const G4ParticleDefinition *) override
static G4EmParameters * Instance()
G4double MinKinEnergy() const
G4double MscThetaLimit() const
G4double MaxKinEnergy() const
G4double FactorForAngleLimit() const
G4double GetInvA23() const
G4IonisParamMat * GetIonisation() const
const G4String & GetParticleType() const
const G4String & GetParticleName() const
static G4Proton * Proton()
Definition G4Proton.cc:90
void SetPolarAngleLimit(G4double)
void SetHighEnergyLimit(G4double)
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
G4VEmModel * EmModel(size_t index=0) const
void SetBuildTableFlag(G4bool val)
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
void SetEmModel(G4VEmModel *, G4int index=0)
void SetSecondaryParticle(const G4ParticleDefinition *p)
void SetSplineFlag(G4bool val)
void SetCrossSectionType(G4CrossSectionType val)
void ProcessDescription(std::ostream &outFile) const override
void SetStartFromNullFlag(G4bool val)
void SetVerboseLevel(G4int value)
void SetProcessSubType(G4int)
#define DBL_MAX
Definition templates.hh:62