Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4CoulombScattering.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 // $Id: G4CoulombScattering.cc 107365 2017-11-09 10:54:29Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4CoulombScattering
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 22.08.2004
38 //
39 // Modifications:
40 // 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and
41 // G4CoulombScatteringModel
42 //
43 
44 //
45 // -------------------------------------------------------------------
46 //
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 
50 #include "G4CoulombScattering.hh"
51 #include "G4SystemOfUnits.hh"
54 #include "G4Proton.hh"
55 #include "G4EmParameters.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58 
59 using namespace std;
60 
62  : G4VEmProcess(name),q2Max(TeV*TeV),isInitialised(false)
63 {
64  // G4cout << "G4CoulombScattering constructor "<< G4endl;
65  SetBuildTableFlag(true);
66  SetStartFromNullFlag(false);
67  SetIntegral(true);
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73 
75 {}
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78 
80 {
81  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
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) { yes = true; }
102  /*
103  G4cout << "### G4CoulombScattering::InitialiseProcess: "
104  << p->GetParticleName()
105  << " Emin(MeV)= " << MinKinEnergy()/MeV
106  << " Emax(TeV)= " << MaxKinEnergy()/TeV
107  << " nbins= " << LambdaBinning()
108  << " theta= " << theta
109  << G4endl;
110  */
111 
112  isInitialised = true;
113  G4double mass = p->GetPDGMass();
115  //G4cout << name << " type: " << p->GetParticleType()
116  //<< " mass= " << mass << G4endl;
117  yes = true;
118  if (mass > GeV || p->GetParticleType() == "nucleus") {
119  SetBuildTableFlag(false);
120  yes = false;
121  if(name != "GenericIon") { SetVerboseLevel(0); }
122  } else {
123  if(name != "e-" && name != "e+" &&
124  name != "mu+" && name != "mu-" && name != "pi+" &&
125  name != "kaon+" && name != "proton" ) { SetVerboseLevel(0); }
126  }
127 
128  if(!EmModel(0)) {
129  if(yes) { SetEmModel(new G4eCoulombScatteringModel()); }
130  else { SetEmModel(new G4IonCoulombScatteringModel()); }
131  }
132  G4VEmModel* model = EmModel(0);
133  G4double emin = std::max(param->MinKinEnergy(),model->LowEnergyLimit());
134  G4double emax = std::min(param->MaxKinEnergy(),model->HighEnergyLimit());
135  model->SetPolarAngleLimit(theta);
136  model->SetLowEnergyLimit(emin);
137  model->SetHighEnergyLimit(emax);
138  AddEmModel(1, model);
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
142 
144  const G4Material* mat)
145 {
146  // Pure Coulomb scattering
147  G4double emin = 0.0;
148 
149  // Coulomb scattering combined with multiple or hadronic scattering
151 
152  if(0.0 < theta) {
153  G4double p2 = q2Max*mat->GetIonisation()->GetInvA23()/(1.0 - cos(theta));
154  G4double mass = part->GetPDGMass();
155  emin = sqrt(p2 + mass*mass) - mass;
156  }
157 
158  return emin;
159 }
160 
161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
162 
163 void G4CoulombScattering::StreamProcessInfo(std::ostream& outFile,
164  G4String endOfLine) const
165 {
167  outFile << " ";
168  if(tetmin > 179.) { outFile << "ThetaMin(p)"; }
169  else { outFile << tetmin; }
170  outFile << " < Theta(degree) < 180";
171 
172  if(q2Max < DBL_MAX) { outFile << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
173  outFile << endOfLine;
174 }
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
177 
178 void G4CoulombScattering::ProcessDescription(std::ostream& out) const
179 {
180  out <<
181  "<strong>Coulomb scattering</strong>. Simulation of elastic scattering <br>"
182  "events individually. May be used in combination with multiple<br>"
183  "scattering, where Coulomb scattering is used for hard (large angle)<br>"
184  "collisions and multiple scattering for soft collisions.";
186 }
187 
188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const XML_Char * name
Definition: expat.h:151
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:707
const char * p
Definition: xmltok.h:285
void SetBuildTableFlag(G4bool val)
static constexpr double hbarc
G4double MaxKinEnergy() const
const G4String & GetParticleName() const
const G4String & GetParticleType() const
G4VEmModel * EmModel(size_t index=0) const
G4double GetPDGCharge() const
static const G4double emax
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4double GetPDGMass() const
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:616
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:440
static constexpr double fermi
Definition: SystemOfUnits.h:83
static constexpr double TeV
Definition: G4SIunits.hh:218
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
virtual void ProcessDescription(std::ostream &outFile) const override
virtual G4bool IsApplicable(const G4ParticleDefinition &p) final
void SetEmModel(G4VEmModel *, G4int index=0)
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:742
void SetSecondaryParticle(const G4ParticleDefinition *p)
Float_t mat
G4double MinKinEnergy() const
virtual void StreamProcessInfo(std::ostream &outFile, G4String endOfLine=G4String("\n")) const override
G4double GetInvA23() const
G4double MscThetaLimit() const
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:714
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *) final
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:227
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:435
virtual void InitialiseProcess(const G4ParticleDefinition *) override
static constexpr double degree
Definition: G4SIunits.hh:144
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
G4double FactorForAngleLimit() const
void SetStartFromNullFlag(G4bool val)
virtual void ProcessDescription(std::ostream &) const override
G4CoulombScattering(const G4String &name="CoulombScat")
void SetIntegral(G4bool val)
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:609
#define DBL_MAX
Definition: templates.hh:83
const XML_Char XML_Content * model
Definition: expat.h:151
static constexpr double GeV
Definition: G4SIunits.hh:217
static G4EmParameters * Instance()
static constexpr double pi
Definition: SystemOfUnits.h:54
T min(const T t1, const T t2)
brief Return the smallest of the two arguments