Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4LENDCrossSection Class Reference

#include <G4LENDCrossSection.hh>

Inheritance diagram for G4LENDCrossSection:
G4VCrossSectionDataSet G4LENDCaptureCrossSection G4LENDElasticCrossSection G4LENDFissionCrossSection G4LENDInelasticCrossSection

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)
 
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 G4Isotope * SelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4String & GetName () 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

G4ParticleDefinition * proj
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 57 of file G4LENDCrossSection.hh.

Constructor & Destructor Documentation

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

Definition at line 83 of file G4LENDCrossSection.cc.

References G4LENDManager::GetInstance(), python.hepunit::MeV, proj, G4VCrossSectionDataSet::SetMaxKinEnergy(), and G4VCrossSectionDataSet::SetMinKinEnergy().

85 {
86 
87  proj = NULL; //will be set in an inherited class
88  //default_evaluation = "endl99";
89  default_evaluation = "ENDF.B-VII.0";
90 
91  allow_nat = false;
92  allow_any = false;
93 
94  SetMinKinEnergy( 0*MeV );
95  SetMaxKinEnergy( 20*MeV );
96 
97  lend_manager = G4LENDManager::GetInstance();
98 
99 }
G4VCrossSectionDataSet(const G4String &nam="")
G4ParticleDefinition * proj
void SetMinKinEnergy(G4double value)
static G4LENDManager * GetInstance()
void SetMaxKinEnergy(G4double value)
G4LENDCrossSection::~G4LENDCrossSection ( )

Definition at line 101 of file G4LENDCrossSection.cc.

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

Member Function Documentation

void G4LENDCrossSection::AllowAnyCandidateTarget ( )
inline

Definition at line 96 of file G4LENDCrossSection.hh.

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

96 { allow_any = true; };
void G4LENDCrossSection::AllowNaturalAbundanceTarget ( )
inline

Definition at line 95 of file G4LENDCrossSection.hh.

95 { allow_nat = true; };
void G4LENDCrossSection::BuildPhysicsTable ( const G4ParticleDefinition &  )
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 112 of file G4LENDCrossSection.cc.

References create_used_target_map().

113 {
115 }
void G4LENDCrossSection::ChangeDefaultEvaluation ( G4String  name_tmp)
inline

Definition at line 94 of file G4LENDCrossSection.hh.

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

94 { default_evaluation = name_tmp; };
void G4LENDCrossSection::create_used_target_map ( )
protected

Definition at line 274 of file G4LENDCrossSection.cc.

References G4LENDUsedTarget::AllowAny(), G4LENDUsedTarget::AllowNat(), G4cout, G4endl, G4Element::GetElementTable(), G4Element::GetIsotope(), G4NistElementBuilder::GetIsotopeAbundance(), G4Isotope::Getm(), G4Isotope::GetN(), G4VCrossSectionDataSet::GetName(), G4LENDManager::GetNistElementBuilder(), G4NistElementBuilder::GetNistFirstIsotopeN(), G4LENDManager::GetNucleusEncoding(), G4Element::GetNumberOfElements(), G4Element::GetNumberOfIsotopes(), G4NistElementBuilder::GetNumberOfNistIsotopes(), G4Isotope::GetZ(), G4Element::GetZ(), int(), proj, G4LENDManager::RequestChangeOfVerboseLevel(), and G4VCrossSectionDataSet::verboseLevel.

Referenced by BuildPhysicsTable().

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 117 of file G4LENDCrossSection.cc.

References python.hepunit::barn, python.hepunit::eV, G4cout, G4endl, getLENDCrossSection(), G4VCrossSectionDataSet::GetName(), python.hepunit::MeV, and proj.

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 56 of file G4LENDCrossSection.cc.

References G4DynamicParticle::GetKineticEnergy(), getLENDCrossSection(), G4Isotope::Getm(), G4LENDManager::GetNucleusEncoding(), G4Material::GetTemperature(), and python.hepunit::second.

58 {
59 
60  G4double xs = 0.0;
61  G4double ke = dp->GetKineticEnergy();
62  G4double temp = material->GetTemperature();
63  G4int iM = isotope->Getm();
64 
65  G4GIDI_target* aTarget = usedTarget_map.find( lend_manager->GetNucleusEncoding( iZ , iA , iM ) )->second->GetTarget();
66 
67  xs = getLENDCrossSection ( aTarget , ke , temp );
68 
69  return xs;
70 }
virtual G4double getLENDCrossSection(G4GIDI_target *, G4double, G4double)
G4double GetKineticEnergy() const
int G4int
Definition: G4Types.hh:78
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4int Getm() const
Definition: G4Isotope.hh:100
G4double GetTemperature() const
Definition: G4Material.hh:180
double G4double
Definition: G4Types.hh:76
virtual G4double G4LENDCrossSection::getLENDCrossSection ( G4GIDI_target *  ,
G4double  ,
G4double   
)
inlineprotectedvirtual

Definition at line 129 of file G4LENDCrossSection.hh.

Referenced by DumpPhysicsTable(), and GetIsoCrossSection().

129 { return 0.0; };
G4double G4LENDCrossSection::GetUltraLowEnergyExtrapolatedXS ( G4double  x1,
G4double  x2,
G4double  y1,
G4double  y2,
G4double  ke 
)
protected

Definition at line 351 of file G4LENDCrossSection.cc.

References test::a, and test::b.

352 {
353  //XS propotinal to 1/v at low energy -> 1/root(E)
354  //XS = a * 1/root(E) + b
355  G4double a = ( y2 - y1 ) / ( 1/std::sqrt(x2) - 1/std::sqrt(x1) );
356  G4double b = y1 - a * 1/std::sqrt(x1);
357  G4double result = a * 1/std::sqrt(ke) + b;
358  return result;
359 }
double G4double
Definition: G4Types.hh:76
G4bool G4LENDCrossSection::IsIsoApplicable ( const G4DynamicParticle *  dp,
G4int  ,
G4int  ,
const G4Element *  ,
const G4Material *   
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 46 of file G4LENDCrossSection.cc.

References G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4VCrossSectionDataSet::GetMaxKinEnergy(), G4VCrossSectionDataSet::GetMinKinEnergy(), and proj.

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 }
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
G4ParticleDefinition * proj
double G4double
Definition: G4Types.hh:76

Field Documentation

G4ParticleDefinition* G4LENDCrossSection::proj
protected

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