51 detectorMaterial(
"SiLi"),efficiencySet(0)
61 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator
pos;
109 energyVector.push_back(1.486*
keV);
110 energyVector.push_back(1.740*
keV);
111 energyVector.push_back(3.688*
keV);
112 energyVector.push_back(4.510*
keV);
113 energyVector.push_back(5.414*
keV);
114 energyVector.push_back(6.404*
keV);
118 G4int energyNumber = 0;
121 if (energy>=eMin && energy <=eMax)
124 for (
G4int i=0; i<(
G4int)energyVector.size(); i++){
125 if (energyVector[i]/
keV < energy/
keV){
127 infEnergy = energyVector[i];
128 supEnergy = energyVector[i+1];
140 value = (std::log10(infData)*std::log10(supEnergy/energy) +
141 std::log10(supData)*std::log10(energy/infEnergy)) /
142 std::log10(supEnergy/infEnergy);
143 value = std::pow(10,value);
164 else if (energy > eMax)
169 value = (
GetSupData(energy, random, energyNumber))+(energy - 6.404*
keV);
180 value = (
GetInfData(energy, random, energyNumber))+(energy - 1.486*
keV);
192 efficiency = dataSet->
FindValue(value,
id);
193 if ( RandomNum>efficiency )
210 if (Z<zMin) {Z=zMin;}
211 if (Z>zMax) {Z=zMax;}
213 if (Z >= zMin && Z <= zMax)
215 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
217 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
225 G4int nData = energySet.size();
236 for (
G4int i = 0; i<nData; i++){
237 dataSum += dataSet[i];
240 G4double normRandom = random*dataSum;
243 while (normRandom> partSum)
246 partSum += dataSet[index];
251 if (index >= 0 && index < nData)
253 value = energySet[index];
268 if (Z<zMin) {Z=zMin;}
269 if (Z>zMax) {Z=zMax;}
270 if (Z >= zMin && Z <= zMax)
272 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
274 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
280 G4int nData = energySet.size();
289 for (
G4int i = 0; i<nData; i++){
290 dataSum += dataSet[i];
293 G4double normRandom = random*dataSum;
296 while (normRandom> partSum)
298 partSum += dataSet[index];
303 if (index >= 0 && index < nData)
305 value = energySet[index];
313 std::ostringstream ost;
314 ost << fileName<<
".dat";
317 char* path = getenv(
"XRAYDATA");
322 dirFile = pathString +
"/" +
name;
325 path = getenv(
"PWD");
328 dirFile = pathString +
"/" +
name;
331 std::ifstream
file(dirFile);
332 std::filebuf* lsdp = file.rdbuf();
334 if (! (lsdp->is_open()) )
337 execp <<
"XrayFluoSiLiDetectorType - data file: " + dirFile +
" not found";
338 G4Exception(
"XrayFluoSiLiDetectorType::LoadResponseData()",
"example-xray_fluorescence07",
385 energies->push_back(e);
388 else if (k%nColumns == 0)
402 char* path = getenv(
"XRAYDATA");
406 dirFile = pathString +
"/" + fileName;
409 path = getenv(
"PWD");
411 dirFile = pathString +
"/" + fileName;
G4double GetInfData(G4double, G4double, G4int)
std::ostringstream G4ExceptionDescription
std::vector< ExP01TrackerHit * > a
static const G4double pos
std::map< G4int, G4DataVector *, std::less< G4int > > energyMap
XrayFluoSiLiDetectorType()
static constexpr double keV
void LoadResponseData(G4String)
static XrayFluoSiLiDetectorType * GetInstance()
G4String detectorMaterial
G4double ResponseFunction(G4double)
~XrayFluoSiLiDetectorType()
const XrayFluoDataSet * efficiencySet
const XML_Char const XML_Char * data
static XrayFluoSiLiDetectorType * instance
G4VDataSetAlgorithm * interpolation4
const XML_Char int const XML_Char * value
G4String GetDetectorMaterial()
void LoadEfficiencyData(G4String)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double FindValue(G4double e, G4int) const
G4double GetSupData(G4double, G4double, G4int)
std::map< G4int, G4DataVector *, std::less< G4int > > dataMap