47 :energies(points),
data(values), algorithm(interpolation)
49 numberOfBins = energies->size();
60 : algorithm(interpolation)
67 numberOfBins = energies->size();
89 size_t bin = FindBinLocation(e);
90 if (bin == numberOfBins)
118 size_t lowerBound = 0;
119 size_t upperBound = numberOfBins - 1;
122 while (lowerBound <= upperBound)
124 size_t midBin = (lowerBound + upperBound)/2;
125 if ( energy < (*energies)[midBin] ) upperBound = midBin-1;
126 else lowerBound = midBin+1;
146 path = getenv(
"XRAYDATA");
153 dirFile = pathString +
"/" + fileName +
".dat";
155 std::ifstream
file(dirFile);
156 std::filebuf* lsdp =
file.rdbuf();
158 if (! (lsdp->is_open()) )
161 execp <<
"XrayFluoDataSet - data file: " + dirFile +
" not found"<<
G4endl;
162 G4Exception(
"XrayFluoDataSet::LoadData()",
"example-xray_fluorescence01",
177 if (a == -1 || a == -2)
186 energies->push_back(e);
191 else if (k%nColumns == 0)
194 data->push_back(value);
208 size_t size = numberOfBins;
209 for (
size_t i=0; i<size; i++)
211 G4double e = (*energies)[i] / unit1;
212 G4double sigma = (*data)[i] / unit2 ;
215 <<
" - Data value : "
XrayFluoDataSet(G4int Z, G4DataVector *points, G4DataVector *values, const G4VDataSetAlgorithm *interpolation, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn)
std::ostringstream G4ExceptionDescription
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double FindValue(G4double e, G4int) const
const XML_Char int const XML_Char * value
const XML_Char const XML_Char * data