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