Geant4  10.02.p01
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 // $Id: G4CoulombScattering.cc 85246 2014-10-27 08:26:11Z 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 
94  G4double a = param->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
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(1)) {
129  if(yes) { SetEmModel(new G4eCoulombScatteringModel(), 1); }
130  else { SetEmModel(new G4IonCoulombScatteringModel(), 1); }
131  }
132  G4VEmModel* model = EmModel(1);
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 
164 {
166  << " < Theta(degree) < 180";
167 
168  if(q2Max < DBL_MAX) { G4cout << "; pLimit(GeV^1)= " << sqrt(q2Max)/GeV; }
169  G4cout << G4endl;
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:226
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4double MaxKinEnergy() const
virtual G4bool IsApplicable(const G4ParticleDefinition &p)
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
void SetBuildTableFlag(G4bool val)
G4VEmModel * EmModel(G4int index=1) const
G4String name
Definition: TRTMaterials.hh:40
G4double MscThetaLimit() const
G4double a
Definition: TRTMaterials.hh:39
void SetStartFromNullFlag(G4bool val)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
void SetEmModel(G4VEmModel *, G4int index=1)
G4GLOB_DLL std::ostream G4cout
virtual void InitialiseProcess(const G4ParticleDefinition *)
bool G4bool
Definition: G4Types.hh:79
G4double GetInvA23() const
static G4Proton * Proton()
Definition: G4Proton.cc:93
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:432
static const double GeV
Definition: G4SIunits.hh:214
const G4String & GetParticleType() const
G4double MinKinEnergy() const
void SetIntegral(G4bool val)
static const G4double emax
G4double GetPDGMass() const
static const double pi
Definition: G4SIunits.hh:74
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=0)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void SetSecondaryParticle(const G4ParticleDefinition *p)
static G4EmParameters * Instance()
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static const double degree
Definition: G4SIunits.hh:143
#define G4endl
Definition: G4ios.hh:61
static const double TeV
Definition: G4SIunits.hh:215
double G4double
Definition: G4Types.hh:76
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:732
G4double GetPDGCharge() const
#define DBL_MAX
Definition: templates.hh:83
static const double fermi
Definition: G4SIunits.hh:102
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:760
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4double FactorForAngleLimit() const
G4CoulombScattering(const G4String &name="CoulombScat")