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

#include <G4LENDCrossSection.hh>

+ Inheritance diagram for G4LENDCrossSection:

Public Member Functions

 G4LENDCrossSection (const G4String name="")
 
 ~G4LENDCrossSection ()
 
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
 
G4double GetIsoCrossSection (const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
void DumpPhysicsTable (const G4ParticleDefinition &)
 
void ChangeDefaultEvaluation (G4String name_tmp)
 
void AllowNaturalAbundanceTarget ()
 
void AllowAnyCandidateTarget ()
 
- 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
 

Protected Member Functions

void create_used_target_map ()
 
virtual G4double getLENDCrossSection (G4GIDI_target *, G4double, G4double)
 
G4double GetUltraLowEnergyExtrapolatedXS (G4double, G4double, G4double, G4double, G4double)
 
- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 

Protected Attributes

G4ParticleDefinitionproj
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 57 of file G4LENDCrossSection.hh.

Constructor & Destructor Documentation

◆ G4LENDCrossSection()

G4LENDCrossSection::G4LENDCrossSection ( const G4String  name = "")

Definition at line 82 of file G4LENDCrossSection.cc.

84{
85
86 default_evaluation = "endl99";
87 allow_nat = false;
88 allow_any = false;
89
90 SetMinKinEnergy( 0*MeV );
91 SetMaxKinEnergy( 20*MeV );
92
93 lend_manager = G4LENDManager::GetInstance();
94
95}
static G4LENDManager * GetInstance()
void SetMaxKinEnergy(G4double value)
void SetMinKinEnergy(G4double value)

◆ ~G4LENDCrossSection()

G4LENDCrossSection::~G4LENDCrossSection ( )

Definition at line 97 of file G4LENDCrossSection.cc.

98{
99
100 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
101 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
102 {
103 delete it->second;
104 }
105
106}

Member Function Documentation

◆ AllowAnyCandidateTarget()

void G4LENDCrossSection::AllowAnyCandidateTarget ( )
inline

Definition at line 96 of file G4LENDCrossSection.hh.

96{ allow_any = true; };

Referenced by G4NeutronLENDBuilder::Build(), and G4HadronElasticPhysicsLEND::ConstructProcess().

◆ AllowNaturalAbundanceTarget()

void G4LENDCrossSection::AllowNaturalAbundanceTarget ( )
inline

Definition at line 95 of file G4LENDCrossSection.hh.

95{ allow_nat = true; };

◆ BuildPhysicsTable()

void G4LENDCrossSection::BuildPhysicsTable ( const G4ParticleDefinition )
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 108 of file G4LENDCrossSection.cc.

109{
111}

◆ ChangeDefaultEvaluation()

void G4LENDCrossSection::ChangeDefaultEvaluation ( G4String  name_tmp)
inline

Definition at line 94 of file G4LENDCrossSection.hh.

94{ default_evaluation = name_tmp; };

Referenced by G4NeutronLENDBuilder::Build(), and G4HadronElasticPhysicsLEND::ConstructProcess().

◆ create_used_target_map()

void G4LENDCrossSection::create_used_target_map ( )
protected

Definition at line 270 of file G4LENDCrossSection.cc.

271{
272
274
275 size_t numberOfElements = G4Element::GetNumberOfElements();
276 static const G4ElementTable* theElementTable = G4Element::GetElementTable();
277
278 for ( size_t i = 0 ; i < numberOfElements ; ++i )
279 {
280
281 const G4Element* anElement = (*theElementTable)[i];
282 G4int numberOfIsotope = anElement->GetNumberOfIsotopes();
283
284 if ( numberOfIsotope > 0 )
285 {
286 // User Defined Abundances
287 for ( G4int i_iso = 0 ; i_iso < numberOfIsotope ; i_iso++ )
288 {
289 G4int iZ = anElement->GetIsotope( i_iso )->GetZ();
290 G4int iA = anElement->GetIsotope( i_iso )->GetN();
291
292 //G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( G4Neutron::Neutron() , default_evaluation , iZ , iA );
293 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iA );
294 if ( allow_nat == true ) aTarget->AllowNat();
295 if ( allow_any == true ) aTarget->AllowAny();
296 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iA ) , aTarget ) );
297 }
298 }
299 else
300 {
301 // Natural Abundances
302 G4NistElementBuilder* nistElementBuild = lend_manager->GetNistElementBuilder();
303 G4int iZ = int ( anElement->GetZ() );
304 //G4cout << nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) ) << G4endl;
305 G4int numberOfNistIso = nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) );
306
307 for ( G4int ii = 0 ; ii < numberOfNistIso ; ii++ )
308 {
309 //G4cout << nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + i ) << G4endl;
310 if ( nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii ) > 0 )
311 {
312 G4int iMass = nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii;
313 //G4cout << iZ << " " << nistElementBuild->GetNistFirstIsotopeN( iZ ) + i << " " << nistElementBuild->GetIsotopeAbundance ( iZ , iMass ) << G4endl;
314
315 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iMass );
316 if ( allow_nat == true ) aTarget->AllowNat();
317 if ( allow_any == true ) aTarget->AllowAny();
318 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iMass ) , aTarget ) );
319
320 }
321
322 }
323 }
324 }
325
326 G4cout << "Dump UsedTarget for " << GetName() << G4endl;
327 G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) , Pointer of Target" << G4endl;
328 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
329 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
330 {
331 G4cout
332 << " " << it->second->GetWantedEvaluation()
333 << ", " << it->second->GetWantedZ()
334 << ", " << it->second->GetWantedA()
335 << " -> " << it->second->GetActualEvaluation()
336 << ", " << it->second->GetActualZ()
337 << ", " << it->second->GetActualA()
338 << ", " << it->second->GetTarget()
339 << G4endl;
340 }
341
342}
std::vector< G4Element * > G4ElementTable
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4double GetZ() const
Definition: G4Element.hh:131
static size_t GetNumberOfElements()
Definition: G4Element.cc:406
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:169
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
static const G4ElementTable * GetElementTable()
Definition: G4Element.cc:399
G4int GetZ() const
Definition: G4Isotope.hh:91
G4int GetN() const
Definition: G4Isotope.hh:94
G4ParticleDefinition * proj
G4int GetNucleusEncoding(G4int iZ, G4int iA)
G4bool RequestChangeOfVerboseLevel(G4int)
G4NistElementBuilder * GetNistElementBuilder()
G4int GetNumberOfNistIsotopes(G4int Z)
G4double GetIsotopeAbundance(G4int Z, G4int N)
G4int GetNistFirstIsotopeN(G4int Z)
const G4String & GetName() const

