Geant4 11.4.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 DumpLENDTargetInfo (G4bool force=false)
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=nullptr)
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
virtual G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
virtual G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
virtual void CrossSectionDescription (std::ostream &) const
virtual void SetVerboseLevel (G4int value)
G4double GetMinKinEnergy () const
void SetMinKinEnergy (G4double value)
G4double GetMaxKinEnergy () const
void SetMaxKinEnergy (G4double value)
bool ForAllAtomsAndEnergies () const
void SetForAllAtomsAndEnergies (G4bool val)
const G4StringGetName () const
void SetName (const G4String &nam)
G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)=delete
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)=delete

Protected Member Functions

void create_used_target_map ()
G4GIDI_targetget_target_from_map (G4int nuclear_code)
virtual G4double getLENDCrossSection (G4GIDI_target *, G4double, G4double)
G4double GetUltraLowEnergyExtrapolatedXS (G4double, G4double, G4double, G4double, G4double)

Protected Attributes

G4ParticleDefinitionproj
Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel {0}
G4String name

Detailed Description

Definition at line 57 of file G4LENDCrossSection.hh.

Constructor & Destructor Documentation

◆ G4LENDCrossSection()

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

Definition at line 123 of file G4LENDCrossSection.cc.

125{
126
127 proj = NULL; //will be set in an inherited class
128 //default_evaluation = "endl99";
129 //default_evaluation = "ENDF.B-VII.0";
130 //default_evaluation = "ENDF/BVII.1";
131 //default_evaluation = "ENDF/B-8.0";
132 //default_evaluation = "ENDF/B-7.1";
133 default_evaluation = "";
134
135 allow_nat = false;
136 allow_any = false;
137
138 SetMinKinEnergy( 0*MeV );
139 SetMaxKinEnergy( 20*MeV );
140
141 lend_manager = G4LENDManager::GetInstance();
142
143}
G4ParticleDefinition * proj
static G4LENDManager * GetInstance()
G4VCrossSectionDataSet(const G4String &nam="")
void SetMaxKinEnergy(G4double value)
void SetMinKinEnergy(G4double value)

Referenced by G4LENDCaptureCrossSection::G4LENDCaptureCrossSection(), G4LENDCombinedCrossSection::G4LENDCombinedCrossSection(), G4LENDElasticCrossSection::G4LENDElasticCrossSection(), G4LENDFissionCrossSection::G4LENDFissionCrossSection(), G4LENDGammaCrossSection::G4LENDGammaCrossSection(), and G4LENDInelasticCrossSection::G4LENDInelasticCrossSection().

◆ ~G4LENDCrossSection()

G4LENDCrossSection::~G4LENDCrossSection ( )

Definition at line 145 of file G4LENDCrossSection.cc.

146{
147
148 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
149 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
150 {
151 delete it->second;
152 }
153
154}

Member Function Documentation

◆ AllowAnyCandidateTarget()

void G4LENDCrossSection::AllowAnyCandidateTarget ( )
inline

Definition at line 96 of file G4LENDCrossSection.hh.

96{ allow_any = true; };

◆ AllowNaturalAbundanceTarget()

void G4LENDCrossSection::AllowNaturalAbundanceTarget ( )
inline

Definition at line 95 of file G4LENDCrossSection.hh.

95{ allow_nat = true; };

Referenced by G4HadronElasticPhysicsLEND::ConstructProcess().

◆ BuildPhysicsTable()

void G4LENDCrossSection::BuildPhysicsTable ( const G4ParticleDefinition & )
virtual

Reimplemented from G4VCrossSectionDataSet.

Reimplemented in G4LENDGammaCrossSection.

Definition at line 156 of file G4LENDCrossSection.cc.

157{
159}

◆ ChangeDefaultEvaluation()

void G4LENDCrossSection::ChangeDefaultEvaluation ( G4String name_tmp)
inline

Definition at line 94 of file G4LENDCrossSection.hh.

94{ default_evaluation = name_tmp; };

Referenced by G4HadronElasticPhysicsLEND::ConstructProcess().

◆ create_used_target_map()

void G4LENDCrossSection::create_used_target_map ( )
protected

Definition at line 318 of file G4LENDCrossSection.cc.

