source: trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc@ 1036

Last change on this file since 1036 was 1007, checked in by garnier, 17 years ago

update to geant4.9.2

File size: 5.1 KB
Line 
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.19 2008/10/15 17:53:44 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-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
58using namespace std;
59
60G4CoulombScattering::G4CoulombScattering(const G4String& name)
61 : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV),
62 isInitialised(false)
63{
64 SetBuildTableFlag(true);
65 SetStartFromNullFlag(false);
66 SetIntegral(true);
67 thEnergy = PeV;
68 thEnergyElec = PeV;
69 if(name == "CoulombScat") {
70 thEnergy = 10.*MeV;
71 thEnergyElec = 10.*GeV;
72 }
73 SetSecondaryParticle(G4Electron::Electron());
74 SetProcessSubType(fCoulombScattering);
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
79G4CoulombScattering::~G4CoulombScattering()
80{}
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83
84void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
85{
86 // second initialisation
87 if(isInitialised) {
88 G4VEmModel* mod = GetModelByIndex(0);
89 mod->SetPolarAngleLimit(PolarAngleLimit());
90 mod = GetModelByIndex(1);
91 if(mod) mod->SetPolarAngleLimit(PolarAngleLimit());
92
93 // first initialisation
94 } else {
95 isInitialised = true;
96 aParticle = p;
97 G4double mass = p->GetPDGMass();
98 if (mass > GeV || p->GetParticleType() == "nucleus") {
99 SetBuildTableFlag(false);
100 verboseLevel = 0;
101 } else {
102 G4String name = p->GetParticleName();
103 if(name != "e-" && name != "e+" &&
104 name != "mu+" && name != "mu-" && name != "pi+" &&
105 name != "kaon+" && name != "proton" ) verboseLevel = 0;
106 }
107
108 G4double emin = MinKinEnergy();
109 G4double emax = MaxKinEnergy();
110 G4double eth = thEnergy;
111 if(mass < MeV) eth = thEnergyElec;
112 if(eth > emin) {
113 G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
114 model->SetPolarAngleLimit(PolarAngleLimit());
115 model->SetLowEnergyLimit(emin);
116 model->SetHighEnergyLimit(std::min(eth,emax));
117 AddEmModel(1, model);
118 }
119 if(eth < emax) {
120 G4CoulombScatteringModel* model = new G4CoulombScatteringModel();
121 model->SetPolarAngleLimit(PolarAngleLimit());
122 model->SetLowEnergyLimit(eth);
123 model->SetHighEnergyLimit(emax);
124 AddEmModel(2, model);
125 }
126 }
127}
128
129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
130
131void G4CoulombScattering::PrintInfo()
132{
133 G4cout << " " << PolarAngleLimit()/degree
134 << " < Theta(degree) < 180"
135 << ", Eth(MeV)= ";
136 if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec;
137 else G4cout << thEnergy;
138
139 if(q2Max < DBL_MAX) G4cout << "; q2Max(GeV^2)= " << q2Max/(GeV*GeV);
140 G4cout << G4endl;
141}
142
143//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracBrowser for help on using the repository browser.