Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPThermalScatteringData Class Reference

#include <G4NeutronHPThermalScatteringData.hh>

+ Inheritance diagram for G4NeutronHPThermalScatteringData:

Public Member Functions

 G4NeutronHPThermalScatteringData ()
 
 ~G4NeutronHPThermalScatteringData ()
 
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
 
G4double GetIsoCrossSection (const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
 
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4double GetInelasticCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4double GetCoherentCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *)
 
G4double GetIncoherentCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
void DumpPhysicsTable (const G4ParticleDefinition &)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 58 of file G4NeutronHPThermalScatteringData.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPThermalScatteringData()

G4NeutronHPThermalScatteringData::G4NeutronHPThermalScatteringData ( )

Definition at line 51 of file G4NeutronHPThermalScatteringData.cc.

52:G4VCrossSectionDataSet("NeutronHPThermalScatteringData")
53{
54// Upper limit of neutron energy
55 emax = 4*eV;
56 SetMinKinEnergy( 0*MeV );
57 SetMaxKinEnergy( emax );
58
59 ke_cache = 0.0;
60 xs_cache = 0.0;
61 element_cache = NULL;
62 material_cache = NULL;
63
64 indexOfThermalElement.clear();
65
67
68 //BuildPhysicsTable( *G4Neutron::Neutron() );
69}
void SetMaxKinEnergy(G4double value)
void SetMinKinEnergy(G4double value)

◆ ~G4NeutronHPThermalScatteringData()

G4NeutronHPThermalScatteringData::~G4NeutronHPThermalScatteringData ( )

Definition at line 71 of file G4NeutronHPThermalScatteringData.cc.

72{
73
74 clearCurrentXSData();
75
76 delete names;
77}

Member Function Documentation

◆ BuildPhysicsTable()

void G4NeutronHPThermalScatteringData::BuildPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 204 of file G4NeutronHPThermalScatteringData.cc.

