40 G4ParticleHPManager::G4ParticleHPManager()
43 ,USE_ONLY_PHOTONEVAPORATION(false)
44 ,SKIP_MISSING_ISOTOPES(false)
45 ,NEGLECT_DOPPLER(false)
46 ,DO_NOT_ADJUST_FINAL_STATE(false)
47 ,PRODUCE_FISSION_FRAGMENTS(false)
48 ,theElasticCrossSections(NULL)
49 ,theCaptureCrossSections(NULL)
51 ,theFissionCrossSections(NULL)
56 ,theTSCoherentCrossSections(NULL)
57 ,theTSIncoherentCrossSections(NULL)
58 ,theTSInelasticCrossSections(NULL)
59 ,theTSCoherentFinalStates(NULL)
60 ,theTSIncoherentFinalStates(NULL)
61 ,theTSInelasticFinalStates(NULL)
64 if ( getenv(
"G4NEUTRONHP_DO_NOT_ADJUST_FINAL_STATE" ) || getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE") ) DO_NOT_ADJUST_FINAL_STATE =
true;
65 if ( getenv(
"G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION" ) ) USE_ONLY_PHOTONEVAPORATION =
true;
66 if ( getenv(
"G4NEUTRONHP_NEGLECT_DOPPLER" ) || getenv(
"G4PHP_NEGLECT_DOPPLER") ) NEGLECT_DOPPLER =
true;
67 if ( getenv(
"G4NEUTRONHP_SKIP_MISSING_ISOTOPES" ) ) SKIP_MISSING_ISOTOPES =
true;
68 if ( getenv(
"G4NEUTRONHP_PRODUCE_FISSION_FRAGMENTS" ) ) PRODUCE_FISSION_FRAGMENTS =
true;
70 G4ParticleHPManager::~G4ParticleHPManager()
104 compfilename +=
".z";
105 std::ifstream* in =
new std::ifstream ( compfilename , std::ios::binary | std::ios::ate );
109 G4int file_size = in->tellg();
110 in->seekg( 0 , std::ios::beg );
111 Bytef* compdata =
new Bytef[ file_size ];
114 in->read( (
char*)compdata , file_size );
117 uLongf complen = (uLongf) ( file_size*4 );
118 Bytef* uncompdata =
new Bytef[complen];
120 while (
Z_OK !=
uncompress ( uncompdata , &complen , compdata , file_size ) ) {
124 uncompdata =
new Bytef[complen];
129 delete [] uncompdata;
132 std::ifstream thefData( filename , std::ios::in | std::ios::ate );
133 if ( thefData.good() ) {
134 G4int file_size = thefData.tellg();
135 thefData.seekg( 0 , std::ios::beg );
136 char* filedata =
new char[ file_size ];
138 thefData.read( filedata , file_size );
141 data =
new G4String ( filedata , file_size );
146 iss.setstate( std::ios::badbit );
149 if ( data != NULL ) {
153 if (
id ==
"G4NDL" ) {
157 register_data_file(filename,source);
159 iss.seekg( 0 , std::ios::beg );
163 in->close();
delete in;
170 compfilename +=
".z";
171 std::ifstream* in =
new std::ifstream ( compfilename , std::ios::binary | std::ios::ate );
177 std::ifstream thefData( filename , std::ios::in | std::ios::ate );
178 if ( thefData.good() ) {
184 iss.setstate( std::ios::badbit );
192 G4cout <<
"You are setting a new verbose level for Particle HP package." <<
G4endl;
193 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;
194 verboseLevel = newValue;
197 void G4ParticleHPManager::register_data_file(
G4String filename,
G4String source)
199 mDataEvaluation.insert( std::pair < G4String , G4String > ( filename , source ) );
205 G4cout <<
"Data source of this Partile HP calculation are " <<
G4endl;
206 for ( std::map< G4String , G4String >::iterator
207 it = mDataEvaluation.begin() ; it != mDataEvaluation.end() ; it++ ) {
214 if ( theInelasticCrossSections.end() != theInelasticCrossSections.find( particle ) )
215 return theInelasticCrossSections.find( particle )->second;
221 theInelasticCrossSections.insert( std::pair<const G4ParticleDefinition* , G4PhysicsTable* >( particle , val ) );
225 if ( theInelasticFSs.end() != theInelasticFSs.find( particle ) )
226 return theInelasticFSs.find( particle )->second;
232 theInelasticFSs.insert ( std::pair<
const G4ParticleDefinition*,std::vector<G4ParticleHPChannelList*>*>( particle , val ) );
static G4ParticleHPManager * GetInstance()
void RegisterInelasticCrossSections(const G4ParticleDefinition *, G4PhysicsTable *)
static G4ParticleHPThreadLocalManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
void CloseReactionWhiteBoard()
const XML_Char const XML_Char * data
void SetVerboseLevel(G4int i)
G4GLOB_DLL std::ostream G4cout
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
void OpenReactionWhiteBoard()
void GetDataStream2(G4String, std::istringstream &iss)
void OpenReactionWhiteBoard()
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *)
std::vector< G4ParticleHPChannelList * > * GetInelasticFinalStates(const G4ParticleDefinition *)
void CloseReactionWhiteBoard()
G4ParticleHPReactionWhiteBoard * GetReactionWhiteBoard()
void RegisterInelasticFinalStates(const G4ParticleDefinition *, std::vector< G4ParticleHPChannelList * > *)