Geant4 10.7.0
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
58using namespace std;
59
61 : G4VEmProcess(name),q2Max(TeV*TeV),isInitialised(false)
62{
63 // G4cout << "G4CoulombScattering constructor "<< G4endl;
66 SetIntegral(true);
69}
70
71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
72
74{}
75
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
77
79{
80 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
81}
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84
86{
87 // second initialisation not allowed for the time being
88 // this means that polar angle limit change will not be appled
89 // after first initialisation
90 if(isInitialised) { return; }
91
93 G4double a = param->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
94 q2Max = 0.5*a*a;
95 G4double theta = param->MscThetaLimit();
96
97 // restricted or non-restricted cross section table
98 G4bool yes = false;
99 if(theta == CLHEP::pi) { yes = true; }
101 /*
102 G4cout << "### G4CoulombScattering::InitialiseProcess: "
103 << p->GetParticleName()
104 << " Emin(MeV)= " << MinKinEnergy()/MeV
105 << " Emax(TeV)= " << MaxKinEnergy()/TeV
106 << " nbins= " << LambdaBinning()
107 << " theta= " << theta
108 << G4endl;
109 */
110
111 isInitialised = true;
112 G4double mass = p->GetPDGMass();
113 G4String name = p->GetParticleName();
114 //G4cout << name << " type: " << p->GetParticleType()
115 //<< " mass= " << mass << G4endl;
116 yes = true;
117 if (mass > GeV || p->GetParticleType() == "nucleus") {
118 SetBuildTableFlag(false);
119 yes = false;
120 if(name != "GenericIon") { SetVerboseLevel(0); }
121 } else {
122 if(name != "e-" && name != "e+" &&
123 name != "mu+" && name != "mu-" && name != "pi+" &&
124 name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
125 }
126
127 if(!EmModel(0)) {
128 if(yes) { SetEmModel(new G4eCoulombScatteringModel()); }
130 }
131 G4VEmModel* model = EmModel(0);
132 G4double emin = std::max(param->MinKinEnergy(),model->LowEnergyLimit());
133 G4double emax = std::min(param->MaxKinEnergy(),model->HighEnergyLimit());
134 model->SetPolarAngleLimit(theta);
135 model->SetLowEnergyLimit(emin);
136 model->SetHighEnergyLimit(emax);
137 AddEmModel(1, model);
138}
139
140//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141
143 const G4Material* mat)
144{
145 // Pure Coulomb scattering
146 G4double emin = 0.0;
147
148 // Coulomb scattering combined with multiple or hadronic scattering
150
151 if(0.0 < theta) {
152 G4double p2 = q2Max*mat->GetIonisation()->GetInvA23()/(1.0 - cos(theta));
153 G4double mass = part->GetPDGMass();
154 emin = sqrt(p2 + mass*mass) - mass;
155 }
156
157 return emin;
158}
159
160//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
161
162void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile) const
163{
165 outFile << " ";
166 if(tetmin > 179.) { outFile << "ThetaMin(p)"; }
167 else { outFile << tetmin; }
168 outFile << " < Theta(degree) < 180";
169
170 if(q2Max < DBL_MAX) { outFile << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
171 outFile << G4endl;
172}
173
174//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
175
176void G4CoulombScattering::ProcessDescription(std::ostream& out) const
177{
178 out <<
179 " Coulomb scattering. Simulation of elastic scattering\n" <<
180 " events individually. May be used in combination with multiple\n" <<
181 " scattering, where Coulomb scattering is used for hard (large angle)\n" <<
182 " collisions and multiple scattering for soft collisions.";
184}
185
186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@ fCoulombScattering
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
virtual G4bool IsApplicable(const G4ParticleDefinition &p) final
G4CoulombScattering(const G4String &name="CoulombScat")
virtual void ProcessDescription(std::ostream &) const override
virtual void StreamProcessInfo(std::ostream &outFile) const override
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *) final
virtual 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
Definition: G4Material.hh:224
const G4String & GetParticleType() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4Proton * Proton()
Definition: G4Proton.cc:92
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:792
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:757
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:652
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:645
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:764
void SetIntegral(G4bool val)
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)
virtual void ProcessDescription(std::ostream &outFile) const override
void SetStartFromNullFlag(G4bool val)
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:412
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:406
#define DBL_MAX
Definition: templates.hh:62