319{
320
321 lend_manager->RequestChangeOfVerboseLevel( verboseLevel );
322
323 std::size_t numberOfElements = G4Element::GetNumberOfElements();
324 static const G4ElementTable* theElementTable = G4Element::GetElementTable();
325
326 for ( std::size_t i = 0 ; i < numberOfElements ; ++i )
327 {
328
329 const G4Element* anElement = (*theElementTable)[i];
330 G4int numberOfIsotope = (G4int)anElement->GetNumberOfIsotopes();
331
332 if ( numberOfIsotope > 0 )
333 {
334 // User Defined Abundances
335 for ( G4int i_iso = 0 ; i_iso < numberOfIsotope ; i_iso++ )
336 {
337 G4int iZ = anElement->GetIsotope( i_iso )->GetZ();
338 G4int iA = anElement->GetIsotope( i_iso )->GetN();
339 G4int iIsomer = anElement->GetIsotope( i_iso )->Getm();
340
341 //G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( G4Neutron::Neutron() , default_evaluation , iZ , iA );
342 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iA , iIsomer );
343 if ( allow_nat == true ) aTarget->AllowNat();
344 if ( allow_any == true ) aTarget->AllowAny();
345 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iA , iIsomer ) , aTarget ) );
346 }
347 }
348 else
349 {
350 // Natural Abundances
351 G4NistElementBuilder* nistElementBuild = lend_manager->GetNistElementBuilder();
352 G4int iZ = int ( anElement->GetZ() );
353 //G4cout << nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) ) << G4endl;
354 G4int numberOfNistIso = nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) );
355
356 for ( G4int ii = 0 ; ii < numberOfNistIso ; ii++ )
357 {
358 //G4cout << nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + i ) << G4endl;
359 if ( nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii ) > 0 )
360 {
361 G4int iMass = nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii;
362 //G4cout << iZ << " " << nistElementBuild->GetNistFirstIsotopeN( iZ ) + i << " " << nistElementBuild->GetIsotopeAbundance ( iZ , iMass ) << G4endl;
363 G4int iIsomer = 0;
364
365 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iMass );
366 if ( allow_nat == true ) aTarget->AllowNat();
367 if ( allow_any == true ) aTarget->AllowAny();
368 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iMass , iIsomer ) , aTarget ) );
369
370 }
371
372 }
373 }
374 }
376}
std::vector< G4Element * > G4ElementTable
int G4int
Definition G4Types.hh:85
G4double GetZ() const
Definition G4Element.hh:119
static std::size_t GetNumberOfElements()
Definition G4Element.cc:408
std::size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
static const G4ElementTable * GetElementTable()
Definition G4Element.cc:401
G4int GetZ() const
Definition G4Isotope.hh:80
G4int Getm() const
Definition G4Isotope.hh:89
G4int GetN() const
Definition G4Isotope.hh:83
void DumpLENDTargetInfo(G4bool force=false)
G4int GetNumberOfNistIsotopes(G4int Z) const
G4double GetIsotopeAbundance(G4int Z, G4int N) const
G4int GetNistFirstIsotopeN(G4int Z) const

Referenced by G4LENDCombinedCrossSection::BuildPhysicsTable(), BuildPhysicsTable(), G4LENDGammaCrossSection::BuildPhysicsTable(), and DumpLENDTargetInfo().

◆ DumpLENDTargetInfo()

void G4LENDCrossSection::DumpLENDTargetInfo ( G4bool force = false)

Definition at line 397 of file G4LENDCrossSection.cc.

397 {
398
399 if ( lend_manager->GetVerboseLevel() >= 1 || force ) {
400 if ( usedTarget_map.size() == 0 ) create_used_target_map();
401 G4cout << "Dumping UsedTarget of " << GetName() << " for " << proj->GetParticleName() << G4endl;
402 G4cout << "Requested Evaluation, Z , A -> Actual Evaluation, Z , A(0=Nat) " << G4endl;
403 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
404 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ ) {
405 G4cout
406 << " " << it->second->GetWantedEvaluation()
407 << ", " << it->second->GetWantedZ()
408 << ", " << it->second->GetWantedA()
409 << " -> " << it->second->GetActualEvaluation()
410 << ", " << it->second->GetActualZ()
411 << ", " << it->second->GetActualA()
412 << G4endl;
413 }
414 }
415}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const

Referenced by create_used_target_map().

◆ DumpPhysicsTable()

void G4LENDCrossSection::DumpPhysicsTable ( const G4ParticleDefinition & aP)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 161 of file G4LENDCrossSection.cc.

