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

Last change on this file since 1197 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 5.7 KB
RevLine 
[819]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//
[1192]26// $Id: G4CrossSectionIonisationBorn.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
[1196]27// GEANT4 tag $Name: geant4-09-03-cand-01 $
[819]28
29#include "G4CrossSectionIonisationBorn.hh"
30
[961]31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
[819]32
33G4CrossSectionIonisationBorn::G4CrossSectionIonisationBorn()
34{
[961]35 lowEnergyLimitDefault = 12.61 * eV; // SI: i/o 25 eV
[819]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)
[961]50 {
51 electron = electronDef->GetParticleName();
52 tableFile[electron] = fileElectron;
[819]53
[961]54 lowEnergyLimit[electron] = 12.61 * eV; // SI: i/o 25 eV
55 highEnergyLimit[electron] = 30. * keV;
[819]56
[961]57 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
58 tableE->LoadData(fileElectron);
[819]59
[961]60 tableData[electron] = tableE;
61 }
[819]62 else
[961]63 {
64 G4Exception("G4CrossSectionIonisationBorn Constructor: electron is not defined");
65 }
[819]66
67 if (protonDef != 0)
[961]68 {
69 proton = protonDef->GetParticleName();
70 tableFile[proton] = fileProton;
[819]71
[961]72 lowEnergyLimit[proton] = 500. * keV;
73 highEnergyLimit[proton] = 10. * MeV;
[819]74
[961]75 G4DNACrossSectionDataSet* tableP = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
76 tableP->LoadData(fileProton);
[819]77
[961]78 tableData[proton] = tableP;
79 }
[819]80 else
[961]81 {
82 G4Exception("G4CrossSectionIonisationBorn Constructor: proton is not defined");
83 }
[1055]84
85 G4cout << G4endl;
86 G4cout << "*******************************************************************************" << G4endl;
87 G4cout << "*******************************************************************************" << G4endl;
88 G4cout << " The class G4CrossSectionIonisationBorn is NOT SUPPORTED ANYMORE. " << G4endl;
89 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl;
90 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
91 G4cout << "*******************************************************************************" << G4endl;
92 G4cout << "*******************************************************************************" << G4endl;
93 G4cout << G4endl;
[819]94}
95
[961]96//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
[819]97
98G4CrossSectionIonisationBorn::~G4CrossSectionIonisationBorn()
99{
100 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
101 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
[961]102 {
103 G4DNACrossSectionDataSet* table = pos->second;
104 delete table;
105 }
[819]106}
107
[961]108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
[819]109
110G4double G4CrossSectionIonisationBorn::CrossSection(const G4Track& track )
111{
112 const G4DynamicParticle* particle = track.GetDynamicParticle();
113 G4double k = particle->GetKineticEnergy();
114
115 G4double sigma = 0.;
116
117 G4double lowLim = lowEnergyLimitDefault;
118 G4double highLim = highEnergyLimitDefault;
119
120 const G4String& particleName = particle->GetDefinition()->GetParticleName();
121
[961]122 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
123 pos1 = lowEnergyLimit.find(particleName);
[819]124
[961]125 if (pos1 != lowEnergyLimit.end())
126 {
127 lowLim = pos1->second;
128 }
[819]129
[961]130 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
131 pos2 = highEnergyLimit.find(particleName);
[819]132
[961]133 if (pos2 != highEnergyLimit.end())
134 {
135 highLim = pos2->second;
136 }
[819]137
[961]138 if (k > lowLim && k < highLim)
139 {
140 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
141 pos = tableData.find(particleName);
142
143 if (pos != tableData.end())
144 {
145 G4DNACrossSectionDataSet* table = pos->second;
146 if (table != 0)
[819]147 {
[961]148 sigma = table->FindValue(k);
[819]149 }
[961]150 }
151 else
152 {
153 G4Exception("G4CrossSectionIonisationBorn: attempting to calculate cross section for wrong particle");
154 }
155 }
[819]156
[961]157 return sigma;
[819]158}
159
Note: See TracBrowser for help on using the repository browser.