ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RToEConvForGamma.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4RToEConvForGamma.cc
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 //
28 //
29 // --------------------------------------------------------------
30 // GEANT 4 class implementation file/ History:
31 // 5 Oct. 2002, H.Kuirashige : Structure created based on object model
32 // --------------------------------------------------------------
33 
34 #include "G4RToEConvForGamma.hh"
35 #include "G4ParticleDefinition.hh"
36 #include "G4ParticleTable.hh"
37 #include "G4Material.hh"
38 #include "G4PhysicsLogVector.hh"
39 
40 #include "G4ios.hh"
41 #include "G4SystemOfUnits.hh"
42 
45  Z(-1),
46  s200keV(0.), s1keV(0.),
47  tmin(0.), tlow(0.),
48  smin(0.), slow(0.),
49  cmin(0.), clow(0.), chigh(0.)
50 {
52  if (theParticle ==0) {
53 #ifdef G4VERBOSE
54  if (GetVerboseLevel()>0) {
55  G4cout << " G4RToEConvForGamma::G4RToEConvForGamma() ";
56  G4cout << " Gamma is not defined !!" << G4endl;
57  }
58 #endif
59  }
60 }
61 
63 {
64 }
65 
66 
67 // ***********************************************************************
68 // ******************* BuildAbsorptionLengthVector ***********************
69 // ***********************************************************************
71  const G4Material* aMaterial,
72  G4RangeVector* absorptionLengthVector )
73 {
74  // fill the absorption length vector for this material
75  // absorption length is defined here as
76  //
77  // absorption length = 5./ macroscopic absorption cross section
78  //
79  const G4CrossSectionTable* aCrossSectionTable = (G4CrossSectionTable*)(theLossTable);
80  const G4ElementVector* elementVector = aMaterial->GetElementVector();
81  const G4double* atomicNumDensityVector = aMaterial->GetAtomicNumDensityVector();
82 
83  // fill absorption length vector
84  G4int NumEl = aMaterial->GetNumberOfElements();
85  G4double absorptionLengthMax = 0.0;
86  for (size_t ibin=0; ibin<size_t(TotBin); ibin++) {
87  G4double SIGMA = 0. ;
88  for (size_t iel=0; iel<size_t(NumEl); iel++) {
89  G4int IndEl = (*elementVector)[iel]->GetIndex();
90  SIGMA += atomicNumDensityVector[iel]*
91  (*((*aCrossSectionTable)[IndEl]))[ibin];
92  }
93  // absorption length=5./SIGMA
94  absorptionLengthVector->PutValue(ibin, 5./SIGMA);
95  if (absorptionLengthMax < 5./SIGMA ) absorptionLengthMax = 5./SIGMA;
96  }
97 }
98 
99 
100 
101 // ***********************************************************************
102 // ********************** ComputeCrossSection ****************************
103 // ***********************************************************************
105  G4double KineticEnergy)
106 {
107  // Compute the "absorption" cross section of the photon "absorption"
108  // cross section means here the sum of the cross sections of the
109  // pair production, Compton scattering and photoelectric processes
110  const G4double t1keV = 1.*keV;
111  const G4double t200keV = 200.*keV;
112  const G4double t100MeV = 100.*MeV;
113 
114  // compute Z dependent quantities in the case of a new AtomicNumber
115  if(std::abs(AtomicNumber-Z)>0.1) {
116  Z = AtomicNumber;
117  G4double Zsquare = Z*Z;
118  G4double Zlog = std::log(Z);
119  G4double Zlogsquare = Zlog*Zlog;
120 
121  s200keV = (0.2651-0.1501*Zlog+0.02283*Zlogsquare)*Zsquare;
122  tmin = (0.552+218.5/Z+557.17/Zsquare)*MeV;
123  smin = (0.01239+0.005585*Zlog-0.000923*Zlogsquare)*std::exp(1.5*Zlog);
124  cmin=std::log(s200keV/smin)/(std::log(tmin/t200keV)*std::log(tmin/t200keV));
125  tlow = 0.2*std::exp(-7.355/std::sqrt(Z))*MeV;
126  slow = s200keV*std::exp(0.042*Z*std::log(t200keV/tlow)*std::log(t200keV/tlow));
127  s1keV = 300.*Zsquare;
128  clow =std::log(s1keV/slow)/std::log(tlow/t1keV);
129 
130  chigh=(7.55e-5-0.0542e-5*Z)*Zsquare*Z/std::log(t100MeV/tmin);
131  }
132 
133  // calculate the cross section (using an approximate empirical formula)
134  G4double xs;
135  if ( KineticEnergy<tlow ) {
136  if(KineticEnergy<t1keV) xs = slow*std::exp(clow*std::log(tlow/t1keV));
137  else xs = slow*std::exp(clow*std::log(tlow/KineticEnergy));
138 
139  } else if ( KineticEnergy<t200keV ) {
140  xs = s200keV
141  * std::exp(0.042*Z*std::log(t200keV/KineticEnergy)*std::log(t200keV/KineticEnergy));
142 
143  } else if( KineticEnergy<tmin ){
144  xs = smin
145  * std::exp(cmin*std::log(tmin/KineticEnergy)*std::log(tmin/KineticEnergy));
146 
147  } else {
148  xs = smin + chigh*std::log(KineticEnergy/tmin);
149 
150  }
151  return xs * barn;
152 }
153