Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4CrossSectionHandler.cc,v 1.18 2006/06/29 19:38:48 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4CrossSectionHandler.cc,v 1.21 2009/09/27 10:47:42 sincerti Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
//
@@ -35,6 +35,16 @@
// 19 Jul 2002 VI Create composite data set for material
// 24 Apr 2003 VI Cut per region mfpt
//
// 15 Jul 2009 Nicolas A. Karakatsanis
//
// - BuildCrossSectionForMaterials method was revised in order to calculate the
// logarithmic values of the loaded data.
// It retrieves the data values from the G4EMLOW data files but, then, calculates the
// respective log values and loads them to seperate data structures.
// The EM data sets, initialized this way, contain both non-log and log values.
// These initialized data sets can enhance the computing performance of data interpolation
// operations
//
// -------------------------------------------------------------------
#include "G4CrossSectionHandler.hh"
@@ -65,6 +75,9 @@ G4CrossSectionHandler::BuildCrossSectionsForMaterials(const G4DataVector& energy
G4DataVector* energies;
G4DataVector* data;
G4DataVector* log_energies;
G4DataVector* log_data;
std::vector<G4VEMDataSet*>* matCrossSections = new std::vector<G4VEMDataSet*>;
const G4ProductionCutsTable* theCoupleTable=
@@ -94,17 +107,28 @@ G4CrossSectionHandler::BuildCrossSectionsForMaterials(const G4DataVector& energy
energies = new G4DataVector;
data = new G4DataVector;
log_energies = new G4DataVector;
log_data = new G4DataVector;
for (size_t bin=0; bin<nOfBins; bin++)
{
G4double e = energyVector[bin];
energies->push_back(e);
if (e==0.) e=1e-300;
log_energies->push_back(std::log10(e));
G4double cross = density*FindValue(Z,e);
data->push_back(cross);
if (cross==0.) cross=1e-300;
log_data->push_back(std::log10(cross));
}
G4VDataSetAlgorithm* algo1 = interpolationAlgo->Clone();
G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,algo1,1.,1.);
// G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,algo1,1.,1.);
G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,log_energies,log_data,algo1,1.,1.);
setForMat->AddComponent(elSet);
}