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/hadronic/cross_sections/src/G4ElectroNuclearCrossSection.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ElectroNuclearCrossSection.cc,v 1.29 2008/10/24 19:15:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ElectroNuclearCrossSection.cc,v 1.30 2010/10/14 05:25:22 dennis Exp $
     28// GEANT4 tag $Name: hadr-cross-V09-03-12 $
    2929//
    3030//
     
    3333// The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
    3434//
    35 //===============================================================================================
     35//============================================================================
    3636
    3737///#define debug
     
    4343
    4444#include "G4ElectroNuclearCrossSection.hh"
     45#include "G4HadTmpUtil.hh"
    4546
    4647// Initialization of statics
    47 G4double  G4ElectroNuclearCrossSection::lastE=0.;  // Last used in the cross section TheEnergy
    48 G4int     G4ElectroNuclearCrossSection::lastF=0;   // Last used in the cross section TheFirstBin
    49 G4double  G4ElectroNuclearCrossSection::lastG=0.;  // Last used in the cross section TheGamma
     48// Last used in the cross section TheEnergy
     49G4double G4ElectroNuclearCrossSection::lastE=0.;
     50
     51// Last used in the cross section TheFirstBin
     52G4int G4ElectroNuclearCrossSection::lastF=0;
     53
     54// Last used in the cross section TheGamma
     55G4double G4ElectroNuclearCrossSection::lastG=0.;
     56
    5057G4double  G4ElectroNuclearCrossSection::lastH=0.;  // Last value of the High Energy A-dependence
    5158G4double* G4ElectroNuclearCrossSection::lastJ1=0;  // Pointer to the last array of the J1 function
     
    5865G4double  G4ElectroNuclearCrossSection::lastSig=0.;// Last value of the Cross Section
    5966
    60 std::vector<G4double*> G4ElectroNuclearCrossSection::J1;     // Vector of pointers to the J1 tabulated functions
    61 std::vector<G4double*> G4ElectroNuclearCrossSection::J2;     // Vector of pointers to the J2 tabulated functions
    62 std::vector<G4double*> G4ElectroNuclearCrossSection::J3;     // Vector of pointers to the J3 tabulated functions
     67// Vector of pointers to the J1 tabulated functions
     68std::vector<G4double*> G4ElectroNuclearCrossSection::J1;
     69
     70// Vector of pointers to the J2 tabulated functions
     71std::vector<G4double*> G4ElectroNuclearCrossSection::J2;
     72
     73// Vector of pointers to the J3 tabulated functions
     74std::vector<G4double*> G4ElectroNuclearCrossSection::J3;
     75
    6376
    6477G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection()
    65 {
    66 }
     78{}
     79
    6780
    6881G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection()
     
    95108    G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
    96109    G4double* abundVector = anEle->GetRelativeAbundanceVector();
    97     G4double ZZ;
    98     G4double AA;
     110    G4int ZZ;
     111    G4int AA;
    99112     
    100113    for (G4int i = 0; i < nIso; i++) {
    101       ZZ = G4double( (*isoVector)[i]->GetZ() );
    102       AA = G4double( (*isoVector)[i]->GetN() );
    103       sig = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
     114      ZZ = (*isoVector)[i]->GetZ();
     115      AA = (*isoVector)[i]->GetN();
     116      sig = GetZandACrossSection(aPart, ZZ, AA, temperature);
    104117      xsection += sig*abundVector[i];
    105118    }
     
    107120  } else {
    108121    xsection =
    109       GetIsoZACrossSection(aPart, anEle->GetZ(), anEle->GetN(),
     122      GetZandACrossSection(aPart,
     123                           G4lrint(anEle->GetZ()),
     124                           G4lrint(anEle->GetN()),
    110125                           temperature);
    111126  }
     
    116131
    117132G4double
    118 G4ElectroNuclearCrossSection::GetIsoZACrossSection(const G4DynamicParticle* aPart,
    119                                               G4double ZZ, G4double AA,
    120                                               G4double /*temperature*/)
     133G4ElectroNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* aPart,
     134                                                   G4int ZZ, G4int AA,
     135                                                   G4double /*temperature*/)
    121136{
    122137  static const G4int nE=336; // !!  If you change this, change it in GetFunctions() (*.hh) !!
    123138  static const G4int mL=nE-1;
    124   static const G4double EMi=2.0612;          // Minimum tabulated Energy of the Electron
    125   static const G4double EMa=50000.;          // Maximum tabulated Energy of the Electron
    126   static const G4double lEMi=std::log(EMi);       // Minimum tabulated logarithmic Energy of the Electron
    127   static const G4double lEMa=std::log(EMa);       // Maximum tabulated logarithmic Energy of the Electron
     139  static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron
     140  static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron
     141  static const G4double lEMi=std::log(EMi);  // Minimum tabulated logarithmic Energy of the Electron
     142  static const G4double lEMa=std::log(EMa);  // Maximum tabulated logarithmic Energy of the Electron
    128143  static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy
    129144  static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.)
     
    137152  static std::vector <G4double> colH;    // Vector of HighEnergyCoefficients (functional calculations)
    138153  // *** End of Static Definitions (Associative Memory) ***
     154
    139155  const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron
    140   const G4int targetAtomicNumber = static_cast<int>(AA+.499); //@@ Nat mixture (?!)
    141   const G4int targZ = static_cast<int>(ZZ+.001);
     156  const G4int targetAtomicNumber = AA;
     157  const G4int targZ = ZZ;
    142158  const G4int targN = targetAtomicNumber-targZ; // @@ Get isotops (can change initial A)
    143159  if (Energy<=EMi) return 0.;              // Energy is below the minimum energy in the table
     160
    144161  G4int PDG=aPart->GetDefinition()->GetPDGEncoding();
    145   ifPDG == 11 || PDG == -11)            // @@ Now only for electrons, but can be fo muons
     162  if (PDG == 11 || PDG == -11)            // @@ Now only for electrons, but can be fo muons
    146163  {
    147     G4double A=targN+targZ;                // New A (can differ from G4double targetAtomicNumber)
    148     if(targN!=lastN || targZ!=lastZ)       // This nucleus was not the last used isotop
     164    G4double A = targN + targZ;           // New A (can differ from G4double targetAtomicNumber)
     165    if(targN!=lastN || targZ!=lastZ)      // This nucleus was not the last used isotop
    149166        {
    150167      lastE    = 0.;                       // New history in the electron Energy
     
    185202          } // End of creation of the new set of parameters
    186203    } // End of parameters udate
     204
    187205    else if(std::abs((lastE-Energy)/Energy)<.001) return lastSig*millibarn; // Don't calc. same CS twice
    188206    // ============================== NOW Calculate the Cross Section ==========================
     
    268286}
    269287
    270 // Correction function for Be,C @@ Move to header // @@@ !!! NOT used !!!
    271 //G4double G4ElectroNuclearCrossSection::LinearFit(G4double X, G4int N, const G4double* XN,
    272 //                                                 const G4double* YN)
    273 //{
    274 //  G4double Xj=XN[0];
    275 //  G4double Xh=XN[N-1];
    276 //  if(X<=Xj) return YN[0]; //-------+ !!! If you correct this, correct upper copy too!!
    277 //  else if(X>=Xh) return YN[N-1];//-|
    278 //  G4double Xp=0.; //               |
    279 //  G4int j=0;   //                  |
    280 //  while (X>Xj && j<N)//<-----------+
    281 //  {
    282 //    j++;
    283 //    Xp=Xj;
    284 //    Xj=XN[j];
    285 //  }
    286 //  return YN[j]-(Xj-X)*(YN[j]-YN[j-1])/(Xj-Xp);
    287 //}
    288288
    289289// Calculate the functions for the std::log(A)
Note: See TracChangeset for help on using the changeset viewer.