49 detectorMaterial(
"SiLi"),efficiencySet(0)
59 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator
pos;
107 energyVector.push_back(1.486*
keV);
108 energyVector.push_back(1.740*
keV);
109 energyVector.push_back(3.688*
keV);
110 energyVector.push_back(4.510*
keV);
111 energyVector.push_back(5.414*
keV);
112 energyVector.push_back(6.404*
keV);
116 G4int energyNumber = 0;
119 if (energy>=eMin && energy <=eMax)
122 for (
G4int i=0; i<(
G4int)energyVector.size(); i++){
123 if (energyVector[i]/
keV < energy/
keV){
125 infEnergy = energyVector[i];
126 supEnergy = energyVector[i+1];
138 value = (std::log10(infData)*std::log10(supEnergy/energy) +
139 std::log10(supData)*std::log10(energy/infEnergy)) /
140 std::log10(supEnergy/infEnergy);
141 value = std::pow(10,value);
162 else if (energy > eMax)
167 value = (
GetSupData(energy, random, energyNumber))+(energy - 6.404*
keV);
178 value = (
GetInfData(energy, random, energyNumber))+(energy - 1.486*
keV);
190 efficiency = dataSet->
FindValue(value,
id);
191 if ( RandomNum>efficiency )
208 if (Z<zMin) {Z=zMin;}
209 if (Z>zMax) {Z=zMax;}
211 if (Z >= zMin && Z <= zMax)
213 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
215 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
223 G4int nData = energySet.size();
234 for (
G4int i = 0; i<nData; i++){
235 dataSum += dataSet[i];
238 G4double normRandom = random*dataSum;
241 while (normRandom> partSum)
244 partSum += dataSet[index];
249 if (index >= 0 && index < nData)
251 value = energySet[index];
266 if (Z<zMin) {Z=zMin;}
267 if (Z>zMax) {Z=zMax;}
268 if (Z >= zMin && Z <= zMax)
270 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
272 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
278 G4int nData = energySet.size();
287 for (
G4int i = 0; i<nData; i++){
288 dataSum += dataSet[i];
291 G4double normRandom = random*dataSum;
294 while (normRandom> partSum)
296 partSum += dataSet[index];
301 if (index >= 0 && index < nData)
303 value = energySet[index];
311 std::ostringstream ost;
312 ost << fileName<<
".dat";
315 char* path = std::getenv(
"XRAYDATA");
320 dirFile = pathString +
"/" +
name;
323 path = std::getenv(
"PWD");
326 dirFile = pathString +
"/" +
name;
329 std::ifstream
file(dirFile);
330 std::filebuf* lsdp = file.rdbuf();
332 if (! (lsdp->is_open()) )
335 execp <<
"XrayFluoSiLiDetectorType - data file: " + dirFile +
" not found";
336 G4Exception(
"XrayFluoSiLiDetectorType::LoadResponseData()",
"example-xray_fluorescence07",
383 energies->push_back(e);
386 else if (k%nColumns == 0)
400 char* path = std::getenv(
"XRAYDATA");
404 dirFile = pathString +
"/" + fileName;
407 path = std::getenv(
"PWD");
409 dirFile = pathString +
"/" + fileName;