205{
206
207 if ( &aP != G4Neutron::Neutron() )
208 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
209
210 //std::map < std::pair < G4Material* , const G4Element* > , G4int > dic;
211 dic.clear();
212 clearCurrentXSData();
213 std::map < G4String , G4int > co_dic;
214
215 //Searching Nist Materials
216 static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
217 size_t numberOfMaterials = G4Material::GetNumberOfMaterials();
218 for ( size_t i = 0 ; i < numberOfMaterials ; i++ )
219 {
220 G4Material* material = (*theMaterialTable)[i];
221 size_t numberOfElements = material->GetNumberOfElements();
222 for ( size_t j = 0 ; j < numberOfElements ; j++ )
223 {
224 const G4Element* element = material->GetElement(j);
225 if ( names->IsThisThermalElement ( material->GetName() , element->GetName() ) )
226 {
227 G4int ts_ID_of_this_geometry;
228 G4String ts_ndl_name = names->GetTS_NDL_Name( material->GetName() , element->GetName() );
229 if ( co_dic.find ( ts_ndl_name ) != co_dic.end() )
230 {
231 ts_ID_of_this_geometry = co_dic.find ( ts_ndl_name ) -> second;
232 }
233 else
234 {
235 ts_ID_of_this_geometry = co_dic.size();
236 co_dic.insert ( std::pair< G4String , G4int >( ts_ndl_name , ts_ID_of_this_geometry ) );
237 }
238
239 //G4cout << "Neutron HP Thermal Scattering Data : Registering a material-element pair of "
240 // << material->GetName() << " " << element->GetName()
241 // << " as internal thermal scattering id of " << ts_ID_of_this_geometry << "." << G4endl;
242
243 dic.insert( std::pair < std::pair < G4Material* , const G4Element* > , G4int > ( std::pair < G4Material* , const G4Element* > ( material , element ) , ts_ID_of_this_geometry ) );
244 }
245 }
246 }
247
248 //Searching TS Elements
249 static const G4ElementTable* theElementTable = G4Element::GetElementTable();
250 size_t numberOfElements = G4Element::GetNumberOfElements();
251 //size_t numberOfThermalElements = 0;
252 for ( size_t i = 0 ; i < numberOfElements ; i++ )
253 {
254 const G4Element* element = (*theElementTable)[i];
255 if ( names->IsThisThermalElement ( element->GetName() ) )
256 {
257 if ( names->IsThisThermalElement ( element->GetName() ) )
258 {
259 G4int ts_ID_of_this_geometry;
260 G4String ts_ndl_name = names->GetTS_NDL_Name( element->GetName() );
261 if ( co_dic.find ( ts_ndl_name ) != co_dic.end() )
262 {
263 ts_ID_of_this_geometry = co_dic.find ( ts_ndl_name ) -> second;
264 }
265 else
266 {
267 ts_ID_of_this_geometry = co_dic.size();
268 co_dic.insert ( std::pair< G4String , G4int >( ts_ndl_name , ts_ID_of_this_geometry ) );
269 }
270
271 //G4cout << "Neutron HP Thermal Scattering: Registering an element of "
272 // << material->GetName() << " " << element->GetName()
273 // << " as internal thermal scattering id of " << ts_ID_of_this_geometry << "." << G4endl;
274
275 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 ) );
276 }
277 }
278 }
279
280 G4cout << G4endl;
281 G4cout << "Neutron HP Thermal Scattering Data: Following material-element pairs and/or elements are registered." << G4endl;
282 for ( std::map < std::pair < const G4Material* , const G4Element* > , G4int >::iterator it = dic.begin() ; it != dic.end() ; it++ )
283 {
284 if ( it->first.first != NULL )
285 {
286 G4cout << "Material " << it->first.first->GetName() << " - Element " << it->first.second->GetName() << ", internal thermal scattering id " << it->second << G4endl;
287 }
288 else
289 {
290 G4cout << "Element " << it->first.second->GetName() << ", internal thermal scattering id " << it->second << G4endl;
291 }
292 }
293 G4cout << G4endl;
294
295
296 //G4cout << "Neutron HP Thermal Scattering Data: Following NDL thermal scattering files are assigned to the internal thermal scattering id." << G4endl;
297 //for ( std::map < G4String , G4int >::iterator it = co_dic.begin() ; it != co_dic.end() ; it++ )
298 //{
299 // G4cout << "NDL file name " << it->first << ", internal thermal scattering id " << it->second << G4endl;
300 //}
301
302
303 // Read Cross Section Data files
304
305 G4String dirName;
306 if ( !getenv( "G4NEUTRONHPDATA" ) )
307 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
308 G4String baseName = getenv( "G4NEUTRONHPDATA" );
309
310 dirName = baseName + "/ThermalScattering";
311
312 G4String ndl_filename;
313 G4String full_name;
314
315 for ( std::map < G4String , G4int >::iterator it = co_dic.begin() ; it != co_dic.end() ; it++ )
316 {
317 ndl_filename = it->first;
318 G4int ts_ID = it->second;
319
320 // Coherent
321 full_name = dirName + "/Coherent/CrossSection/" + ndl_filename;
322 std::map< G4double , G4NeutronHPVector* >* coh_amapTemp_EnergyCross = readData( full_name );
323 coherent.insert ( std::pair < G4int , std::map< G4double , G4NeutronHPVector* >* > ( ts_ID , coh_amapTemp_EnergyCross ) );
324
325 // Incoherent
326 full_name = dirName + "/Incoherent/CrossSection/" + ndl_filename;
327 std::map< G4double , G4NeutronHPVector* >* incoh_amapTemp_EnergyCross = readData( full_name );
328 incoherent.insert ( std::pair < G4int , std::map< G4double , G4NeutronHPVector* >* > ( ts_ID , incoh_amapTemp_EnergyCross ) );
329
330 // Inelastic
331 full_name = dirName + "/Inelastic/CrossSection/" + ndl_filename;
332 std::map< G4double , G4NeutronHPVector* >* inela_amapTemp_EnergyCross = readData( full_name );
333 inelastic.insert ( std::pair < G4int , std::map< G4double , G4NeutronHPVector* >* > ( ts_ID , inela_amapTemp_EnergyCross ) );
334
335 }
336
337}
std::vector< G4Element * > G4ElementTable
std::vector< G4Material * > G4MaterialTable
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static size_t GetNumberOfElements()
Definition: G4Element.cc:406
const G4String & GetName() const
Definition: G4Element.hh:127
static const G4ElementTable * GetElementTable()
Definition: G4Element.cc:399
static const G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:562
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:569
const G4Element * GetElement(G4int iel) const
Definition: G4Material.hh:201
size_t GetNumberOfElements() const
Definition: G4Material.hh:185
const G4String & GetName() const
Definition: G4Material.hh:177
G4String GetTS_NDL_Name(G4String nameG4Element)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4int first(char) const