Referenced by BuildPhysicsTable().

◆ DumpPhysicsTable()

void G4LENDCrossSection::DumpPhysicsTable ( const G4ParticleDefinition aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 113 of file G4LENDCrossSection.cc.

114{
115
116 if ( &aP != proj )
117 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use LEND data for particles other than neutrons!!!");
118
119 G4cout << G4endl;
120 G4cout << "Dump Cross Sections of " << GetName() << G4endl;
121 G4cout << "(Pointwise cross-section at 300 Kelvin.)" << G4endl;
122 G4cout << G4endl;
123
124 G4cout << "Target informaiton " << G4endl;
125
126 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
127 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
128 {
129 G4cout
130 << "Wanted " << it->second->GetWantedEvaluation()
131 << ", Z= " << it->second->GetWantedZ()
132 << ", A= " << it->second->GetWantedA()
133 << "; Actual " << it->second->GetActualEvaluation()
134 << ", Z= " << it->second->GetActualZ()
135 << ", A= " << it->second->GetActualA()
136 << ", " << it->second->GetTarget()
137 << G4endl;
138
139 G4int ie = 0;
140
141 G4GIDI_target* aTarget = it->second->GetTarget();
142 G4double aT = 300;
143 for ( ie = 0 ; ie < 130 ; ie++ )
144 {
145 G4double ke = 1.0e-5 * std::pow ( 10.0 , ie/10.0 ) *eV;
146
147 if ( ke < 20*MeV )
148 {
149 G4cout << " " << GetName() << ", cross section at " << ke/eV << " [eV] = " << getLENDCrossSection ( aTarget , ke , aT )/barn << " [barn] " << G4endl;
150 }
151 }
152 G4cout << G4endl;
153
154 }
155
156}
double G4double
Definition: G4Types.hh:64
virtual G4double getLENDCrossSection(G4GIDI_target *, G4double, G4double)

◆ GetIsoCrossSection()

G4double G4LENDCrossSection::GetIsoCrossSection ( const G4DynamicParticle dp,
G4int  iZ,
G4int  iA,
const G4Isotope ,
const G4Element ,
const G4Material material 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 56 of file G4LENDCrossSection.cc.

58{
59
60 G4double xs = 0.0;
61 G4double ke = dp->GetKineticEnergy();
62 G4double temp = material->GetTemperature();
63
64 G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA ) )->second->GetTarget();
65
66 xs = getLENDCrossSection ( aTarget , ke , temp );
67
68 return xs;
69}
G4double GetKineticEnergy() const
G4double GetTemperature() const
Definition: G4Material.hh:181

◆ getLENDCrossSection()

virtual G4double G4LENDCrossSection::getLENDCrossSection ( G4GIDI_target ,
G4double  ,
G4double   
)
inlineprotectedvirtual

Definition at line 129 of file G4LENDCrossSection.hh.

129{ return 0.0; };

Referenced by DumpPhysicsTable(), and GetIsoCrossSection().

◆ GetUltraLowEnergyExtrapolatedXS()

G4double G4LENDCrossSection::GetUltraLowEnergyExtrapolatedXS ( G4double  x1,
G4double  x2,
G4double  y1,
G4double  y2,
G4double  ke 
)
protected

Definition at line 345 of file G4LENDCrossSection.cc.

346{
347 //XS propotinal to 1/v at low energy -> 1/root(E)
348 //XS = a * 1/root(E) + b
349 G4double a = ( y2 - y1 ) / ( 1/std::sqrt(x2) - 1/std::sqrt(x1) );
350 G4double b = y1 - a * 1/std::sqrt(x1);
351 G4double result = a * 1/std::sqrt(ke) + b;
352 return result;
353}

◆ IsIsoApplicable()

G4bool G4LENDCrossSection::IsIsoApplicable ( const G4DynamicParticle dp,
G4int  ,
G4int  ,
const G4Element ,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 46 of file G4LENDCrossSection.cc.

48{
49 G4double eKin = dp->GetKineticEnergy();
50 if ( dp->GetDefinition() != proj ) return false;
51 if ( eKin > GetMaxKinEnergy() || eKin < GetMinKinEnergy() ) return false;
52
53 return true;
54}
G4ParticleDefinition * GetDefinition() const

Member Data Documentation

◆ proj


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