source: trunk/source/processes/cuts/src/G4RToEConvForGamma.cc@ 1215

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

update CVS release candidate geant4.9.3.01

File size: 6.4 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//
27// $Id: G4RToEConvForGamma.cc,v 1.6 2009/09/12 12:09:42 kurasige Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31// --------------------------------------------------------------
32// GEANT 4 class implementation file/ History:
33// 5 Oct. 2002, H.Kuirashige : Structure created based on object model
34// --------------------------------------------------------------
35
36#include "G4RToEConvForGamma.hh"
37#include "G4ParticleDefinition.hh"
38#include "G4ParticleTable.hh"
39#include "G4Material.hh"
40#include "G4PhysicsLogVector.hh"
41
42#include "G4ios.hh"
43
44G4RToEConvForGamma::G4RToEConvForGamma() : G4VRangeToEnergyConverter()
45{
46 theParticle = G4ParticleTable::GetParticleTable()->FindParticle("gamma");
47 if (theParticle ==0) {
48#ifdef G4VERBOSE
49 if (GetVerboseLevel()>0) {
50 G4cout << " G4RToEConvForGamma::G4RToEConvForGamma() ";
51 G4cout << " Gamma is not defined !!" << G4endl;
52 }
53#endif
54 }
55}
56
57G4RToEConvForGamma::~G4RToEConvForGamma()
58{
59}
60
61
62// ***********************************************************************
63// ******************* BuildAbsorptionLengthVector ***********************
64// ***********************************************************************
65void G4RToEConvForGamma::BuildAbsorptionLengthVector(
66 const G4Material* aMaterial,
67 G4RangeVector* absorptionLengthVector )
68{
69 // fill the absorption length vector for this material
70 // absorption length is defined here as
71 //
72 // absorption length = 5./ macroscopic absorption cross section
73 //
74 const G4CrossSectionTable* aCrossSectionTable = (G4CrossSectionTable*)(theLossTable);
75 const G4ElementVector* elementVector = aMaterial->GetElementVector();
76 const G4double* atomicNumDensityVector = aMaterial->GetAtomicNumDensityVector();
77
78 // fill absorption length vector
79 G4int NumEl = aMaterial->GetNumberOfElements();
80 G4double absorptionLengthMax = 0.0;
81 G4double previous = 0.;
82 for (size_t ibin=0; ibin<size_t(TotBin); ibin++) {
83 G4double SIGMA = 0. ;
84 for (size_t iel=0; iel<size_t(NumEl); iel++) {
85 G4int IndEl = (*elementVector)[iel]->GetIndex();
86 SIGMA += atomicNumDensityVector[iel]*
87 (*((*aCrossSectionTable)[IndEl]))[ibin];
88 }
89 // absorption length=5./SIGMA
90 absorptionLengthVector->PutValue(ibin, 5./SIGMA);
91 if (absorptionLengthMax < 5./SIGMA ) absorptionLengthMax = 5./SIGMA;
92
93 //if (previous > 5./SIGMA) {
94 // G4cout << "G4RToEConvForGamma::BuildAbsorptionLengthVector"
95 // << ": WARNING absorptionVector "
96 // << ibin << ":" << 5./SIGMA << " <-- "
97 // << ibin -1 << ":" << previous <<G4endl;
98 //}
99
100 previous = 5./SIGMA;
101 }
102}
103
104
105
106// ***********************************************************************
107// ********************** ComputeCrossSection ****************************
108// ***********************************************************************
109G4double G4RToEConvForGamma::ComputeCrossSection(G4double AtomicNumber,
110 G4double KineticEnergy) const
111{
112 // Compute the "absorption" cross section of the photon "absorption"
113 // cross section means here the sum of the cross sections of the
114 // pair production, Compton scattering and photoelectric processes
115 static G4double Z;
116 const G4double t1keV = 1.*keV;
117 const G4double t200keV = 200.*keV;
118 const G4double t100MeV = 100.*MeV;
119
120 static G4double s200keV, s1keV;
121 static G4double tmin, tlow;
122 static G4double smin, slow;
123 static G4double cmin, clow, chigh;
124 // compute Z dependent quantities in the case of a new AtomicNumber
125 if(std::abs(AtomicNumber-Z)>0.1) {
126 Z = AtomicNumber;
127 G4double Zsquare = Z*Z;
128 G4double Zlog = std::log(Z);
129 G4double Zlogsquare = Zlog*Zlog;
130
131 s200keV = (0.2651-0.1501*Zlog+0.02283*Zlogsquare)*Zsquare;
132 tmin = (0.552+218.5/Z+557.17/Zsquare)*MeV;
133 smin = (0.01239+0.005585*Zlog-0.000923*Zlogsquare)*std::exp(1.5*Zlog);
134 cmin=std::log(s200keV/smin)/(std::log(tmin/t200keV)*std::log(tmin/t200keV));
135 tlow = 0.2*std::exp(-7.355/std::sqrt(Z))*MeV;
136 slow = s200keV*std::exp(0.042*Z*std::log(t200keV/tlow)*std::log(t200keV/tlow));
137 s1keV = 300.*Zsquare;
138 clow =std::log(s1keV/slow)/std::log(tlow/t1keV);
139
140 chigh=(7.55e-5-0.0542e-5*Z)*Zsquare*Z/std::log(t100MeV/tmin);
141 }
142
143 // calculate the cross section (using an approximate empirical formula)
144 G4double s;
145 if ( KineticEnergy<tlow ) {
146 if(KineticEnergy<t1keV) s = slow*std::exp(clow*std::log(tlow/t1keV));
147 else s = slow*std::exp(clow*std::log(tlow/KineticEnergy));
148
149 } else if ( KineticEnergy<t200keV ) {
150 s = s200keV
151 * std::exp(0.042*Z*std::log(t200keV/KineticEnergy)*std::log(t200keV/KineticEnergy));
152
153 } else if( KineticEnergy<tmin ){
154 s = smin
155 * std::exp(cmin*std::log(tmin/KineticEnergy)*std::log(tmin/KineticEnergy));
156
157 } else {
158 s = smin + chigh*std::log(KineticEnergy/tmin);
159
160 }
161 return s * barn;
162}
163
Note: See TracBrowser for help on using the repository browser.