49 : theMinEnergyDBRC(0.1 *
CLHEP::eV),
50 theMaxEnergyDBRC(210. *
CLHEP::eV),
51 theMaxEnergyDoppler(30. *
CLHEP::keV)
55 char* ss = std::getenv(
"NeutronHPNames");
56 if (
nullptr != ss) { CHECK_HP_NAMES =
true; }
57 ss = std::getenv(
"G4PHP_DO_NOT_CHECK_DIFF_COEFF_REPR");
58 if (
nullptr != ss) { PHP_CHECK =
false; }
59 ss = std::getenv(
"G4PHP_MULTIPLICITY_METHOD");
60 if (
nullptr != ss &&
"BetweenInts" ==
G4String(ss)) { PHP_USE_POISSON =
false; }
61 ss = std::getenv(
"G4ParticleHPDebug");
62 if (
nullptr != ss) {
DEBUG =
true; }
67 G4Exception(
"G4ParticleHPManager::G4ParticleHPManager()",
"hadhp01",
77 fDataPath[1] = (
nullptr == ssp) ? tendl +
"/Proton" :
G4String(ssp);
80 fDataPath[2] = (
nullptr == ssp) ? tendl +
"/Deuteron" :
G4String(ssp);
83 fDataPath[3] = (
nullptr == ssp) ? tendl +
"/Triton" :
G4String(ssp);
86 fDataPath[4] = (
nullptr == ssp) ? tendl +
"/He3" :
G4String(ssp);
89 fDataPath[5] = (
nullptr == ssp) ? tendl +
"/Alpha" :
G4String(ssp);
100 if (instance ==
nullptr) {
109 if (pdg == 2112) { idx = 0; }
110 else if (pdg == 2212) { idx = 1; }
111 else if (pdg == 1000010020) { idx = 2; }
112 else if (pdg == 1000010030) { idx = 3; }
113 else if (pdg == 1000020030) { idx = 4; }
114 else if (pdg == 1000020040) { idx = 5; }
119 <<
" cannot be handled by the ParticleHP sub-library";
120 G4Exception(
"G4ParticleHPManager::G4ParticleHPManager()",
"hadhp01",
150 compfilename +=
".z";
151 auto in =
new std::ifstream(compfilename, std::ios::binary | std::ios::ate);
154 std::streamoff file_size = in->tellg();
155 in->seekg(0, std::ios::beg);
156 auto compdata =
new Bytef[file_size];
159 in->read((
char*)compdata, file_size);
162 auto complen = (uLongf)(file_size * 4);
163 auto uncompdata =
new Bytef[complen];
165 while (
Z_OK !=
uncompress(uncompdata, &complen, compdata, file_size))
169 uncompdata =
new Bytef[complen];
178 std::ifstream thefData(filename, std::ios::in | std::ios::ate);
179 if (thefData.good()) {
180 std::streamoff file_size = thefData.tellg();
181 thefData.seekg(0, std::ios::beg);
182 auto filedata =
new char[file_size];
184 thefData.read(filedata, file_size);
187 data =
new G4String(filedata, file_size);
193 iss.setstate(std::ios::badbit);
196 if (data !=
nullptr) {
204 register_data_file(filename, source);
207 iss.seekg(0, std::ios::beg);
220 compfilename +=
".z";
221 auto in =
new std::ifstream(compfilename, std::ios::binary | std::ios::ate);
227 std::ifstream thefData(filename, std::ios::in | std::ios::ate);
228 if (thefData.good()) {
235 iss.setstate(std::ios::badbit);
243 G4cout <<
"You are setting a new verbose level for Particle HP package." <<
G4endl;
244 G4cout <<
"the new value will be used in whole of the Particle HP package, i.e., models and "
245 "cross sections for Capture, Elastic, Fission and Inelastic interaction."
247 verboseLevel = newValue;
250void G4ParticleHPManager::register_data_file(
const G4String& filename,
const G4String& source)
252 mDataEvaluation.insert(std::pair<G4String, G4String>(filename, source));
257 G4cout <<
"Data source of this Partile HP calculation are " <<
G4endl;
258 for (
const auto& it : mDataEvaluation) {
266 if(isPrinted) {
return; }
268 <<
"=======================================================" <<
G4endl
269 <<
"====== ParticleHP Physics Parameters ========" <<
G4endl
270 <<
"=======================================================" <<
G4endl
271 <<
" Use only photo-evaporation " << USE_ONLY_PHOTONEVAPORATION <<
G4endl
272 <<
" Skip missing isotopes " << SKIP_MISSING_ISOTOPES <<
G4endl
273 <<
" Neglect Doppler " << NEGLECT_DOPPLER <<
G4endl
274 <<
" Do not adjust final state " << DO_NOT_ADJUST_FINAL_STATE <<
G4endl
275 <<
" Produce fission fragments " << PRODUCE_FISSION_FRAGMENTS <<
G4endl
276 <<
" Use WendtFissionModel " << USE_WENDT_FISSION_MODEL <<
G4endl
277 <<
" Use NRESP71Model " << USE_NRESP71_MODEL <<
G4endl
278 <<
" Use DBRC " << USE_DBRC <<
G4endl
279 <<
" PHP use Poisson " << PHP_USE_POISSON <<
G4endl
280 <<
" PHP check " << PHP_CHECK <<
G4endl
281 <<
" CHECK HP NAMES " << CHECK_HP_NAMES <<
G4endl
282 <<
" Enable DEBUG " << DEBUG <<
G4endl
283 <<
"=======================================================" <<
G4endl <<
G4endl;
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
static G4HadronicParameters * Instance()
G4int GetVerboseLevel() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
const G4String & GetParticleHPPath(const G4ParticleDefinition *) const
void GetDataStream2(const G4String &, std::istringstream &iss)
G4int GetPHPIndex(const G4ParticleDefinition *) const
void SetVerboseLevel(G4int i)
void GetDataStream(const G4String &, std::istringstream &iss)
G4ParticleHPManager(G4ParticleHPManager &)=delete
static G4ParticleHPManager * GetInstance()
void CloseReactionWhiteBoard()
void OpenReactionWhiteBoard()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
void CloseReactionWhiteBoard()
static G4ParticleHPThreadLocalManager * GetInstance()
void OpenReactionWhiteBoard()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)