source: trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionElasticChampion.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: 4.6 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: G4CrossSectionElasticChampion.cc,v 1.7 2009/06/11 15:47:08 mantero Exp $
27// GEANT4 tag $Name: geant4-09-03-cand-01 $
28// -------------------------------------------------------------------
29
30#include "G4CrossSectionElasticChampion.hh"
31
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33
34G4CrossSectionElasticChampion::G4CrossSectionElasticChampion()
35{
36 lowEnergyLimit = 0.*eV;
37 highEnergyLimit = 10. * keV;
38
39 G4double scaleFactor = 1e-16*cm*cm;
40
41 G4String fileElectron("dna/sigma_elastic_e_champion");
42
43 G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition();
44 G4String electron;
45
46 if (electronDef != 0)
47 {
48 electron = electronDef->GetParticleName();
49 tableFile[electron] = fileElectron;
50
51 G4DNACrossSectionDataSet* tableE = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
52 tableE->LoadData(fileElectron);
53 tableData[electron] = tableE;
54 }
55 else
56 {
57 G4Exception("G4CrossSectionElasticChampion constructor: electron is not defined");
58 }
59
60 G4cout << G4endl;
61 G4cout << "*******************************************************************************" << G4endl;
62 G4cout << "*******************************************************************************" << G4endl;
63 G4cout << " The class G4CrossSectionElasticChampion is NOT SUPPORTED ANYMORE. " << G4endl;
64 G4cout << " It will be REMOVED with the next major release of Geant4. " << G4endl;
65 G4cout << " Please consult: https://twiki.cern.ch/twiki/bin/view/Geant4/LoweProcesses" << G4endl;
66 G4cout << "*******************************************************************************" << G4endl;
67 G4cout << "*******************************************************************************" << G4endl;
68 G4cout << G4endl;
69}
70
71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
72
73G4CrossSectionElasticChampion::~G4CrossSectionElasticChampion()
74{
75 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
76 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
77 {
78 G4DNACrossSectionDataSet* table = pos->second;
79 delete table;
80 }
81}
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84
85G4double G4CrossSectionElasticChampion::CrossSection(const G4Track& track )
86{
87 const G4DynamicParticle* particle = track.GetDynamicParticle();
88 G4double k = particle->GetKineticEnergy();
89
90 G4double sigma = 0.;
91
92 const G4String& particleName = particle->GetDefinition()->GetParticleName();
93
94 if (k >= lowEnergyLimit && k < highEnergyLimit)
95 {
96 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
97 pos = tableData.find(particleName);
98
99 if (pos != tableData.end())
100 {
101 G4DNACrossSectionDataSet* table = pos->second;
102 if (table != 0)
103 {
104 sigma = table->FindValue(k);
105 }
106 }
107 else
108 {
109 G4Exception("G4CrossSectionElasticChampion::CrossSection: attempting to calculate cross section for wrong particle");
110 }
111 }
112 return sigma;
113}
Note: See TracBrowser for help on using the repository browser.