95    if ( 
dic.find( std::pair < const G4Material* , const G4Element* > ( (
G4Material*)NULL , element ) ) != 
dic.end() 
    96      || 
dic.find( std::pair < const G4Material* , const G4Element* > ( material , element ) ) != 
dic.end() ) 
return true;
   130    std::map< G4int , std::map< G4double , G4ParticleHPVector* >* >::iterator it;
   131    std::map< G4double , G4ParticleHPVector* >::iterator itt;
   136          if ( it->second != NULL )
   138             for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
   151          if ( it->second != NULL )
   153             for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
   166          if ( it->second != NULL )
   168             for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
   195          std::vector < G4int >::iterator it; 
   198              if ( ie == *it ) 
return true;
   219       throw G4HadronicException(__FILE__, __LINE__, 
"Attempt to use NeutronHP data for particles other than neutrons!!!");  
   226    std::map < G4String , G4int > co_dic;   
   231    for ( 
size_t i = 0 ; i < numberOfMaterials ; i++ )
   235       for ( 
size_t j = 0 ; j < numberOfElements ; j++ )
   240             G4int ts_ID_of_this_geometry; 
   242             if ( co_dic.find ( ts_ndl_name ) != co_dic.end() )
   244                ts_ID_of_this_geometry = co_dic.find ( ts_ndl_name ) -> 
second;
   248                ts_ID_of_this_geometry = co_dic.size();
   249                co_dic.insert ( std::pair< G4String , G4int >( ts_ndl_name , ts_ID_of_this_geometry ) );
   256             dic.insert( std::pair < std::pair < G4Material* , const G4Element* > , 
G4int > ( std::pair < G4Material* , const G4Element* > ( material , element ) , ts_ID_of_this_geometry ) );
   265    for ( 
size_t i = 0 ; i < numberOfElements ; i++ )
   267       const G4Element* element = (*theElementTable)[i];
   272             G4int ts_ID_of_this_geometry; 
   274             if ( co_dic.find ( ts_ndl_name ) != co_dic.end() )
   276                ts_ID_of_this_geometry = co_dic.find ( ts_ndl_name ) -> 
second;
   280                ts_ID_of_this_geometry = co_dic.size();
   281                co_dic.insert ( std::pair< G4String , G4int >( ts_ndl_name , ts_ID_of_this_geometry ) );
   288             dic.insert( std::pair < std::pair < const G4Material* , const G4Element* > , 
G4int > ( std::pair < const G4Material* , const G4Element* > ( (
G4Material*)NULL , element ) ,  ts_ID_of_this_geometry ) );
   294    G4cout << 
"Neutron HP Thermal Scattering Data: Following material-element pairs and/or elements are registered." << 
G4endl;
   295    for ( std::map < std::pair < const G4Material* , const G4Element* > , 
G4int >::iterator it = 
dic.begin() ; it != 
dic.end() ; it++ )   
   297       if ( it->first.first != NULL ) 
   299          G4cout << 
"Material " << it->first.first->GetName() << 
" - Element " << it->first.second->GetName() << 
",  internal thermal scattering id " << it->second << 
G4endl;
   303          G4cout << 
