- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheHeitlerModel.cc,v 1.1 3 2009/04/09 18:41:18vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4BetheHeitlerModel.cc,v 1.15 2010/10/25 19:02:32 vnivanch Exp $ 27 // GEANT4 tag $Name: emstand-V09-03-24 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 43 43 // 16-11-05 replace shootBit() by G4UniformRand() mma 44 44 // 04-12-05 SetProposedKineticEnergy(0.) for the killed photon (mma) 45 // 20-02- 20SelectRandomElement is called for any initial gamma energy45 // 20-02-07 SelectRandomElement is called for any initial gamma energy 46 46 // in order to have selected element for polarized model (VI) 47 // 25-10-10 Removed unused table, added element selector (VI) 47 48 // 48 49 // Class Description: … … 58 59 #include "G4Gamma.hh" 59 60 #include "Randomize.hh" 60 #include "G4DataVector.hh"61 #include "G4PhysicsLogVector.hh"62 61 #include "G4ParticleChangeForGamma.hh" 63 #include "G4LossTableManager.hh"64 62 65 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 69 67 G4BetheHeitlerModel::G4BetheHeitlerModel(const G4ParticleDefinition*, 70 68 const G4String& nam) 71 : G4VEmModel(nam), 72 theCrossSectionTable(0), 73 nbins(10) 69 : G4VEmModel(nam) 74 70 { 75 71 fParticleChange = 0; … … 82 78 83 79 G4BetheHeitlerModel::~G4BetheHeitlerModel() 84 { 85 if(theCrossSectionTable) { 86 theCrossSectionTable->clearAndDestroy(); 87 delete theCrossSectionTable; 88 } 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 93 void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition*, 94 const G4DataVector&) 95 { 96 if(!fParticleChange) fParticleChange = GetParticleChangeForGamma(); 97 98 if(theCrossSectionTable) { 99 theCrossSectionTable->clearAndDestroy(); 100 delete theCrossSectionTable; 101 } 102 103 const G4ElementTable* theElementTable = G4Element::GetElementTable(); 104 size_t nvect = G4Element::GetNumberOfElements(); 105 theCrossSectionTable = new G4PhysicsTable(nvect); 106 G4PhysicsLogVector* ptrVector; 107 G4double emin = LowEnergyLimit(); 108 G4double emax = HighEnergyLimit(); 109 G4int n = nbins*G4int(log10(emax/emin)); 110 G4bool spline = G4LossTableManager::Instance()->SplineFlag(); 111 G4double e, value; 112 113 for(size_t j=0; j<nvect ; j++) { 114 115 ptrVector = new G4PhysicsLogVector(emin, emax, n); 116 ptrVector->SetSpline(spline); 117 G4double Z = (*theElementTable)[j]->GetZ(); 118 G4int iz = G4int(Z); 119 indexZ[iz] = j; 120 121 for(G4int i=0; i<nbins; i++) { 122 e = ptrVector->GetLowEdgeEnergy( i ) ; 123 value = ComputeCrossSectionPerAtom(theGamma, e, Z); 124 ptrVector->PutValue( i, value ); 125 } 126 127 theCrossSectionTable->insert(ptrVector); 128 } 129 } 130 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 132 133 G4double G4BetheHeitlerModel::ComputeCrossSectionPerAtom( 134 const G4ParticleDefinition*, 135 G4double GammaEnergy, G4double Z, 136 G4double, G4double, G4double) 80 {} 81 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 83 84 void G4BetheHeitlerModel::Initialise(const G4ParticleDefinition* p, 85 const G4DataVector& cuts) 86 { 87 if(!fParticleChange) { fParticleChange = GetParticleChangeForGamma(); } 88 InitialiseElementSelectors(p, cuts); 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 93 G4double 94 G4BetheHeitlerModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 95 G4double GammaEnergy, G4double Z, 96 G4double, G4double, G4double) 137 97 // Calculates the microscopic cross section in GEANT4 internal units. 138 98 // A parametrized formula from L. Urban is used to estimate … … 144 104 static const G4double GammaEnergyLimit = 1.5*MeV; 145 105 G4double CrossSection = 0.0 ; 146 if ( Z < 1. ) return CrossSection; 147 if ( GammaEnergy <= 2.0*electron_mass_c2 ) return CrossSection; 106 if ( Z < 0.9 || GammaEnergy <= 2.0*electron_mass_c2 ) { return CrossSection; } 148 107 149 108 static const G4double … … 160 119 161 120 G4double GammaEnergySave = GammaEnergy; 162 if (GammaEnergy < GammaEnergyLimit) GammaEnergy = GammaEnergyLimit ;121 if (GammaEnergy < GammaEnergyLimit) { GammaEnergy = GammaEnergyLimit; } 163 122 164 123 G4double X=log(GammaEnergy/electron_mass_c2), X2=X*X, X3=X2*X, X4=X3*X, X5=X4*X; … … 177 136 } 178 137 179 if (CrossSection < 0.) CrossSection = 0.;138 if (CrossSection < 0.) { CrossSection = 0.; } 180 139 return CrossSection; 181 140 } … … 208 167 G4double epsil ; 209 168 G4double epsil0 = electron_mass_c2/GammaEnergy ; 210 if(epsil0 > 1.0) return;169 if(epsil0 > 1.0) { return; } 211 170 212 171 // do it fast if GammaEnergy < 2. MeV … … 225 184 // Extract Coulomb factor for this Element 226 185 G4double FZ = 8.*(anElement->GetIonisation()->GetlogZ3()); 227 if (GammaEnergy > 50.*MeV) FZ += 8.*(anElement->GetfCoulomb());186 if (GammaEnergy > 50.*MeV) { FZ += 8.*(anElement->GetfCoulomb()); } 228 187 229 188 // limits of the screening variable … … 334 293 335 294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 336 337
Note: See TracChangeset
for help on using the changeset viewer.