Referenced by G4NeutronHPThermalScattering::G4NeutronHPThermalScattering().

◆ DumpPhysicsTable()

void G4NeutronHPThermalScatteringData::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 370 of file G4NeutronHPThermalScatteringData.cc.

371{
372 if( &aP != G4Neutron::Neutron() )
373 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");
374// G4cout << "G4NeutronHPThermalScatteringData::DumpPhysicsTable still to be implemented"<<G4endl;
375}

◆ GetCoherentCrossSection()

G4double G4NeutronHPThermalScatteringData::GetCoherentCrossSection ( const G4DynamicParticle aP,
const G4Element anE,
const G4Material aM 
)

Definition at line 450 of file G4NeutronHPThermalScatteringData.cc.

451{
452 G4double result = 0;
453 G4int ts_id = getTS_ID( aM , anE );
454 G4double aT = aM->GetTemperature();
455 result = GetX ( aP , aT , coherent.find( ts_id )->second );
456 return result;
457}
double G4double
Definition: G4Types.hh:64
G4double GetTemperature() const
Definition: G4Material.hh:181

Referenced by G4NeutronHPThermalScattering::ApplyYourself().

◆ GetCrossSection()

G4double G4NeutronHPThermalScatteringData::GetCrossSection ( const G4DynamicParticle aP,
const G4Element anE,
const G4Material aM 
)

Definition at line 419 of file G4NeutronHPThermalScatteringData.cc.

420{
421 G4double result = 0;
422
423 G4int ts_id =getTS_ID( aM , anE );
424
425 if ( ts_id == -1 ) return result;
426
427 G4double aT = aM->GetTemperature();
428
429 G4double Xcoh = GetX ( aP , aT , coherent.find(ts_id)->second );
430 G4double Xincoh = GetX ( aP , aT , incoherent.find(ts_id)->second );
431 G4double Xinela = GetX ( aP , aT , inelastic.find(ts_id)->second );
432
433 result = Xcoh + Xincoh + Xinela;
434
435 //G4cout << "G4NeutronHPThermalScatteringData::GetCrossSection Tot= " << result/barn << " Coherent= " << Xcoh/barn << " Incoherent= " << Xincoh/barn << " Inelastic= " << Xinela/barn << G4endl;
436
437 return result;
438}

Referenced by G4NeutronHPThermalScattering::ApplyYourself(), and GetIsoCrossSection().

◆ GetIncoherentCrossSection()

G4double G4NeutronHPThermalScatteringData::GetIncoherentCrossSection ( const G4DynamicParticle aP,
const G4Element anE,
const G4Material aM 
)

Definition at line 459 of file G4NeutronHPThermalScatteringData.cc.

460{
461 G4double result = 0;
462 G4int ts_id = getTS_ID( aM , anE );
463 G4double aT = aM->GetTemperature();
464 result = GetX ( aP , aT , incoherent.find( ts_id )->second );
465 return result;
466}

◆ GetInelasticCrossSection()

