52 detectorMaterial(
"HPGe"),efficiencySet(0)
62 std::map<G4int,G4DataVector*,std::less<G4int> >::iterator
pos;
112 if (energy>=eMin && energy <=eMax)
122 value = (std::log10(infData)*std::log10(supEnergy/energy) +
123 std::log10(supData)*std::log10(energy/infEnergy)) /
124 std::log10(supEnergy/infEnergy);
125 value = std::pow(10,value);
127 else if (energy<eMin)
134 value = (std::log10(infData)*std::log10(supEnergy/eMin) +
135 std::log10(supData)*std::log10(eMin/infEnergy)) /
136 std::log10(supEnergy/infEnergy);
137 value = std::pow(10,value);
138 value = value-eMin+
energy;
142 else if (energy>eMax)
149 value = (std::log10(infData)*std::log10(supEnergy/eMax) +
150 std::log10(supData)*std::log10(eMax/infEnergy)) /
151 std::log10(supEnergy/infEnergy);
152 value = std::pow(10,value);
153 value = value+energy- eMax;
157 efficiency = dataSet->
FindValue(value,
id);
158 if ( RandomNum>efficiency )
173 if (Z<zMin) {Z=zMin;}
174 if (Z>zMax) {Z=zMax;}
176 if (Z >= zMin && Z <= zMax)
178 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
180 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
186 G4int nData = energySet.size();
191 while (random> partSum)
193 partSum += dataSet[index];
198 if (index >= 0 && index < nData)
200 value = energySet[index];
216 if (Z<zMin) {Z=zMin;}
217 if (Z>zMax) {Z=zMax;}
218 if (Z >= zMin && Z <= zMax)
220 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator
pos;
222 std::map<G4int,G4DataVector*,std::less<G4int> >::const_iterator posData;
228 G4int nData = energySet.size();
232 while (random> partSum)
234 partSum += dataSet[index];
239 if (index >= 0 && index < nData)
241 value = energySet[index];
250 std::ostringstream ost;
252 ost << fileName<<
".dat";
256 char* path = getenv(
"XRAYDATA");
260 std::ifstream
file(dirFile);
261 std::filebuf* lsdp = file.rdbuf();
263 if (! (lsdp->is_open()) )
266 execp <<
"XrayFluoHPGeDetectorType - data file: " + dirFile +
" not found";
267 G4Exception(
"XrayFluoHPGeDetectorType::LoadResponseData()",
"example-xray_fluorescence02",
314 energies->push_back(e);
317 else if (k%nColumns == 0)
void LoadResponseData(G4String)
G4double ResponseFunction(G4double)
std::ostringstream G4ExceptionDescription
std::vector< ExP01TrackerHit * > a
static const G4double pos
G4String detectorMaterial
static constexpr double keV
std::map< G4int, G4DataVector *, std::less< G4int > > energyMap
G4double GetSupData(G4double, G4double, G4int)
void LoadEfficiencyData(G4String)
~XrayFluoHPGeDetectorType()
std::map< G4int, G4DataVector *, std::less< G4int > > dataMap
const XML_Char const XML_Char * data
static XrayFluoHPGeDetectorType * GetInstance()
static XrayFluoHPGeDetectorType * instance
const XML_Char int const XML_Char * value
const XrayFluoDataSet * efficiencySet
G4double GetInfData(G4double, G4double, G4int)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double FindValue(G4double e, G4int) const
G4VDataSetAlgorithm * interpolation4
G4String GetDetectorMaterial()
XrayFluoHPGeDetectorType()