162{
163
164 if ( &aP != proj )
165 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use LEND data for particles other than neutrons!!!");
166
167 G4cout << G4endl;
168 G4cout << "Dump Cross Sections of " << GetName() << G4endl;
169 G4cout << "(Pointwise cross-section at 300 Kelvin.)" << G4endl;
170 G4cout << G4endl;
171
172 G4cout << "Target informaiton " << G4endl;
173
174 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
175 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
176 {
177 G4cout
178 << "Wanted " << it->second->GetWantedEvaluation()
179 << ", Z= " << it->second->GetWantedZ()
180 << ", A= " << it->second->GetWantedA()
181 << "; Actual " << it->second->GetActualEvaluation()
182 << ", Z= " << it->second->GetActualZ()
183 << ", A= " << it->second->GetActualA()
184 << ", " << it->second->GetTarget()
185 << G4endl;
186
187 G4int ie = 0;
188
189 G4GIDI_target* aTarget = it->second->GetTarget();
190 G4double aT = 300;
191 for ( ie = 0 ; ie < 130 ; ie++ )
192 {
193 G4double ke = 1.0e-5 * G4Pow::GetInstance()->powA ( 10.0 , ie/10.0 ) *eV;
194
195 if ( ke < 20*MeV )
196 {
197 G4cout << " " << GetName() << ", cross section at " << ke/eV << " [eV] = " << getLENDCrossSection ( aTarget , ke , aT )/barn << " [barn] " << G4endl;
198 }
199 }
200 G4cout << G4endl;
201
202 }
203
204}
double G4double
Definition G4Types.hh:83
virtual G4double getLENDCrossSection(G4GIDI_target *, G4double, G4double)
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition G4Pow.hh:230

◆ get_target_from_map()

G4GIDI_target * G4LENDCrossSection::get_target_from_map ( G4int nuclear_code)
protected

Definition at line 389 of file G4LENDCrossSection.cc.

389 {
390 G4GIDI_target* target = NULL;
391 if ( usedTarget_map.find( nuclear_code ) != usedTarget_map.end() ) {
392 target = usedTarget_map.find( nuclear_code )->second->GetTarget();
393 }
394 return target;
395}

Referenced by GetIsoCrossSection(), and IsIsoApplicable().

◆ GetIsoCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Reimplemented in G4LENDGammaCrossSection.

Definition at line 83 of file G4LENDCrossSection.cc.

85{
86
87 G4double xs = 0.0;
88 G4double ke = dp->GetKineticEnergy();
89 G4double temp = material->GetTemperature();
90 G4int iM = 0;
91 if ( isotope != NULL ) iM = isotope->Getm();
92
93 G4GIDI_target* aTarget = get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) );
94 if ( aTarget != NULL ) {
95 xs = getLENDCrossSection ( aTarget , ke , temp );
96 }
97 else {
98 ;
99 /*
100 G4String message;
101 message = this->GetName();
102 message += " is unexpectedly called.";
103 //G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , JustWarning ,
104 G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , FatalException ,
105 message );
106 */
107 }
108
109 return xs;
110}
G4double GetKineticEnergy() const
G4GIDI_target * get_target_from_map(G4int nuclear_code)
G4double GetTemperature() const

◆ getLENDCrossSection()

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

Definition at line 130 of file G4LENDCrossSection.hh.

130{ 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 379 of file G4LENDCrossSection.cc.

380{
381 //XS propotinal to 1/v at low energy -> 1/root(E)
382 //XS = a * 1/root(E) + b
383 G4double a = ( y2 - y1 ) / ( 1/std::sqrt(x2) - 1/std::sqrt(x1) );
384 G4double b = y1 - a * 1/std::sqrt(x1);
385 G4double result = a * 1/std::sqrt(ke) + b;
386 return result;
387}

◆ IsIsoApplicable()

G4bool G4LENDCrossSection::IsIsoApplicable ( const G4DynamicParticle * dp,
G4int iZ,
G4int iA,
const G4Element * element,
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 //G4cout << "G4LENDCrossSection::GetIsoIsIsoApplicable this->GetName() = " << this->GetName() << ", iZ = " << iZ << ", iA = " << iA << ", allow_nat = " << allow_nat << G4endl;
54 //Check existence of target data
55 if ( element != NULL ) {
56 if ( element->GetNumberOfIsotopes() != 0 ) {
57 std::vector< const G4Isotope*> vIsotope;
58 for ( G4int i = 0 ; i != (G4int)element->GetNumberOfIsotopes() ; ++i ) {
59 if ( element->GetIsotope( i )->GetN() == iA ) vIsotope.push_back( element->GetIsotope( i ) );
60 }
61 for ( std::size_t i = 0 ; i != vIsotope.size() ; ++i ) {
62 G4int iM = vIsotope[i]->Getm();
63 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , iM ) ) != NULL ) return true;
64 }
65 //No isomer has data
66 //Check natural aboundance data for the element
67 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
68 } else {
69 //Check for iZ and iA under assuming iM = 0
70 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , 0 ) ) != NULL ) return true;
71 //Check natural aboundance data for the element
72 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
73 }
74 } else {
75 //Check for iZ and iA under assuming iM = 0
76 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , iA , 0 ) ) != NULL ) return true;
77 //Check natural aboundance data for iZ
78 if ( get_target_from_map( lend_manager->GetNucleusEncoding( iZ , 0 , 0 ) ) != NULL ) return true;
79 }
80 return false;
81}
G4ParticleDefinition * GetDefinition() const

Member Data Documentation

◆ proj


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