#include <G4RDVCrossSectionHandler.hh>
 | 
|   | G4RDVCrossSectionHandler () | 
|   | 
|   | G4RDVCrossSectionHandler (G4RDVDataSetAlgorithm *interpolation, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99) | 
|   | 
| virtual  | ~G4RDVCrossSectionHandler () | 
|   | 
| void  | Initialise (G4RDVDataSetAlgorithm *interpolation=0, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99) | 
|   | 
| G4int  | SelectRandomAtom (const G4MaterialCutsCouple *couple, G4double e) const | 
|   | 
| const G4Element *  | SelectRandomElement (const G4MaterialCutsCouple *material, G4double e) const | 
|   | 
| G4int  | SelectRandomShell (G4int Z, G4double e) const | 
|   | 
| G4RDVEMDataSet *  | BuildMeanFreePathForMaterials (const G4DataVector *energyCuts=0) | 
|   | 
| G4double  | FindValue (G4int Z, G4double e) const | 
|   | 
| G4double  | FindValue (G4int Z, G4double e, G4int shellIndex) const | 
|   | 
| G4double  | ValueForMaterial (const G4Material *material, G4double e) const | 
|   | 
| void  | LoadData (const G4String &dataFile) | 
|   | 
| void  | LoadShellData (const G4String &dataFile) | 
|   | 
| void  | PrintData () const | 
|   | 
| void  | Clear () | 
|   | 
Definition at line 64 of file G4RDVCrossSectionHandler.hh.
 
◆ G4RDVCrossSectionHandler() [1/3]
      
        
          | G4RDVCrossSectionHandler::G4RDVCrossSectionHandler  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 59 of file G4RDVCrossSectionHandler.cc.