G4double G4NeutronHPThermalScatteringData::GetInelasticCrossSection ( const G4DynamicParticle aP,
const G4Element anE,
const G4Material aM 
)

Definition at line 441 of file G4NeutronHPThermalScatteringData.cc.

442{
443 G4double result = 0;
444 G4int ts_id = getTS_ID( aM , anE );
445 G4double aT = aM->GetTemperature();
446 result = GetX ( aP , aT , inelastic.find( ts_id )->second );
447 return result;
448}

Referenced by G4NeutronHPThermalScattering::ApplyYourself().

◆ GetIsoCrossSection()

G4double G4NeutronHPThermalScatteringData::GetIsoCrossSection ( const G4DynamicParticle dp,
G4int  ,
G4int  ,
const G4Isotope ,
const G4Element element,
const G4Material material 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 104 of file G4NeutronHPThermalScatteringData.cc.

109{
110 if ( dp->GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache ) return xs_cache;
111
112 ke_cache = dp->GetKineticEnergy();
113 element_cache = element;
114 material_cache = material;
115 //G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
116 G4double xs = GetCrossSection( dp , element , material );
117 xs_cache = xs;
118 return xs;
119 //return GetCrossSection( dp , element , material->GetTemperature() );
120}
G4double GetKineticEnergy() const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *)

◆ IsApplicable()

G4bool G4NeutronHPThermalScatteringData::IsApplicable ( const G4DynamicParticle aP,
const G4Element anEle 
)

Definition at line 171 of file G4NeutronHPThermalScatteringData.cc.

172{
173 G4bool result = false;
174
175 G4double eKin = aP->GetKineticEnergy();
176 // Check energy
177 if ( eKin < emax )
178 {
179 // Check Particle Species
180 if ( aP->GetDefinition() == G4Neutron::Neutron() )
181 {
182 // anEle is one of Thermal elements
183 G4int ie = (G4int) anEle->GetIndex();
184 std::vector < G4int >::iterator it;
185 for ( it = indexOfThermalElement.begin() ; it != indexOfThermalElement.end() ; it++ )
186 {
187 if ( ie == *it ) return true;
188 }
189 }
190 }
191
192/*
193 if ( names->IsThisThermalElement ( anEle->GetName() ) )
194 {
195 // Check energy and projectile species
196 G4double eKin = aP->GetKineticEnergy();
197 if ( eKin < emax && aP->GetDefinition() == G4Neutron::Neutron() ) result = true;
198 }
199*/
200 return result;
201}
bool G4bool
Definition: G4Types.hh:67
G4ParticleDefinition * GetDefinition() const
size_t GetIndex() const
Definition: G4Element.hh:182

◆ IsIsoApplicable()

G4bool G4NeutronHPThermalScatteringData::IsIsoApplicable ( const G4DynamicParticle dp,
G4int  ,
G4int  ,
const G4Element element,
const G4Material material 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 79 of file G4NeutronHPThermalScatteringData.cc.

83{
84 G4double eKin = dp->GetKineticEnergy();
85 if ( eKin > 4.0*eV //GetMaxKinEnergy()
86 || eKin < 0 //GetMinKinEnergy()
87 || dp->GetDefinition() != G4Neutron::Neutron() ) return false;
88
89 if ( dic.find( std::pair < const G4Material* , const G4Element* > ( (G4Material*)NULL , element ) ) != dic.end()
90 || dic.find( std::pair < const G4Material* , const G4Element* > ( material , element ) ) != dic.end() ) return true;
91
92 return false;
93
94// return IsApplicable( dp , element );
95/*
96 G4double eKin = dp->GetKineticEnergy();
97 if ( eKin > 4.0*eV //GetMaxKinEnergy()
98 || eKin < 0 //GetMinKinEnergy()
99 || dp->GetDefinition() != G4Neutron::Neutron() ) return false;
100 return true;
101*/
102}

The documentation for this class was generated from the following files: