47 :energies(points),
data(values), algorithm(interpolation)
60 : algorithm(interpolation)
117 size_t lowerBound = 0;
121 while (lowerBound <= upperBound)
123 size_t midBin = (lowerBound + upperBound)/2;
124 if ( energy < (*
energies)[midBin] ) upperBound = midBin-1;
125 else lowerBound = midBin+1;
140 path = getenv(
"XRAYDATA");
142 path = getenv(
"PWD");
150 dirFile = pathString +
"/" + fileName +
".dat";
152 std::ifstream
file(dirFile);
153 std::filebuf* lsdp = file.rdbuf();
155 if (! (lsdp->is_open()) )
158 execp <<
"XrayFluoDataSet - data file: " + dirFile +
" not found"<<
G4endl;
159 G4Exception(
"XrayFluoDataSet::LoadData()",
"example-xray_fluorescence01",
174 if (a == -1 || a == -2)
188 else if (k%nColumns == 0)
191 data->push_back(value);
209 for (
size_t i=0; i<size; i++)
215 <<
" - Data value : "
G4bool LoadData(const G4String &dataFile)
std::ostringstream G4ExceptionDescription
std::vector< ExP01TrackerHit * > a
const XML_Char const XML_Char * data
const XML_Char int const XML_Char * value
XrayFluoDataSet(G4int Z, G4DataVector *points, G4DataVector *values, const G4VDataSetAlgorithm *interpolation, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn)
G4int FindBinLocation(G4double energy) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double FindValue(G4double e, G4int) const
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
G4GLOB_DLL std::ostream G4cout
const G4VDataSetAlgorithm * algorithm