Geant4 11.2.2
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
 
G4String name
 

Detailed Description

Definition at line 57 of file G4LENDCrossSection.hh.

Constructor & Destructor Documentation

◆ G4LENDCrossSection()

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

Definition at line 118 of file G4LENDCrossSection.cc.

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

◆ ~G4LENDCrossSection()

G4LENDCrossSection::~G4LENDCrossSection ( )

Definition at line 137 of file G4LENDCrossSection.cc.

138{
139
140 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
141 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
142 {
143 delete it->second;
144 }
145
146}

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

◆ BuildPhysicsTable()

void G4LENDCrossSection::BuildPhysicsTable ( const G4ParticleDefinition & )
virtual

◆ ChangeDefaultEvaluation()

void G4LENDCrossSection::ChangeDefaultEvaluation ( G4String name_tmp)
inline

◆ create_used_target_map()

void G4LENDCrossSection::create_used_target_map ( )
protected

Definition at line 310 of file G4LENDCrossSection.cc.

311{
312
314
315 std::size_t numberOfElements = G4Element::GetNumberOfElements();
316 static const G4ElementTable* theElementTable = G4Element::GetElementTable();
317
318 for ( std::size_t i = 0 ; i < numberOfElements ; ++i )
319 {
320
321 const G4Element* anElement = (*theElementTable)[i];
322 G4int numberOfIsotope = (G4int)anElement->GetNumberOfIsotopes();
323
324 if ( numberOfIsotope > 0 )
325 {
326 // User Defined Abundances
327 for ( G4int i_iso = 0 ; i_iso < numberOfIsotope ; i_iso++ )
328 {
329 G4int iZ = anElement->GetIsotope( i_iso )->GetZ();
330 G4int iA = anElement->GetIsotope( i_iso )->GetN();
331 G4int iIsomer = anElement->GetIsotope( i_iso )->Getm();
332
333 //G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( G4Neutron::Neutron() , default_evaluation , iZ , iA );
334 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iA , iIsomer );
335 if ( allow_nat == true ) aTarget->AllowNat();
336 if ( allow_any == true ) aTarget->AllowAny();
337 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iA , iIsomer ) , aTarget ) );
338 }
339 }
340 else
341 {
342 // Natural Abundances
343 G4NistElementBuilder* nistElementBuild = lend_manager->GetNistElementBuilder();
344 G4int iZ = int ( anElement->GetZ() );
345 //G4cout << nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) ) << G4endl;
346 G4int numberOfNistIso = nistElementBuild->GetNumberOfNistIsotopes( int ( anElement->GetZ() ) );
347
348 for ( G4int ii = 0 ; ii < numberOfNistIso ; ii++ )
349 {
350 //G4cout << nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + i ) << G4endl;
351 if ( nistElementBuild->GetIsotopeAbundance( iZ , nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii ) > 0 )
352 {
353 G4int iMass = nistElementBuild->GetNistFirstIsotopeN( iZ ) + ii;
354 //G4cout << iZ << " " << nistElementBuild->GetNistFirstIsotopeN( iZ ) + i << " " << nistElementBuild->GetIsotopeAbundance ( iZ , iMass ) << G4endl;
355 G4int iIsomer = 0;
356
357 G4LENDUsedTarget* aTarget = new G4LENDUsedTarget ( proj , default_evaluation , iZ , iMass );
358 if ( allow_nat == true ) aTarget->AllowNat();
359 if ( allow_any == true ) aTarget->AllowAny();
360 usedTarget_map.insert( std::pair< G4int , G4LENDUsedTarget* > ( lend_manager->GetNucleusEncoding( iZ , iMass , iIsomer ) , aTarget ) );
361
362 }
363
364 }
365 }
366 }
368}
std::vector< G4Element * > G4ElementTable
int G4int
Definition G4Types.hh:85
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
G4double GetZ() const
Definition G4Element.hh:119
static size_t GetNumberOfElements()
Definition G4Element.cc:393
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143
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)
G4bool RequestChangeOfVerboseLevel(G4int)
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4NistElementBuilder * GetNistElementBuilder()
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 389 of file G4LENDCrossSection.cc.

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

Referenced by create_used_target_map().

◆ DumpPhysicsTable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 153 of file G4LENDCrossSection.cc.

154{
155
156 if ( &aP != proj )
157 throw G4HadronicException(__FILE__, __LINE__, "Attempt to use LEND data for particles other than neutrons!!!");
158
159 G4cout << G4endl;
160 G4cout << "Dump Cross Sections of " << GetName() << G4endl;
161 G4cout << "(Pointwise cross-section at 300 Kelvin.)" << G4endl;
162 G4cout << G4endl;
163
164 G4cout << "Target informaiton " << G4endl;
165
166 for ( std::map< G4int , G4LENDUsedTarget* >::iterator
167 it = usedTarget_map.begin() ; it != usedTarget_map.end() ; it ++ )
168 {
169 G4cout
170 << "Wanted " << it->second->GetWantedEvaluation()
171 << ", Z= " << it->second->GetWantedZ()
172 << ", A= " << it->second->GetWantedA()
173 << "; Actual " << it->second->GetActualEvaluation()
174 << ", Z= " << it->second->GetActualZ()
175 << ", A= " << it->second->GetActualA()
176 << ", " << it->second->GetTarget()
177 << G4endl;
178
179 G4int ie = 0;
180
181 G4GIDI_target* aTarget = it->second->GetTarget();
182 G4double aT = 300;
183 for ( ie = 0 ; ie < 130 ; ie++ )
184 {
185 G4double ke = 1.0e-5 * G4Pow::GetInstance()->powA ( 10.0 , ie/10.0 ) *eV;
186
187 if ( ke < 20*MeV )
188 {
189 G4cout << " " << GetName() << ", cross section at " << ke/eV << " [eV] = " << getLENDCrossSection ( aTarget , ke , aT )/barn << " [barn] " << G4endl;
190 }
191 }
192 G4cout << G4endl;
193
194 }
195
196}
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 381 of file G4LENDCrossSection.cc.

381 {
382 G4GIDI_target* target = NULL;
383 if ( usedTarget_map.find( nuclear_code ) != usedTarget_map.end() ) {
384 target = usedTarget_map.find( nuclear_code )->second->GetTarget();
385 }
386 return target;
387}

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 G4String message;
96 message = this->GetName();
97 message += " is unexpectedly called.";
98 //G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , JustWarning ,
99 G4Exception( "G4LEND::GetIsoCrossSection(,)" , "LENDCrossSection-01" , FatalException ,
100 message );
101 }
102 xs = getLENDCrossSection ( aTarget , ke , temp );
103
104 return xs;
105}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double GetKineticEnergy() const
G4GIDI_target * get_target_from_map(G4int nuclear_code)
G4double GetTemperature() const

Referenced by G4LENDCombinedCrossSection::GetIsoCrossSection(), G4LENDGammaCrossSection::GetIsoCrossSection(), G4LENDCombinedCrossSection::SelectChannel(), and G4LENDGammaCrossSection::SelectChannel().

◆ 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 371 of file G4LENDCrossSection.cc.

372{
373 //XS propotinal to 1/v at low energy -> 1/root(E)
374 //XS = a * 1/root(E) + b
375 G4double a = ( y2 - y1 ) / ( 1/std::sqrt(x2) - 1/std::sqrt(x1) );
376 G4double b = y1 - a * 1/std::sqrt(x1);
377 G4double result = a * 1/std::sqrt(ke) + b;
378 return result;
379}

◆ 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: