43G4ParticleHPManager::G4ParticleHPManager()
45,USE_ONLY_PHOTONEVAPORATION(false)
46,SKIP_MISSING_ISOTOPES(false)
47,NEGLECT_DOPPLER(false)
48,DO_NOT_ADJUST_FINAL_STATE(false)
49,PRODUCE_FISSION_FRAGMENTS(false)
50,USE_WENDT_FISSION_MODEL(false)
51,USE_NRESP71_MODEL(false)
52,theElasticCrossSections(0)
53,theCaptureCrossSections(0)
54,theFissionCrossSections(0)
58,theTSCoherentCrossSections(0)
59,theTSIncoherentCrossSections(0)
60,theTSInelasticCrossSections(0)
61,theTSCoherentFinalStates(0)
62,theTSIncoherentFinalStates(0)
63,theTSInelasticFinalStates(0)
67 if ( std::getenv(
"G4NEUTRONHP_DO_NOT_ADJUST_FINAL_STATE" ) ||
68 std::getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) {
69 DO_NOT_ADJUST_FINAL_STATE =
true;
71 ed <<
"Environmental variables G4NEUTRONHP_DO_NOT_ADJUST_FINAL_STATE and \n"
72 <<
"G4PHP_DO_NOT_ADJUST_FINAL_STATE are valid but deprecated and will be replaced \n"
73 <<
"with the UI command: /process/had/particle_hp/do_not_adjust_final_state \n"
74 <<
"in the next major release, Geant4 version 11.0";
77 if ( std::getenv(
"G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION" ) ) {
78 USE_ONLY_PHOTONEVAPORATION =
true;
80 ed <<
"Environmental variable G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION \n"
81 <<
"is valid but deprecated and will be replaced with the UI command: \n"
82 <<
"/process/had/particle_hp/use_photo_evaporation \n"
83 <<
"in the next major release, Geant4 version 11.0";
86 if ( std::getenv(
"G4NEUTRONHP_NEGLECT_DOPPLER" ) ||
87 std::getenv(
"G4PHP_NEGLECT_DOPPLER" ) ) {
88 NEGLECT_DOPPLER =
true;
90 ed <<
"Environmental variables G4NEUTRONHP_NEGLECT_DOPPLER and G4PHP_NEGLECT_DOPPLER \n"
91 <<
"are valid but deprecated and will be replaced with the UI command: \n"
92 <<
"/process/had/particle_hp/neglect_Doppler_broadening \n"
93 <<
"in the next major release, Geant4 version 11.0";
96 if ( std::getenv(
"G4NEUTRONHP_SKIP_MISSING_ISOTOPES" ) ) {
97 SKIP_MISSING_ISOTOPES =
true;
99 ed <<
"Environmental variable G4NEUTRONHP_SKIP_MISSING_ISOTOPES \n"
100 <<
"is valid but deprecated and will be replaced with the UI command: \n"
101 <<
"/process/had/particle_hp/skip_missing_isotopes \n"
102 <<
"in the next major release, Geant4 version 11.0";
105 if ( std::getenv(
"G4NEUTRONHP_PRODUCE_FISSION_FRAGMENTS" ) ) {
106 PRODUCE_FISSION_FRAGMENTS =
true;
108 ed <<
"Environmental variable G4NEUTRONHP_PRODUCE_FISSION_FRAGMENTS \n"
109 <<
"is valid but deprecated and will be replaced with the UI command: \n"
110 <<
"/process/had/particle_hp/produce_fission_fragment \n"
111 <<
"in the next major release, Geant4 version 11.0";
114 if ( std::getenv(
"G4NEUTRON_HP_USE_WENDT_FISSION_MODEL" ) ) {
115 USE_WENDT_FISSION_MODEL =
true;
117 PRODUCE_FISSION_FRAGMENTS =
false;
119 ed <<
"Environmental variable G4NEUTRON_HP_USE_WENDT_FISSION_MODEL \n"
120 <<
"is valid but deprecated and will be replaced with the UI command: \n"
121 <<
"/process/had/particle_hp/use_Wendt_fission_model \n"
122 <<
"in the next major release, Geant4 version 11.0";
125 if ( std::getenv(
"G4PHP_USE_NRESP71_MODEL" ) ) {
126 USE_NRESP71_MODEL =
true;
128 ed <<
"Environmental variable G4PHP_USE_NRESP71_MODEL is valid but deprecated and \n"
129 <<
"will be replaced with the UI command: /process/had/particle_hp/use_NRESP71_model \n"
130 <<
"in the next major release, Geant4 version 11.0";
135G4ParticleHPManager::~G4ParticleHPManager()
169 compfilename +=
".z";
170 std::ifstream* in =
new std::ifstream ( compfilename , std::ios::binary | std::ios::ate );
174 G4int file_size = in->tellg();
175 in->seekg( 0 , std::ios::beg );
176 Bytef* compdata =
new Bytef[ file_size ];
180 in->read( (
char*)compdata , file_size );
183 uLongf complen = (uLongf) ( file_size*4 );
184 Bytef* uncompdata =
new Bytef[complen];
186 while (
Z_OK !=
uncompress ( uncompdata , &complen , compdata , file_size ) )
190 uncompdata =
new Bytef[complen];
195 delete [] uncompdata;
200 std::ifstream thefData( filename , std::ios::in | std::ios::ate );
201 if ( thefData.good() )
203 G4int file_size = thefData.tellg();
204 thefData.seekg( 0 , std::ios::beg );
205 char* filedata =
new char[ file_size ];
208 thefData.read( filedata , file_size );
211 data =
new G4String ( filedata , file_size );
218 iss.setstate( std::ios::badbit );
231 register_data_file(filename,source);
235 iss.seekg( 0 , std::ios::beg );
238 in->close();
delete in;
247 compfilename +=
".z";
248 std::ifstream* in =
new std::ifstream ( compfilename , std::ios::binary | std::ios::ate );
256 std::ifstream thefData( filename , std::ios::in | std::ios::ate );
257 if ( thefData.good() )
266 iss.setstate( std::ios::badbit );
274 G4cout <<
"You are setting a new verbose level for Particle HP package." <<
G4endl;
275 G4cout <<
"the new value will be used in whole of the Particle HP package, i.e., models and cross sections for Capture, Elastic, Fission and Inelastic interaction." <<
G4endl;
276 verboseLevel = newValue;
279void G4ParticleHPManager::register_data_file(
G4String filename,
G4String source)
281 mDataEvaluation.insert( std::pair < G4String , G4String > ( filename , source ) );
287 G4cout <<
"Data source of this Partile HP calculation are " <<
G4endl;
288 for ( std::map< G4String , G4String >::iterator
289 it = mDataEvaluation.begin() ; it != mDataEvaluation.end() ; it++ )
298 if ( theInelasticCrossSections.end() != theInelasticCrossSections.find( particle ) )
299 return theInelasticCrossSections.find( particle )->second;
306 theInelasticCrossSections.insert( std::pair<const G4ParticleDefinition* , G4PhysicsTable* >( particle , val ) );
311 if ( theInelasticFSs.end() != theInelasticFSs.find( particle ) )
312 return theInelasticFSs.find( particle )->second;
319 theInelasticFSs.insert ( std::pair<
const G4ParticleDefinition*,std::vector<G4ParticleHPChannelList*>*>( particle , val ) );
325 <<
"=======================================================" <<
G4endl
326 <<
"====== ParticleHP Physics Parameters ========" <<
G4endl
327 <<
"=======================================================" <<
G4endl
328 <<
" UseOnlyPhotoEvaporation ? " << USE_ONLY_PHOTONEVAPORATION <<
G4endl
329 <<
" SkipMissingIsotopes ? " << SKIP_MISSING_ISOTOPES <<
G4endl
330 <<
" NeglectDoppler ? " << NEGLECT_DOPPLER <<
G4endl
331 <<
" DoNotAdjustFinalState ? " << DO_NOT_ADJUST_FINAL_STATE <<
G4endl
332 <<
" ProduceFissionFragments ? " << PRODUCE_FISSION_FRAGMENTS <<
G4endl
333 <<
" UseWendtFissionModel ? " << USE_WENDT_FISSION_MODEL <<
G4endl
334 <<
" UseNRESP71Model ? " << USE_NRESP71_MODEL <<
G4endl
335 <<
"=======================================================" <<
G4endl
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
void GetDataStream2(G4String, std::istringstream &iss)
std::vector< G4ParticleHPChannelList * > * GetInelasticFinalStates(const G4ParticleDefinition *)
void RegisterInelasticFinalStates(const G4ParticleDefinition *, std::vector< G4ParticleHPChannelList * > *)
void SetVerboseLevel(G4int i)
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *)
void RegisterInelasticCrossSections(const G4ParticleDefinition *, G4PhysicsTable *)
static G4ParticleHPManager * GetInstance()
void CloseReactionWhiteBoard()
void GetDataStream(G4String, std::istringstream &iss)
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)