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,v 1.11 2007/11/20 18:43:25 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-01-patch-02 $ |
---|
28 | // |
---|
29 | // ------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // GEANT4 Class file |
---|
32 | // |
---|
33 | // |
---|
34 | // File name: G4CoulombScattering |
---|
35 | // |
---|
36 | // Author: Vladimir Ivanchenko |
---|
37 | // |
---|
38 | // Creation date: 22.08.2004 |
---|
39 | // |
---|
40 | // Modifications: |
---|
41 | // 01.08.06 V.Ivanchenko add choice between G4eCoulombScatteringModel and |
---|
42 | // G4CoulombScatteringModel |
---|
43 | // |
---|
44 | |
---|
45 | // |
---|
46 | // ------------------------------------------------------------------- |
---|
47 | // |
---|
48 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
49 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
50 | |
---|
51 | #include "G4CoulombScattering.hh" |
---|
52 | #include "G4CoulombScatteringModel.hh" |
---|
53 | #include "G4eCoulombScatteringModel.hh" |
---|
54 | #include "G4Electron.hh" |
---|
55 | |
---|
56 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
57 | |
---|
58 | using namespace std; |
---|
59 | |
---|
60 | G4CoulombScattering::G4CoulombScattering(const G4String& name) |
---|
61 | : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(DBL_MAX), |
---|
62 | isInitialised(false) |
---|
63 | { |
---|
64 | G4VEmProcess::SetBuildTableFlag(true); |
---|
65 | SetStartFromNullFlag(false); |
---|
66 | SetIntegral(true); |
---|
67 | SetMinKinEnergy(keV); |
---|
68 | SetMaxKinEnergy(PeV); |
---|
69 | thEnergy = PeV; |
---|
70 | thEnergyElec = PeV; |
---|
71 | if(name == "CoulombScat") { |
---|
72 | thEnergy = 10.*MeV; |
---|
73 | thEnergyElec = 10.*GeV; |
---|
74 | } |
---|
75 | SetLambdaBinning(120); |
---|
76 | SetSecondaryParticle(G4Electron::Electron()); |
---|
77 | buildElmTableFlag = true; |
---|
78 | } |
---|
79 | |
---|
80 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
81 | |
---|
82 | G4CoulombScattering::~G4CoulombScattering() |
---|
83 | {} |
---|
84 | |
---|
85 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
86 | |
---|
87 | void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p) |
---|
88 | { |
---|
89 | if(!isInitialised) { |
---|
90 | isInitialised = true; |
---|
91 | aParticle = p; |
---|
92 | G4double mass = p->GetPDGMass(); |
---|
93 | if (mass > GeV || p->GetParticleType() == "nucleus") { |
---|
94 | buildElmTableFlag = false; |
---|
95 | verboseLevel = 0; |
---|
96 | } else { |
---|
97 | G4String name = p->GetParticleName(); |
---|
98 | if(name != "e-" && name != "e+" && |
---|
99 | name != "mu+" && name != "mu-" && name != "pi+" && |
---|
100 | name != "kaon+" && name != "proton" ) verboseLevel = 0; |
---|
101 | } |
---|
102 | |
---|
103 | G4double emin = MinKinEnergy(); |
---|
104 | G4double emax = MaxKinEnergy(); |
---|
105 | G4double eth = thEnergy; |
---|
106 | if(mass < MeV) eth = thEnergyElec; |
---|
107 | if(eth > emin) { |
---|
108 | G4eCoulombScatteringModel* model = |
---|
109 | new G4eCoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max); |
---|
110 | model->SetLowEnergyLimit(emin); |
---|
111 | model->SetHighEnergyLimit(std::min(eth,emax)); |
---|
112 | AddEmModel(1, model); |
---|
113 | } |
---|
114 | if(eth < emax) { |
---|
115 | G4CoulombScatteringModel* model = |
---|
116 | new G4CoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max); |
---|
117 | model->SetLowEnergyLimit(eth); |
---|
118 | model->SetHighEnergyLimit(emax); |
---|
119 | AddEmModel(2, model); |
---|
120 | } |
---|
121 | } |
---|
122 | } |
---|
123 | |
---|
124 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
125 | |
---|
126 | void G4CoulombScattering::PrintInfo() |
---|
127 | { |
---|
128 | G4cout << " Scattering of " << aParticle->GetParticleName() |
---|
129 | << " with " << thetaMin/degree |
---|
130 | << " < Theta(degree) < " << thetaMax/degree |
---|
131 | << "; Eth(MeV)= "; |
---|
132 | if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec; |
---|
133 | else G4cout << thEnergy; |
---|
134 | |
---|
135 | if(q2Max < DBL_MAX) G4cout << "; q2Max(GeV^2)= " << q2Max/(GeV*GeV); |
---|
136 | G4cout << G4endl; |
---|
137 | } |
---|
138 | |
---|
139 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|