74void G4ParticleHPThermalScattering::clearCurrentFSData()
76 if (incoherentFSs !=
nullptr) {
77 for (
auto it = incoherentFSs->cbegin(); it != incoherentFSs->cend(); ++it) {
78 for (
auto itt = it->second->cbegin(); itt != it->second->cend(); ++itt) {
79 for (
auto ittt = itt->second->cbegin(); ittt != itt->second->cend(); ++ittt) {
88 if (coherentFSs !=
nullptr) {
89 for (
auto it = coherentFSs->cbegin(); it != coherentFSs->cend(); ++it) {
90 for (
auto itt = it->second->cbegin(); itt != it->second->cend(); ++itt) {
91 for (
auto ittt = itt->second->cbegin(); ittt != itt->second->cend(); ++ittt) {
100 if (inelasticFSs !=
nullptr) {
101 for (
auto it = inelasticFSs->cbegin(); it != inelasticFSs->cend(); ++it) {
102 for (
auto itt = it->second->cbegin(); itt != it->second->cend(); ++itt) {
103 for (
auto ittt = itt->second->cbegin(); ittt != itt->second->cend(); ++ittt) {
104 for (
auto it4 = (*ittt)->vE_isoAngle.cbegin(); it4 != (*ittt)->vE_isoAngle.cend(); ++it4)
116 incoherentFSs =
nullptr;
117 coherentFSs =
nullptr;
118 inelasticFSs =
nullptr;
127std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*
128G4ParticleHPThermalScattering::readACoherentFSDATA(
G4String name)
130 auto aCoherentFSDATA =
new std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>;
132 std::istringstream theChannel(std::ios::in);
135 std::vector<G4double> vBraggE;
138 while (theChannel >> dummy)
143 auto anBragE_P =
new std::vector<std::pair<G4double, G4double>*>;
147 for (
G4int i = 0; i < n; ++i) {
150 if (aCoherentFSDATA->empty()) {
152 vBraggE.push_back(Ei);
158 anBragE_P->push_back(
new std::pair<G4double, G4double>(Ei, Pi));
160 aCoherentFSDATA->insert(
161 std::pair<
G4double, std::vector<std::pair<G4double, G4double>*>*>(temp, anBragE_P));
163 return aCoherentFSDATA;
166std::map<G4double, std::vector<E_P_E_isoAng*>*>*
167G4ParticleHPThermalScattering::readAnInelasticFSDATA(
G4String name)
169 auto anT_E_P_E_isoAng =
new std::map<G4double, std::vector<E_P_E_isoAng*>*>;
171 std::istringstream theChannel(std::ios::in);
175 while (theChannel >> dummy)
180 auto vE_P_E_isoAng =
new std::vector<E_P_E_isoAng*>;
183 for (
G4int i = 0; i <
n; ++i) {
184 vE_P_E_isoAng->push_back(readAnE_P_E_isoAng(&theChannel));
186 anT_E_P_E_isoAng->insert(std::pair<
G4double, std::vector<E_P_E_isoAng*>*>(temp, vE_P_E_isoAng));
189 return anT_E_P_E_isoAng;
193G4ParticleHPThermalScattering::readAnE_P_E_isoAng(std::istream* file)
202 aData->energy =
energy * eV;
208 for (
G4int i = 0; i < aData->n; ++i) {
211 aData->vE_isoAngle.push_back(anE_isoAng);
213 anE_isoAng->energy =
energy * eV;
214 anE_isoAng->n = nl - 2;
215 anE_isoAng->isoAngle.resize(anE_isoAng->n);
217 aData->prob.push_back(prob);
220 for (
G4int j = 0; j < anE_isoAng->n; ++j) {
223 anE_isoAng->isoAngle[j] = x;
229 aData->secondary_energy_cdf.push_back(0.);
230 for (
G4int i = 0; i < aData->n - 1; ++i) {
231 G4double E_L = aData->vE_isoAngle[i]->energy / eV;
232 G4double E_H = aData->vE_isoAngle[i + 1]->energy / eV;
234 G4double pdf = (aData->prob[i] + aData->prob[i + 1]) / 2. * dE;
236 aData->secondary_energy_cdf.push_back(total);
237 aData->secondary_energy_pdf.push_back(pdf);
238 aData->secondary_energy_value.push_back(E_L);
241 aData->sum_of_probXdEs =
total;
244 aData->secondary_energy_cdf_size = (
G4int)aData->secondary_energy_cdf.size();
245 for (
G4int i = 0; i < aData->secondary_energy_cdf_size; ++i) {
246 aData->secondary_energy_cdf[i] /=
total;
252std::map<G4double, std::vector<E_isoAng*>*>*
253G4ParticleHPThermalScattering::readAnIncoherentFSDATA(
G4String name)
255 auto T_E =
new std::map<G4double, std::vector<E_isoAng*>*>;
258 std::istringstream theChannel(std::ios::in);
262 while (theChannel >> dummy)
267 auto vE_isoAng =
new std::vector<E_isoAng*>;
270 for (
G4int i = 0; i <
n; i++)
271 vE_isoAng->push_back(readAnE_isoAng(&theChannel));
272 T_E->insert(std::pair<
G4double, std::vector<E_isoAng*>*>(temp, vE_isoAng));
279E_isoAng* G4ParticleHPThermalScattering::readAnE_isoAng(std::istream* file)
292 aData->energy =
energy * eV;
294 aData->isoAngle.resize(n);
298 for (
G4int i = 0; i < aData->n; i++)
299 *file >> aData->isoAngle[i];
313 G4bool findThermalElement =
false;
316 for (
G4int i = 0; i < n; ++i) {
321 if (getTS_ID(
nullptr, theElement) != -1) {
322 ielement = getTS_ID(
nullptr, theElement);
323 findThermalElement =
true;
326 if (getTS_ID(theMaterial, theElement) != -1) {
327 ielement = getTS_ID(theMaterial, theElement);
328 findThermalElement =
true;
334 if (findThermalElement) {
342 if (random <= inelastic / total) {
345 std::vector<G4double> v_temp;
347 for (
auto it = inelasticFSs->find(ielement)->second->cbegin();
348 it != inelasticFSs->find(ielement)->second->cend(); ++it)
350 v_temp.push_back(it->first);
353 std::pair<G4double, G4double> tempLH = find_LH(aTemp, &v_temp);
357 std::vector<E_P_E_isoAng*>* vNEP_EPM_TL =
nullptr;
358 std::vector<E_P_E_isoAng*>* vNEP_EPM_TH =
nullptr;
360 if (tempLH.first != 0.0 && tempLH.second != 0.0) {
361 vNEP_EPM_TL = inelasticFSs->find(ielement)->second->find(tempLH.first / kelvin)->second;
362 vNEP_EPM_TH = inelasticFSs->find(ielement)->second->find(tempLH.second / kelvin)->second;
364 else if (tempLH.first == 0.0) {
365 auto itm = inelasticFSs->find(ielement)->second->cbegin();
366 vNEP_EPM_TL = itm->second;
368 vNEP_EPM_TH = itm->second;
369 tempLH.first = tempLH.second;
370 tempLH.second = itm->first;
372 else if (tempLH.second == 0.0) {
373 auto itm = inelasticFSs->find(ielement)->second->cend();
375 vNEP_EPM_TH = itm->second;
377 vNEP_EPM_TL = itm->second;
378 tempLH.second = tempLH.first;
379 tempLH.first = itm->first;
386 std::pair<G4double, G4double> secondaryParam;
388 if (rand_temp < (aTemp - tempLH.first) / (tempLH.second - tempLH.first))
389 secondaryParam = sample_inelastic_E_mu(aTrack.
GetKineticEnergy(), vNEP_EPM_TH);
391 secondaryParam = sample_inelastic_E_mu(aTrack.
GetKineticEnergy(), vNEP_EPM_TL);
393 sE = secondaryParam.first;
394 mu = secondaryParam.second;
399 G4double sint = std::sqrt(1 - mu * mu);
411 std::vector<G4double> v_temp;
413 for (
auto it = coherentFSs->find(ielement)->second->cbegin();
414 it != coherentFSs->find(ielement)->second->cend(); ++it)
416 v_temp.push_back(it->first);
420 std::pair<G4double, G4double> tempLH = find_LH(aTemp, &v_temp);
425 std::vector<std::pair<G4double, G4double>*>* pvE_p_TL =
nullptr;
426 std::vector<std::pair<G4double, G4double>*>* pvE_p_TH =
nullptr;
428 if (tempLH.first != 0.0 && tempLH.second != 0.0) {
429 pvE_p_TL = coherentFSs->find(ielement)->second->find(tempLH.first / kelvin)->second;
430 pvE_p_TH = coherentFSs->find(ielement)->second->find(tempLH.first / kelvin)->second;
432 else if (tempLH.first == 0.0) {
433 pvE_p_TL = coherentFSs->find(ielement)->second->find(v_temp[0])->second;
434 pvE_p_TH = coherentFSs->find(ielement)->second->find(v_temp[1])->second;
435 tempLH.first = tempLH.second;
436 tempLH.second = v_temp[1];
438 else if (tempLH.second == 0.0) {
439 pvE_p_TH = coherentFSs->find(ielement)->second->find(v_temp.back())->second;
440 auto itv = v_temp.cend();
443 pvE_p_TL = coherentFSs->find(ielement)->second->find(*itv)->second;
444 tempLH.second = tempLH.first;
451 "A problem is found in Thermal Scattering Data! Unexpected temperature values in data");
454 std::vector<G4double> vE_T;
455 std::vector<G4double> vp_T;
457 auto n1 = (
G4int)pvE_p_TL->size();
460 std::vector<std::pair<G4double, G4double>*>* pvE_p_T_sampled;
462 if (rand_temp < (aTemp - tempLH.first) / (tempLH.second - tempLH.first))
463 pvE_p_T_sampled = pvE_p_TH;
465 pvE_p_T_sampled = pvE_p_TL;
468 for (
G4int i = 0; i < n1; ++i) {
469 vE_T.push_back((*pvE_p_T_sampled)[i]->first);
470 vp_T.push_back((*pvE_p_T_sampled)[i]->second);
474 for (
G4int i = 1; i < n1; ++i) {
475 if (E / eV < vE_T[i]) {
484 for (
G4int i = 0; i <= j; ++i) {
486 if (rand_for_mu < Pi) {
494 G4double mu = 1 - 2 * Ei / (E / eV);
496 if (mu < -1.0) mu = -1.0;
500 G4double sint = std::sqrt(1 - mu * mu);
507 std::vector<G4double> v_temp;
509 for (
auto it = incoherentFSs->find(ielement)->second->cbegin();
510 it != incoherentFSs->find(ielement)->second->cend(); ++it)
512 v_temp.push_back(it->first);
516 std::pair<G4double, G4double> tempLH = find_LH(aTemp, &v_temp);
525 if (tempLH.first != 0.0 && tempLH.second != 0.0) {
527 anEPM_TL_E = create_E_isoAng_from_energy(
529 incoherentFSs->find(ielement)->second->find(tempLH.first / kelvin)->second);
530 anEPM_TH_E = create_E_isoAng_from_energy(
532 incoherentFSs->find(ielement)->second->find(tempLH.second / kelvin)->second);
534 else if (tempLH.first == 0.0) {
536 anEPM_TL_E = create_E_isoAng_from_energy(
538 incoherentFSs->find(ielement)->second->find(v_temp[0])->second);
539 anEPM_TH_E = create_E_isoAng_from_energy(
541 incoherentFSs->find(ielement)->second->find(v_temp[1])->second);
542 tempLH.first = tempLH.second;
543 tempLH.second = v_temp[1];
545 else if (tempLH.second == 0.0) {
547 anEPM_TH_E = create_E_isoAng_from_energy(
549 incoherentFSs->find(ielement)->second->find(v_temp.back())->second);
550 auto itv = v_temp.cend();
553 anEPM_TL_E = create_E_isoAng_from_energy(
554 aTrack.
GetKineticEnergy(), incoherentFSs->find(ielement)->second->find(*itv)->second);
555 tempLH.second = tempLH.first;
565 if (rand_temp < (aTemp - tempLH.first) / (tempLH.second - tempLH.first))
566 anEPM_T_E_sampled = anEPM_TH_E;
568 anEPM_T_E_sampled = anEPM_TL_E;
570 mu = getMu(&anEPM_T_E_sampled);
575 G4double sint = std::sqrt(1 - mu * mu);
595std::pair<G4double, G4int>
596G4ParticleHPThermalScattering::sample_inelastic_E(
G4double rndm1,
G4double rndm2,
604 && rndm1 < anE_P_E_isoAng->secondary_energy_cdf[i + 1])
612 G4double alpha = (sE_pdf_i1 - sE_pdf_i) / (sE_pdf_i1 + sE_pdf_i);
615 if (std::fabs(alpha) < 1E-8) {
619 G4double beta = 2 * sE_pdf_i / (sE_pdf_i1 + sE_pdf_i);
624 if (delta < 0 && std::fabs(delta) < 1.E-8) delta = 0;
626 lambda = -beta + std::sqrt(delta);
635 sE_value = sE_value_i +
lambda * (sE_value_i1 - sE_value_i);
641 return std::pair<G4double, G4int>(sE_value, i);
647std::pair<G4double, G4double>
648G4ParticleHPThermalScattering::sample_inelastic_E_mu(
G4double pE,
649 std::vector<E_P_E_isoAng*>* vNEP_EPM)
652 std::map<G4double, G4int> map_energy;
654 std::vector<G4double> v_energy;
657 for (
auto itv = vNEP_EPM->cbegin(); itv != vNEP_EPM->cend(); ++itv) {
658 v_energy.push_back((*itv)->energy);
659 map_energy.insert(std::pair<G4double, G4int>((*itv)->energy, i));
663 std::pair<G4double, G4double> energyLH = find_LH(pE, &v_energy);
665 std::vector<E_P_E_isoAng*> pE_P_E_isoAng_limit(2,
nullptr);
667 if (energyLH.first != 0.0 && energyLH.second != 0.0) {
668 pE_P_E_isoAng_limit[0] = (*vNEP_EPM)[map_energy.find(energyLH.first)->second];
669 pE_P_E_isoAng_limit[1] = (*vNEP_EPM)[map_energy.find(energyLH.second)->second];
671 else if (energyLH.first == 0.0) {
672 pE_P_E_isoAng_limit[0] = (*vNEP_EPM)[0];
673 pE_P_E_isoAng_limit[1] = (*vNEP_EPM)[1];
675 if (energyLH.second == 0.0) {
676 pE_P_E_isoAng_limit[1] = (*vNEP_EPM).back();
677 auto itv = vNEP_EPM->cend();
680 pE_P_E_isoAng_limit[0] = *itv;
684 G4double factor = (energyLH.second - pE) / (energyLH.second - energyLH.first);
686 if ((energyLH.second - pE) <= 0. && std::fabs(pE / energyLH.second - 1) < 1E-11) factor = 0.;
687 if ((energyLH.first - pE) >= 0. && std::fabs(energyLH.first / pE - 1) < 1E-11) factor = 1.;
693 std::pair<G4double, G4int> sE_lower = sample_inelastic_E(rndm1, rndm2, pE_P_E_isoAng_limit[0]);
694 std::pair<G4double, G4int> sE_upper = sample_inelastic_E(rndm1, rndm2, pE_P_E_isoAng_limit[1]);
695 G4double sE = factor * sE_lower.first + (1 - factor) * sE_upper.first;
701 G4double mu_lower = getMu(rndm1, rndm2, pE_P_E_isoAng_limit[0]->vE_isoAngle[sE_lower.second]);
702 G4double mu_upper = getMu(rndm1, rndm2, pE_P_E_isoAng_limit[1]->vE_isoAngle[sE_upper.second]);
703 G4double mu = factor * mu_lower + (1 - factor) * mu_upper;
705 return std::pair<G4double, G4double>(sE, mu);
715 auto in =
G4int(rndm1 * ((*anEPM).n));
718 G4double mu_l = (*anEPM).isoAngle[in - 1];
719 G4double mu_h = (*anEPM).isoAngle[in];
720 result = (mu_h - mu_l) * (rndm1 * ((*anEPM).n) - in) + mu_l;
727 G4double mu_h = (*anEPM).isoAngle[0];
728 result = (mu_h - mu_l) * rndm2 + mu_l;
731 G4double mu_l = (*anEPM).isoAngle[(*anEPM).n - 1];
733 result = (mu_h - mu_l) * rndm2 + mu_l;
749 auto in =
G4int(random * ((*anEPM).n));
752 G4double mu_l = (*anEPM).isoAngle[in - 1];
753 G4double mu_h = (*anEPM).isoAngle[in];
754 result = (mu_h - mu_l) * (random * ((*anEPM).n) - in) + mu_l;
763 G4double mu_h = (*anEPM).isoAngle[0];
764 result = (mu_h - mu_l) * xx + mu_l;
767 G4double mu_l = (*anEPM).isoAngle[(*anEPM).n - 1];
769 result = (mu_h - mu_l) * xx + mu_l;
775std::pair<G4double, G4double> G4ParticleHPThermalScattering::find_LH(
G4double x,
776 std::vector<G4double>* aVector)
782 if (aVector->size() == 1) {
783 LL = aVector->front();
784 H = aVector->front();
790 for (
auto it = aVector->cbegin(); it != aVector->cend(); ++it) {
793 if (it != aVector->cbegin()) {
806 if (H == 0.0) LL = aVector->back();
809 return std::pair<G4double, G4double>(LL, H);
813 std::pair<G4double, G4double> Low,
814 std::pair<G4double, G4double> High)
817 if (High.first - Low.first != 0) {
818 y = (High.second - Low.second) / (High.first - Low.first) * (x - Low.first) + Low.second;
821 if (High.second == Low.second) {
825 G4cout <<
"G4ParticleHPThermalScattering liner interpolation err!!" <<
G4endl;
832E_isoAng G4ParticleHPThermalScattering::create_E_isoAng_from_energy(
G4double energy,
833 std::vector<E_isoAng*>* vEPM)
837 std::vector<G4double> v_e;
839 for (
auto iv = vEPM->cbegin(); iv != vEPM->cend(); ++iv)
840 v_e.push_back((*iv)->energy);
842 std::pair<G4double, G4double> energyLH = find_LH(energy, &v_e);
848 if (energyLH.first != 0.0 && energyLH.second != 0.0) {
849 for (
auto iv = vEPM->cbegin(); iv != vEPM->cend(); ++iv) {
850 if (energyLH.first == (*iv)->energy) {
858 else if (energyLH.first == 0.0) {
859 panEPM_T_EL = (*vEPM)[0];
860 panEPM_T_EH = (*vEPM)[1];
862 else if (energyLH.second == 0.0) {
863 panEPM_T_EH = (*vEPM).back();
864 auto iv = vEPM->cend();
870 if (panEPM_T_EL !=
nullptr && panEPM_T_EH !=
nullptr) {
873 if (!(check_E_isoAng(panEPM_T_EL))) panEPM_T_EL = panEPM_T_EH;
874 if (!(check_E_isoAng(panEPM_T_EH))) panEPM_T_EH = panEPM_T_EL;
876 if (panEPM_T_EL->
n == panEPM_T_EH->
n) {
878 anEPM_T_E.
n = panEPM_T_EL->
n;
880 for (
G4int i = 0; i < panEPM_T_EL->
n; ++i) {
882 angle = get_linear_interpolated(
883 energy, std::pair<G4double, G4double>(energyLH.first, panEPM_T_EL->
isoAngle[i]),
884 std::pair<G4double, G4double>(energyLH.second, panEPM_T_EH->
isoAngle[i]));
885 anEPM_T_E.
isoAngle.push_back(angle);
889 G4Exception(
"G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
"NotSupported",
891 "G4ParticleHPThermalScattering does not support yet EL->n != EH->n.");
895 G4Exception(
"G4ParticleHPThermalScattering::create_E_isoAng_from_energy",
"HAD_THERM_000",
903G4ParticleHPThermalScattering::get_secondary_energy_from_E_P_E_isoAng(
G4double random,
929 for (
G4int i = 0; i <
n - 1; ++i) {
933 sum_p += ((anE_P_E_isoAng->
prob[i]) * dE);
935 if (random <= sum_p / total) {
937 get_linear_interpolated(random, std::pair<G4double, G4double>(sum_p_L / total, E_L),
938 std::pair<G4double, G4double>(sum_p / total, E_H));
939 secondary_energy = secondary_energy * eV;
945 return secondary_energy;
948std::pair<G4double, E_isoAng>
949G4ParticleHPThermalScattering::create_sE_and_EPM_from_pE_and_vE_P_E_isoAng(
952 std::map<G4double, G4int> map_energy;
954 std::vector<G4double> v_energy;
957 for (
auto itv = vNEP_EPM->cbegin(); itv != vNEP_EPM->cend(); ++itv) {
958 v_energy.push_back((*itv)->energy);
959 map_energy.insert(std::pair<G4double, G4int>((*itv)->energy, i));
963 std::pair<G4double, G4double> energyLH = find_LH(pE, &v_energy);
968 if (energyLH.first != 0.0 && energyLH.second != 0.0) {
969 pE_P_E_isoAng_EL = (*vNEP_EPM)[map_energy.find(energyLH.first)->second];
970 pE_P_E_isoAng_EH = (*vNEP_EPM)[map_energy.find(energyLH.second)->second];
972 else if (energyLH.first == 0.0) {
973 pE_P_E_isoAng_EL = (*vNEP_EPM)[0];
974 pE_P_E_isoAng_EH = (*vNEP_EPM)[1];
976 if (energyLH.second == 0.0) {
977 pE_P_E_isoAng_EH = (*vNEP_EPM).back();
978 auto itv = vNEP_EPM->cend();
981 pE_P_E_isoAng_EL = *itv;
988 sE_L = get_secondary_energy_from_E_P_E_isoAng(rand_for_sE, pE_P_E_isoAng_EL);
989 sE_H = get_secondary_energy_from_E_P_E_isoAng(rand_for_sE, pE_P_E_isoAng_EH);
991 sE = get_linear_interpolated(pE, std::pair<G4double, G4double>(energyLH.first, sE_L),
992 std::pair<G4double, G4double>(energyLH.second, sE_H));
1001 if (E_isoAng_L.
n == E_isoAng_H.
n) {
1002 anE_isoAng.
n = E_isoAng_L.
n;
1003 for (
G4int j = 0; j < anE_isoAng.
n; ++j) {
1006 get_linear_interpolated(sE, std::pair<G4double, G4double>(sE_L, E_isoAng_L.
isoAngle[j]),
1007 std::pair<G4double, G4double>(sE_H, E_isoAng_H.
isoAngle[j]));
1008 anE_isoAng.
isoAngle.push_back(angle);
1015 return std::pair<G4double, E_isoAng>(sE, anE_isoAng);
1018void G4ParticleHPThermalScattering::buildPhysicsTable()
1030 std::map<G4String, G4int> co_dic;
1036 for (std::size_t i = 0; i < numberOfMaterials; ++i) {
1037 G4Material* material = (*theMaterialTable)[i];
1039 for (
G4int j = 0; j < numberOfElements; ++j) {
1042 G4int ts_ID_of_this_geometry;
1044 if (co_dic.find(ts_ndl_name) != co_dic.cend()) {
1045 ts_ID_of_this_geometry = co_dic.find(ts_ndl_name)->second;
1048 ts_ID_of_this_geometry = (
G4int)co_dic.size();
1049 co_dic.insert(std::pair<G4String, G4int>(ts_ndl_name, ts_ID_of_this_geometry));
1057 dic.insert(std::pair<std::pair<G4Material*, const G4Element*>,
G4int>(
1058 std::pair<G4Material*, const G4Element*>(material, element), ts_ID_of_this_geometry));
1067 for (std::size_t i = 0; i < numberOfElements; ++i) {
1068 const G4Element* element = (*theElementTable)[i];
1071 G4int ts_ID_of_this_geometry;
1073 if (co_dic.find(ts_ndl_name) != co_dic.cend()) {
1074 ts_ID_of_this_geometry = co_dic.find(ts_ndl_name)->second;
1077 ts_ID_of_this_geometry = (
G4int)co_dic.size();
1078 co_dic.insert(std::pair<G4String, G4int>(ts_ndl_name, ts_ID_of_this_geometry));
1080 dic.insert(std::pair<std::pair<const G4Material*, const G4Element*>,
G4int>(
1081 std::pair<const G4Material*, const G4Element*>((
G4Material*)
nullptr, element),
1082 ts_ID_of_this_geometry));
1089 <<
"Neutron HP Thermal Scattering: Following material-element pairs or elements are registered."
1091 for (
const auto& it : dic) {
1092 if (it.first.first !=
nullptr) {
1093 G4cout <<
"Material " << it.first.first->GetName() <<
" - Element "
1094 << it.first.second->GetName() <<
", internal thermal scattering id " << it.second
1098 G4cout <<
"Element " << it.first.second->GetName() <<
", internal thermal scattering id "
1112 clearCurrentFSData();
1114 if (coherentFSs ==
nullptr)
1116 new std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>;
1117 if (incoherentFSs ==
nullptr)
1118 incoherentFSs =
new std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>;
1119 if (inelasticFSs ==
nullptr)
1120 inelasticFSs =
new std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>;
1126 "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
1129 for (
const auto& it : co_dic) {
1131 G4int ts_ID = it.second;
1134 G4String fsName =
"/ThermalScattering/Coherent/FS/";
1135 G4String fileName = dirName + fsName + tsndlName;
1136 coherentFSs->insert(
1137 std::pair<
G4int, std::map<
G4double, std::vector<std::pair<G4double, G4double>*>*>*>(
1138 ts_ID, readACoherentFSDATA(fileName)));
1141 fsName =
"/ThermalScattering/Incoherent/FS/";
1142 fileName = dirName + fsName + tsndlName;
1143 incoherentFSs->insert(std::pair<
G4int, std::map<
G4double, std::vector<E_isoAng*>*>*>(
1144 ts_ID, readAnIncoherentFSDATA(fileName)));
1147 fsName =
"/ThermalScattering/Inelastic/FS/";
1148 fileName = dirName + fsName + tsndlName;
1149 inelasticFSs->insert(std::pair<
G4int, std::map<
G4double, std::vector<E_P_E_isoAng*>*>*>(
1150 ts_ID, readAnInelasticFSDATA(fileName)));
1164 if (dic.find(std::pair<const G4Material*, const G4Element*>(material, element)) != dic.end())
1165 result = dic.find(std::pair<const G4Material*, const G4Element*>(material, element))->second;
1172 return std::pair<G4double, G4double>(10.0 * perCent, 350.0 * CLHEP::GeV);
1180 buildPhysicsTable();
1183G4bool G4ParticleHPThermalScattering::check_E_isoAng(
E_isoAng* anE_IsoAng)
1189 for (
G4int i = 0; i < n; ++i) {
1192 if (sum != 0.0) result =
true;
1199 outFile <<
"High Precision model based on thermal scattering data in\n"
1200 <<
"evaluated nuclear data libraries for neutrons below 5eV\n"
1201 <<
"on specific materials\n";
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cout
static G4ElementTable * GetElementTable()
static size_t GetNumberOfElements()
const G4String & GetName() const
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4HadFinalState theParticleChange
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
G4double GetTemperature() const
const G4Element * GetElement(G4int iel) const
static std::size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
std::size_t GetNumberOfElements() const
const G4String & GetName() const
static G4Neutron * Neutron()
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus) override
std::map< G4int, std::map< G4double, std::vector< E_isoAng * > * > * > * GetThermalScatteringIncoherentFinalStates() const
void RegisterThermalScatteringCoherentFinalStates(std::map< G4int, std::map< G4double, std::vector< std::pair< G4double, G4double > * > * > * > *val)
void RegisterThermalScatteringIncoherentFinalStates(std::map< G4int, std::map< G4double, std::vector< E_isoAng * > * > * > *val)
void RegisterThermalScatteringInelasticFinalStates(std::map< G4int, std::map< G4double, std::vector< E_P_E_isoAng * > * > * > *val)
std::map< G4int, std::map< G4double, std::vector< E_P_E_isoAng * > * > * > * GetThermalScatteringInelasticFinalStates() const
void GetDataStream(const G4String &, std::istringstream &iss)
static G4ParticleHPManager * GetInstance()
std::map< G4int, std::map< G4double, std::vector< std::pair< G4double, G4double > * > * > * > * GetThermalScatteringCoherentFinalStates() const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
void AddUserThermalScatteringFile(G4String, G4String)
G4double GetCoherentCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
G4double GetInelasticCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
void BuildPhysicsTable(const G4ParticleDefinition &) override
void AddThermalElement(G4String, G4String)
G4bool IsThisThermalElement(G4String)
G4String GetTS_NDL_Name(G4String nameG4Element)
void ModelDescription(std::ostream &outFile) const override
const std::pair< G4double, G4double > GetFatalEnergyCheckLevels() const override
~G4ParticleHPThermalScattering() override
void AddUserThermalScatteringFile(G4String, G4String)
G4ParticleHPThermalScattering()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double total(Particle const *const p1, Particle const *const p2)
G4double energy(const ThreeVector &p, const G4double m)
std::vector< E_isoAng * > vE_isoAngle
std::vector< G4double > secondary_energy_pdf
std::vector< G4double > secondary_energy_value
std::vector< G4double > secondary_energy_cdf
std::vector< G4double > prob
G4int secondary_energy_cdf_size
std::vector< G4double > isoAngle