void Initialise(G4RDVDataSetAlgorithm *interpolation=0, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
 
std::vector< G4RDVEMDataSet * > * crossSections
 
G4RDVDataSetAlgorithm * interpolation
 
 
 
 
◆ G4RDVCrossSectionHandler() [2/3]
◆ ~G4RDVCrossSectionHandler()
  
  
      
        
          | G4RDVCrossSectionHandler::~G4RDVCrossSectionHandler  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
Definition at line 83 of file G4RDVCrossSectionHandler.cc.
   87   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::iterator 
pos;
   102       for (
size_t i=0; i<
n; i++)
   104       delete (*crossSections)[i];
 std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
std::vector< G4RDVEMDataSet * > * crossSections
 
static const G4double pos
 
G4RDVDataSetAlgorithm * interpolation
 
 
 
 
◆ G4RDVCrossSectionHandler() [3/3]
◆ ActiveElements()
  
  
      
        
          | void G4RDVCrossSectionHandler::ActiveElements  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Definition at line 624 of file G4RDVCrossSectionHandler.cc.
  627   if (materialTable == 0)
   628     G4Exception(
"G4RDVCrossSectionHandler::ActiveElements",
   639       for (
G4int iEl=0; iEl<nElements; iEl++)
   641       G4Element* element = (*elementVector)[iEl];
 std::vector< G4Element * > G4ElementVector
 
static G4MaterialTable * GetMaterialTable()
 
std::vector< G4Material * > G4MaterialTable
 
static size_t GetNumberOfMaterials()
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
G4bool contains(const G4double &) const
 
size_t GetNumberOfElements() const
 
const G4ElementVector * GetElementVector() const
 
 
 
 
◆ BuildCrossSectionsForMaterials()
◆ BuildMeanFreePathForMaterials()
Definition at line 416 of file G4RDVCrossSectionHandler.cc.
  426       energyVector.push_back(std::pow(10., std::log10(
eMin)+i*dBin));
   434       std::vector<G4RDVEMDataSet*>::iterator 
mat;
   452     G4Exception(
"G4RDVCrossSectionHandler::BuildMeanFreePathForMaterials()",
   466   for (
size_t m=0; 
m<numOfCouples; 
m++)
   473       energies->push_back(energy);
   475       G4double materialCrossSection = 0.0;
   477           for(
G4int j=0; j<nElm; j++) {
   481       if (materialCrossSection > 0.)
   483           data->push_back(1./materialCrossSection);
 
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
 
virtual size_t NumberOfComponents(void) const =0
 
virtual G4RDVDataSetAlgorithm * CreateInterpolation()
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
static G4ProductionCutsTable * GetProductionCutsTable()
 
std::vector< G4RDVEMDataSet * > * crossSections
 
virtual std::vector< G4RDVEMDataSet * > * BuildCrossSectionsForMaterials(const G4DataVector &energyVector, const G4DataVector *energyCuts=0)=0
 
size_t GetTableSize() const
 
virtual void AddComponent(G4RDVEMDataSet *dataSet)=0
 
 
 
 
◆ Clear()
      
        
          | void G4RDVCrossSectionHandler::Clear  | 
          ( | 
           | ) | 
           | 
        
      
 
Definition at line 306 of file G4RDVCrossSectionHandler.cc.
  309   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::iterator 
pos;
   322       G4int i = (*pos).first;
 std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
static const G4double pos
 
 
 
 
◆ CreateInterpolation()
◆ FindValue() [1/2]
Definition at line 332 of file G4RDVCrossSectionHandler.cc.
  336   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator 
pos;
   349       G4cout << 
"WARNING: G4RDVCrossSectionHandler::FindValue did not find Z = " std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
G4GLOB_DLL std::ostream G4cout
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
static const G4double pos
 
 
 
 
◆ FindValue() [2/2]
Definition at line 355 of file G4RDVCrossSectionHandler.cc.
  360   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator 
pos;
   372       if(shellIndex < nComponents)    
   377           G4cout << 
"WARNING: G4RDVCrossSectionHandler::FindValue did not find"   378              << 
" shellIndex= " << shellIndex
   388       G4cout << 
"WARNING: G4RDVCrossSectionHandler::FindValue did not find Z = " std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
 
virtual size_t NumberOfComponents(void) const =0
 
G4GLOB_DLL std::ostream G4cout
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
static const G4double pos
 
 
 
 
◆ GetInterpolation()
◆ Initialise()
Definition at line 111 of file G4RDVCrossSectionHandler.cc.
  120       interpolation = algorithm;
   129   nBins = numberOfBins;
 
virtual G4RDVDataSetAlgorithm * CreateInterpolation()
 
G4RDVDataSetAlgorithm * interpolation
 
 
 
 
◆ LoadData()
      
        
          | void G4RDVCrossSectionHandler::LoadData  | 
          ( | 
          const G4String &  | 
          dataFile | ) | 
           | 
        
      
 
Definition at line 157 of file G4RDVCrossSectionHandler.cc.
  160   for (
size_t i=0; i<nZ; i++)
   166       char* path = getenv(
"G4LEDATA");
   169       G4String excep = 
"G4LEDATA environment variable not set!";
   170       G4Exception(
"G4RDVCrossSectionHandler::LoadData()",
   174       std::ostringstream ost;
   175       ost << path << 
'/' << fileName << Z << 
".dat";
   176       std::ifstream 
file(ost.str().c_str());
   177       std::filebuf* lsdp = 
file.rdbuf();
   179       if (! (lsdp->is_open()) )
   181       G4String excep = 
"Data file: " + ost.str() + 
" not found!";
   182       G4Exception(
"G4RDVCrossSectionHandler::LoadData()",
   198       if (a == -1 || a == -2)
   206           energies->push_back(e);
   209           else if (k%nColumns == 0)
   212           data->push_back(value);
 virtual G4RDVDataSetAlgorithm * Clone() const =0
 
std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
G4RDVDataSetAlgorithm * interpolation
 
 
 
 
◆ LoadShellData()
      
        
          | void G4RDVCrossSectionHandler::LoadShellData  | 
          ( | 
          const G4String &  | 
          dataFile | ) | 
           | 
        
      
 
Definition at line 225 of file G4RDVCrossSectionHandler.cc.
  228   for (
size_t i=0; i<nZ; i++)
   240       char* path = getenv(
"G4LEDATA");
   243       G4String excep = 
"G4LEDATA environment variable not set!";
   244       G4Exception(
"G4RDVCrossSectionHandler::LoadShellData()",
   248       std::ostringstream ost;
   250       ost << path << 
'/' << fileName << Z << 
".dat";
   252       std::ifstream 
file(ost.str().c_str());
   253       std::filebuf* lsdp = 
file.rdbuf();
   255       if (! (lsdp->is_open()) )
   257       G4String excep = 
"Data file: " + ost.str() + 
" not found!";
   258       G4Exception(
"G4RDVCrossSectionHandler::LoadShellData()",
   274       if (a == -1 || a == -2)
   282           energies->push_back(e);
   285           else if (k%nColumns == 0)
   288           data->push_back(value);
 
virtual G4RDVDataSetAlgorithm * Clone() const =0
 
std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
 
G4RDVDataSetAlgorithm * interpolation
 
virtual G4bool LoadData(const G4String &fileName)=0
 
 
 
 
◆ NumberOfComponents()
  
  
      
        
          | G4int G4RDVCrossSectionHandler::NumberOfComponents  | 
          ( | 
          G4int  | 
          Z | ) | 
           const | 
         
       
   | 
  
protected   | 
  
 
Definition at line 657 of file G4RDVCrossSectionHandler.cc.
  661   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator 
pos;
   670       G4cout << 
"WARNING: G4RDVCrossSectionHandler::NumberOfComponents did not " std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
virtual size_t NumberOfComponents(void) const =0
 
G4GLOB_DLL std::ostream G4cout
 
static const G4double pos
 
 
 
 
◆ operator=()
◆ PrintData()
      
        
          | void G4RDVCrossSectionHandler::PrintData  | 
          ( | 
          void  | 
           | ) | 
           const | 
        
      
 
Definition at line 136 of file G4RDVCrossSectionHandler.cc.
  138   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator 
pos;
   149       G4cout << 
"---- Data set for Z = "   153       G4cout << 
"--------------------------------------------------" << 
G4endl;
 std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
G4GLOB_DLL std::ostream G4cout
 
virtual void PrintData(void) const =0
 
static const G4double pos
 
 
 
 
◆ SelectRandomAtom()
Definition at line 498 of file G4RDVCrossSectionHandler.cc.
  517   size_t materialIndex = couple->
GetIndex();
   520   G4double materialCrossSection0 = 0.0;
   523   for ( 
G4int i=0; i < nElements; i++ )
   526       materialCrossSection0 += cr;
   527       cross.push_back(materialCrossSection0);
   532   for (
G4int k=0 ; k < nElements ; k++ )
   534       if (random <= cross[k]) 
return (
G4int) (*elementVector)[k]->GetZ();
 
std::vector< G4Element * > G4ElementVector
 
const G4Material * GetMaterial() const
 
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
size_t GetNumberOfElements() const
 
const G4ElementVector * GetElementVector() const
 
 
 
 
◆ SelectRandomElement()
Definition at line 540 of file G4RDVCrossSectionHandler.cc.
  554       G4Element* element = (*elementVector)[0];
   561       size_t materialIndex = couple->
GetIndex();
   564       G4double materialCrossSection0 = 0.0;
   567       for (
G4int i=0; i<nElements; i++)
   570           materialCrossSection0 += cr;
   571           cross.push_back(materialCrossSection0);
   576       for (
G4int k=0 ; k < nElements ; k++ )
   578           if (random <= cross[k]) 
return (*elementVector)[k];
   581       G4cout << 
"G4RDVCrossSectionHandler::SelectRandomElement - no element found" << 
G4endl;
 std::vector< G4Element * > G4ElementVector
 
const G4Material * GetMaterial() const
 
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
 
G4GLOB_DLL std::ostream G4cout
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
size_t GetNumberOfElements() const
 
const G4ElementVector * GetElementVector() const
 
 
 
 
◆ SelectRandomShell()
Definition at line 586 of file G4RDVCrossSectionHandler.cc.
  601   std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator 
pos;
   607   if (pos != 
dataMap.end()) dataSet = (*pos).second;
   610   for (
size_t i=0; i<nShells; i++)
   613       if (shellDataSet != 0)
   617       if (random <= partialSum) 
return i;
 std::map< G4int, G4RDVEMDataSet *, std::less< G4int > > dataMap
 
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
 
virtual size_t NumberOfComponents(void) const =0
 
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
 
G4double FindValue(G4int Z, G4double e) const
 
static const G4double pos
 
 
 
 
◆ ValueForMaterial()
Definition at line 395 of file G4RDVCrossSectionHandler.cc.
  404   for (
G4int i=0 ; i<nElements ; i++)
   408       G4double nAtomsVol = nAtomsPerVolume[i];
   409       value += nAtomsVol * elementValue;
 std::vector< G4Element * > G4ElementVector
 
const G4double * GetVecNbOfAtomsPerVolume() const
 
G4double FindValue(G4int Z, G4double e) const
 
size_t GetNumberOfElements() const
 
const G4ElementVector * GetElementVector() const
 
 
 
 
◆ activeZ
◆ crossSections
◆ dataMap
◆ eMax
◆ eMin
◆ interpolation
◆ nBins
  
  
      
        
          | G4int G4RDVCrossSectionHandler::nBins | 
         
       
   | 
  
private   | 
  
 
 
◆ unit1
  
  
      
        
          | G4double G4RDVCrossSectionHandler::unit1 | 
         
       
   | 
  
private   | 
  
 
 
◆ unit2
  
  
      
        
          | G4double G4RDVCrossSectionHandler::unit2 | 
         
       
   | 
  
private   | 
  
 
 
◆ zMax
  
  
      
        
          | G4int G4RDVCrossSectionHandler::zMax | 
         
       
   | 
  
private   | 
  
 
 
◆ zMin
  
  
      
        
          | G4int G4RDVCrossSectionHandler::zMin | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this class was generated from the following files: