Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheHeitlerModel.cc,v 1.13 2009/04/09 18:41:18 vnivanch 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 $
    2828//
    2929// -------------------------------------------------------------------
     
    4343// 16-11-05 replace shootBit() by G4UniformRand()  mma
    4444// 04-12-05 SetProposedKineticEnergy(0.) for the killed photon (mma)
    45 // 20-02-20 SelectRandomElement is called for any initial gamma energy
     45// 20-02-07 SelectRandomElement is called for any initial gamma energy
    4646//          in order to have selected element for polarized model (VI)
     47// 25-10-10 Removed unused table, added element selector (VI)
    4748//
    4849// Class Description:
     
    5859#include "G4Gamma.hh"
    5960#include "Randomize.hh"
    60 #include "G4DataVector.hh"
    61 #include "G4PhysicsLogVector.hh"
    6261#include "G4ParticleChangeForGamma.hh"
    63 #include "G4LossTableManager.hh"
    6462
    6563//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    6967G4BetheHeitlerModel::G4BetheHeitlerModel(const G4ParticleDefinition*,
    7068                                         const G4String& nam)
    71   : G4VEmModel(nam),
    72     theCrossSectionTable(0),
    73     nbins(10)
     69  : G4VEmModel(nam)
    7470{
    7571  fParticleChange = 0;
     
    8278
    8379G4BetheHeitlerModel::~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
     84void 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
     93G4double
     94G4BetheHeitlerModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     95                                                G4double GammaEnergy, G4double Z,
     96                                                G4double, G4double, G4double)
    13797// Calculates the microscopic cross section in GEANT4 internal units.
    13898// A parametrized formula from L. Urban is used to estimate
     
    144104  static const G4double GammaEnergyLimit = 1.5*MeV;
    145105  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; }
    148107
    149108  static const G4double
     
    160119
    161120  G4double GammaEnergySave = GammaEnergy;
    162   if (GammaEnergy < GammaEnergyLimit) GammaEnergy = GammaEnergyLimit ;
     121  if (GammaEnergy < GammaEnergyLimit) { GammaEnergy = GammaEnergyLimit; }
    163122
    164123  G4double X=log(GammaEnergy/electron_mass_c2), X2=X*X, X3=X2*X, X4=X3*X, X5=X4*X;
     
    177136  }
    178137
    179   if (CrossSection < 0.) CrossSection = 0.;
     138  if (CrossSection < 0.) { CrossSection = 0.; }
    180139  return CrossSection;
    181140}
     
    208167  G4double epsil ;
    209168  G4double epsil0 = electron_mass_c2/GammaEnergy ;
    210   if(epsil0 > 1.0) return;
     169  if(epsil0 > 1.0) { return; }
    211170
    212171  // do it fast if GammaEnergy < 2. MeV
     
    225184    // Extract Coulomb factor for this Element
    226185    G4double FZ = 8.*(anElement->GetIonisation()->GetlogZ3());
    227     if (GammaEnergy > 50.*MeV) FZ += 8.*(anElement->GetfCoulomb());
     186    if (GammaEnergy > 50.*MeV) { FZ += 8.*(anElement->GetfCoulomb()); }
    228187
    229188    // limits of the screening variable
     
    334293
    335294//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    336 
    337 
Note: See TracChangeset for help on using the changeset viewer.