source: trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionIonisationBorn.cc@ 1005

Last change on this file since 1005 was 991, checked in by garnier, 17 years ago

update

File size: 5.0 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: G4CrossSectionIonisationBorn.cc,v 1.4 2008/08/20 14:51:48 sincerti Exp $
27// GEANT4 tag $Name: geant4-09-02 $
28
29#include "G4CrossSectionIonisationBorn.hh"
30
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33G4CrossSectionIonisationBorn::G4CrossSectionIonisationBorn()
34{
35 lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV
36 highEnergyLimitDefault = 30 * keV;
37
38 G4String fileElectron("dna/sigma_ionisation_e_born");
39 G4String fileProton("dna/sigma_ionisation_p_born");
40
41 G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition();
42 G4ParticleDefinition* protonDef = G4Proton::ProtonDefinition();
43
44 G4String electron;
45 G4String proton;
46
47 G4double scaleFactor = (1.e-22 / 3.343) * m*m;
48
49 if (electronDef != 0)
50 {
51 electron = electronDef->GetParticleName();
52 tableFile[electron] = fileElectron;
53
54 lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV
55 highEnergyLimit[electron] = 30. * keV;
56
57 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
58 tableE->LoadData(fileElectron);
59
60 tableData[electron] = tableE;
61 }
62 else
63 {
64 G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined");
65 }
66
67 if (protonDef != 0)
68 {
69 proton = protonDef->GetParticleName();
70 tableFile[proton] = fileProton;
71
72 lowEnergyLimit[proton] = 500. * keV;
73 highEnergyLimit[proton] = 10. * MeV;
74
75 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
76 tableP->LoadData(fileProton);
77
78 tableData[proton] = tableP;
79 }
80 else
81 {
82 G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");
83 }
84}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87
88G4CrossSectionIonisationBorn::~G4CrossSectionIonisationBorn()
89{
90 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
91 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
92 {
93 G4DNACrossSectionDataSet* table = pos->second;
94 delete table;
95 }
96}
97
98//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99
100G4double G4CrossSectionIonisationBorn::CrossSection(const G4Track& track )
101{
102 const G4DynamicParticle* particle = track.GetDynamicParticle();
103 G4double k = particle->GetKineticEnergy();
104
105 G4double sigma = 0.;
106
107 G4double lowLim = lowEnergyLimitDefault;
108 G4double highLim = highEnergyLimitDefault;
109
110 const G4String& particleName = particle->GetDefinition()->GetParticleName();
111
112 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
113 pos1 = lowEnergyLimit.find(particleName);
114
115 if (pos1 != lowEnergyLimit.end())
116 {
117 lowLim = pos1->second;
118 }
119
120 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
121 pos2 = highEnergyLimit.find(particleName);
122
123 if (pos2 != highEnergyLimit.end())
124 {
125 highLim = pos2->second;
126 }
127
128 if (k > lowLim && k < highLim)
129 {
130 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
131 pos = tableData.find(particleName);
132
133 if (pos != tableData.end())
134 {
135 G4DNACrossSectionDataSet* table = pos->second;
136 if (table != 0)
137 {
138 sigma = table->FindValue(k);
139 }
140 }
141 else
142 {
143 G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle");
144 }
145 }
146
147 return sigma;
148}
149
Note: See TracBrowser for help on using the repository browser.