- Timestamp:
- Nov 19, 2009, 2:53:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionHandler.cc
r1007 r1192 25 25 // 26 26 // 27 // $Id: G4CrossSectionHandler.cc,v 1. 18 2006/06/29 19:38:48 gunterExp $28 // GEANT4 tag $Name: geant4-09-02$27 // $Id: G4CrossSectionHandler.cc,v 1.21 2009/09/27 10:47:42 sincerti Exp $ 28 // GEANT4 tag $Name: emlowen-V09-02-64 $ 29 29 // 30 30 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch) … … 35 35 // 19 Jul 2002 VI Create composite data set for material 36 36 // 24 Apr 2003 VI Cut per region mfpt 37 // 38 // 15 Jul 2009 Nicolas A. Karakatsanis 39 // 40 // - BuildCrossSectionForMaterials method was revised in order to calculate the 41 // logarithmic values of the loaded data. 42 // It retrieves the data values from the G4EMLOW data files but, then, calculates the 43 // respective log values and loads them to seperate data structures. 44 // The EM data sets, initialized this way, contain both non-log and log values. 45 // These initialized data sets can enhance the computing performance of data interpolation 46 // operations 37 47 // 38 48 // ------------------------------------------------------------------- … … 66 76 G4DataVector* data; 67 77 78 G4DataVector* log_energies; 79 G4DataVector* log_data; 80 68 81 std::vector<G4VEMDataSet*>* matCrossSections = new std::vector<G4VEMDataSet*>; 69 82 … … 95 108 data = new G4DataVector; 96 109 110 log_energies = new G4DataVector; 111 log_data = new G4DataVector; 112 97 113 98 114 for (size_t bin=0; bin<nOfBins; bin++) … … 100 116 G4double e = energyVector[bin]; 101 117 energies->push_back(e); 118 if (e==0.) e=1e-300; 119 log_energies->push_back(std::log10(e)); 102 120 G4double cross = density*FindValue(Z,e); 103 121 data->push_back(cross); 122 if (cross==0.) cross=1e-300; 123 log_data->push_back(std::log10(cross)); 104 124 } 105 125 106 126 G4VDataSetAlgorithm* algo1 = interpolationAlgo->Clone(); 107 G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,algo1,1.,1.); 127 128 // G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,algo1,1.,1.); 129 130 G4VEMDataSet* elSet = new G4EMDataSet(i,energies,data,log_energies,log_data,algo1,1.,1.); 131 108 132 setForMat->AddComponent(elSet); 109 133 }
Note: See TracChangeset
for help on using the changeset viewer.