47 :energies(points),
data(values), algorithm(interpolation)
49 numberOfBins = energies->size();
60 : algorithm(interpolation)
67 numberOfBins = energies->size();
86 size_t bin = FindBinLocation(e);
87 if (bin == numberOfBins)
117 size_t lowerBound = 0;
118 size_t upperBound = numberOfBins - 1;
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)
183 energies->push_back(e);
188 else if (k%nColumns == 0)
191 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
std::vector< ExP01TrackerHit * > a
virtual G4double Calculate(G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
const XML_Char const XML_Char * data
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double energy(const ThreeVector &p, const G4double m)
G4double FindValue(G4double e, G4int) const