"Element " << it->first.second->GetName() << 
",  internal thermal scattering id " << it->second << 
G4endl;
   323       if ( 
coherent == NULL ) 
coherent = 
new std::map< G4int , std::map< G4double , G4ParticleHPVector* >* >;
   324       if ( 
incoherent == NULL ) 
incoherent = 
new std::map< G4int , std::map< G4double , G4ParticleHPVector* >* >;
   325       if ( 
inelastic == NULL ) 
inelastic = 
new std::map< G4int , std::map< G4double , G4ParticleHPVector* >* >;
   331       if ( !getenv( 
"G4NEUTRONHPDATA" ) ) 
   332          throw G4HadronicException(__FILE__, __LINE__, 
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
   333       G4String baseName = getenv( 
"G4NEUTRONHPDATA" );
   335       dirName = baseName + 
"/ThermalScattering";
   340       for ( std::map < G4String , G4int >::iterator it = co_dic.begin() ; it != co_dic.end() ; it++ )  
   343          ndl_filename = it->
first;
   344          G4int ts_ID = it->second;
   347          full_name = dirName + 
"/Coherent/CrossSection/" + ndl_filename; 
   348          std::map< G4double , G4ParticleHPVector* >*  coh_amapTemp_EnergyCross = 
readData( full_name );
   349          coherent->insert ( std::pair < 
G4int , std::map< G4double , G4ParticleHPVector* >* > ( ts_ID , coh_amapTemp_EnergyCross ) );
   352          full_name = dirName + 
"/Incoherent/CrossSection/" + ndl_filename; 
   353          std::map< G4double , G4ParticleHPVector* >*  incoh_amapTemp_EnergyCross = 
readData( full_name );
   354          incoherent->insert ( std::pair < 
G4int , std::map< G4double , G4ParticleHPVector* >* > ( ts_ID , incoh_amapTemp_EnergyCross ) );
   357          full_name = dirName + 
"/Inelastic/CrossSection/" + ndl_filename; 
   358          std::map< G4double , G4ParticleHPVector* >*  inela_amapTemp_EnergyCross = 
readData( full_name );
   359          inelastic->insert ( std::pair < 
G4int , std::map< G4double , G4ParticleHPVector* >* > ( ts_ID , inela_amapTemp_EnergyCross ) );
   373    std::map< G4double , G4ParticleHPVector* >*  aData = 
new std::map< G4double , G4ParticleHPVector* >; 
   376    std::istringstream theChannel;
   382    while ( theChannel >> dummy )   
   390       anEnergyCross->
Init ( theChannel , nData , 
eV , 
barn );
   391       aData->insert ( std::pair < G4double , G4ParticleHPVector* > ( temp , anEnergyCross ) );
   404      throw G4HadronicException(__FILE__, __LINE__, 
"Attempt to use NeutronHP data for particles other than neutrons!!!");  
   456    if ( ts_id == -1 ) 
return result;
   464    result = Xcoh + Xincoh + Xinela;
   477    result = 
GetX ( aP , aT , 
inelastic->find( ts_id )->second );
   486    result = 
GetX ( aP , aT , 
coherent->find( ts_id )->second );
   504    if ( 
dic.find( std::pair < const G4Material* , const G4Element* > ( (
G4Material*)NULL , element ) ) != 
dic.end() ) 
   505       return dic.find( std::pair < const G4Material* , const G4Element* > ( (
G4Material*)NULL , element ) )->second; 
   506    if ( 
dic.find( std::pair < const G4Material* , const G4Element* > ( material , element ) ) != 
dic.end() ) 
   507       return dic.find( std::pair < const G4Material* , const G4Element* > ( material , element ) )->second; 
   518    if ( amapTemp_EnergyCross->size() == 0 ) 
return result;
   523    if ( amapTemp_EnergyCross->size() == 1 ) { 
   524       if ( std::fabs ( aT - amapTemp_EnergyCross->begin()->first ) / amapTemp_EnergyCross->begin()->first > 0.1 ) {
   525          G4cout << 
"G4ParticleHPThermalScatteringData:: The temperature of material ("    526                 << aT/
kelvin << 
"K) is different more than 10% from temperature of thermal scattering file expected ("    527                 << amapTemp_EnergyCross->begin()->first << 
"K). Result may not be reliable."   530       result = amapTemp_EnergyCross->begin()->second->GetXsec ( eKinetic ); 
   534    std::map< G4double , G4ParticleHPVector* >::iterator it; 
   535    for ( it = amapTemp_EnergyCross->begin() ; it != amapTemp_EnergyCross->end() ; it++ ) {
   536        if ( aT < it->first ) 
break;
   538    if ( it == amapTemp_EnergyCross->begin() && it != amapTemp_EnergyCross->end() ) it++;  
   539    if ( it != amapTemp_EnergyCross->begin() && it == amapTemp_EnergyCross->end() ) it--;  
   542    G4double XH = it->second->GetXsec ( eKinetic ); 
   546    if ( it != amapTemp_EnergyCross->begin() ) it--;
   548    G4double XL = it->second->GetXsec ( eKinetic ); 
   556    G4double X = ( XH - XL ) / ( TH - TL ) * ( T - TL ) + XL;
   569     outFile << 
"High Precision cross data based on thermal scattering data in evaluated nuclear data libraries for neutrons below 5eV on specific materials\n" ;
 static G4ParticleHPManager * GetInstance()
 
std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> * coherent
 
const G4Material * material_cache
 
void DumpPhysicsTable(const G4ParticleDefinition &)
 
void AddThermalElement(G4String, G4String)
 
static G4MaterialTable * GetMaterialTable()
 
std::vector< G4Material * > G4MaterialTable
 
void GetDataStream(G4String, std::istringstream &iss)
 
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
 
void RegisterThermalScatteringCoherentCrossSections(std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> *val)
 
G4int getTS_ID(const G4Material *, const G4Element *)
 
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
 
G4double GetCoherentCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4ParticleHPThermalScatteringData()
 
void AddUserThermalScatteringFile(G4String, G4String)
 
std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> * inelastic
 
G4double GetIncoherentCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4double GetKineticEnergy() const
 
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
 
G4GLOB_DLL std::ostream G4cout
 
static size_t GetNumberOfElements()
 
virtual void CrossSectionDescription(std::ostream &) const
 
std::map< G4int, std::map< G4double, G4ParticleHPVector * > * > * GetThermalScatteringIncoherentCrossSections()
 
void SetMinKinEnergy(G4double value)
 
const G4Element * element_cache
 
std::map< G4double, G4ParticleHPVector *> * readData(G4String)
 
const G4Element * GetElement(G4int iel) const
 
static const double second
 
static G4Neutron * Neutron()
 
G4double GetTemperature() const
 
static size_t GetNumberOfMaterials()
 
static const double kelvin
 
const G4String & GetName() const
 
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
 
void SetMaxKinEnergy(G4double value)
 
G4bool IsThisThermalElement(G4String)
 
size_t GetNumberOfElements() const
 
void RegisterThermalScatteringInelasticCrossSections(std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> *val)
 
std::map< std::pair< const G4Material *, const G4Element *>, G4int > dic
 
G4ParticleDefinition * GetDefinition() const
 
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4String GetTS_NDL_Name(G4String nameG4Element)
 
std::vector< G4Element * > G4ElementTable
 
G4double GetInelasticCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)
 
~G4ParticleHPThermalScatteringData()
 
G4ParticleHPThermalScatteringNames * names
 
static G4ElementTable * GetElementTable()
 
const G4String & GetName() const
 
void RegisterThermalScatteringIncoherentCrossSections(std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> *val)
 
void BuildPhysicsTable(const G4ParticleDefinition &)
 
std::map< G4int, std::map< G4double, G4ParticleHPVector *> *> * incoherent
 
std::map< G4int, std::map< G4double, G4ParticleHPVector * > * > * GetThermalScatteringInelasticCrossSections()
 
std::map< G4int, std::map< G4double, G4ParticleHPVector * > * > * GetThermalScatteringCoherentCrossSections()
 
G4double GetX(const G4DynamicParticle *, G4double aT, std::map< G4double, G4ParticleHPVector * > *)
 
std::vector< G4int > indexOfThermalElement
 
void clearCurrentXSData()