G4NeutronHPorLEInelasticData Class Reference

#include <G4NeutronHPorLEInelasticData.hh>

Inheritance diagram for G4NeutronHPorLEInelasticData:

G4VCrossSectionDataSet

Public Member Functions

 G4NeutronHPorLEInelasticData ()
 G4NeutronHPorLEInelasticData (G4NeutronHPChannelList *, std::set< G4String > *)
 ~G4NeutronHPorLEInelasticData ()
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
G4double GetIsoCrossSection (const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
void BuildPhysicsTable (const G4ParticleDefinition &)
void DumpPhysicsTable (const G4ParticleDefinition &)

Detailed Description

Definition at line 56 of file G4NeutronHPorLEInelasticData.hh.


Constructor & Destructor Documentation

G4NeutronHPorLEInelasticData::G4NeutronHPorLEInelasticData (  ) 

Definition at line 42 of file G4NeutronHPorLEInelasticData.cc.

References G4VCrossSectionDataSet::SetMaxKinEnergy(), and G4VCrossSectionDataSet::SetMinKinEnergy().

00043 {
00044    SetMinKinEnergy( 0*MeV );                                   
00045    SetMaxKinEnergy( 20*MeV );                                   
00046 
00047    ke_cache = 0.0;
00048    xs_cache = 0.0;
00049    element_cache = NULL;
00050    material_cache = NULL;
00051 //   BuildPhysicsTable(*G4Neutron::Neutron());
00052 }

G4NeutronHPorLEInelasticData::G4NeutronHPorLEInelasticData ( G4NeutronHPChannelList ,
std::set< G4String > *   
)

Definition at line 90 of file G4NeutronHPorLEInelasticData.cc.

References G4VCrossSectionDataSet::SetMaxKinEnergy(), and G4VCrossSectionDataSet::SetMinKinEnergy().

00091 :G4VCrossSectionDataSet("NeutronHPorLEInelasticXS")
00092 {
00093    theInelasticChannel = pChannel;
00094    unavailable_elements = pSet;   
00095    //BuildPhysicsTable(*G4Neutron::Neutron());
00096 
00097    SetMinKinEnergy( 0*MeV );                                   
00098    SetMaxKinEnergy( 20*MeV );                                   
00099 
00100    ke_cache = 0.0;
00101    xs_cache = 0.0;
00102    element_cache = NULL;
00103    material_cache = NULL;
00104 }

G4NeutronHPorLEInelasticData::~G4NeutronHPorLEInelasticData (  ) 

Definition at line 54 of file G4NeutronHPorLEInelasticData.cc.

00055 {
00056 //  delete theCrossSections;
00057 }


Member Function Documentation

void G4NeutronHPorLEInelasticData::BuildPhysicsTable ( const G4ParticleDefinition  )  [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 121 of file G4NeutronHPorLEInelasticData.cc.

References G4Element::GetElementTable(), G4Element::GetNumberOfElements(), G4NeutronHPVector::GetVectorLength(), G4NeutronHPVector::GetX(), G4NeutronHPVector::GetY(), G4Neutron::Neutron(), G4PhysicsTable::push_back(), and G4LPhysicsFreeVector::PutValues().

00122 {
00123    if( &aP!=G4Neutron::Neutron() ) 
00124       throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");  
00125 
00126    size_t numberOfElements = G4Element::GetNumberOfElements();
00127    theCrossSections = new G4PhysicsTable( numberOfElements );
00128 
00129    static const G4ElementTable *theElementTable = G4Element::GetElementTable(); 
00130    for ( size_t i=0 ; i < numberOfElements; ++i )
00131    {
00132       G4PhysicsVector* thePhysVec = new G4LPhysicsFreeVector(0, 0, 0);
00133 
00134       if ( unavailable_elements->find( (*theElementTable)[i]->GetName() ) == unavailable_elements->end() ) 
00135       { 
00136 
00137          G4NeutronHPElementData* theElementData = new G4NeutronHPElementData();
00138          theElementData->Init( (*theElementTable)[i] );  
00139 
00140          G4NeutronHPVector* theHPVector = theElementData->GetData( (G4NeutronHPInelasticData*)this ); 
00141 
00142          G4int len = theHPVector->GetVectorLength();
00143 
00144          if ( len!=0 ) 
00145          {
00146             G4double emin = theHPVector->GetX(0);
00147             G4double emax = theHPVector->GetX(len-1);
00148 
00149             G4LPhysicsFreeVector* aPhysVector= new G4LPhysicsFreeVector ( len , emin , emax );
00150             for ( G4int ii=0; ii<len; ii++ )
00151             {
00152                aPhysVector->PutValues( ii , theHPVector->GetX(ii) , theHPVector->GetY(ii) );
00153             }
00154             delete thePhysVec;
00155             thePhysVec = aPhysVector;
00156          }
00157 
00158          //G4PhysicsVector* physVec = G4NeutronHPData::
00159          //Instance()->MakePhysicsVector((*theElementTable)[i], this);
00160          //theCrossSections->push_back(physVec);
00161       }
00162 
00163       theCrossSections->push_back(thePhysVec);
00164    }
00165 }

void G4NeutronHPorLEInelasticData::DumpPhysicsTable ( const G4ParticleDefinition  )  [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 169 of file G4NeutronHPorLEInelasticData.cc.

References G4Neutron::Neutron().

00170 {
00171   if(&aP!=G4Neutron::Neutron()) 
00172      throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");  
00173 //  G4cout << "G4NeutronHPorLEInelasticData::DumpPhysicsTable still to be implemented"<<G4endl;
00174 }

G4double G4NeutronHPorLEInelasticData::GetCrossSection ( const G4DynamicParticle ,
const G4Element ,
G4double  aT 
)

Definition at line 184 of file G4NeutronHPorLEInelasticData.cc.

References buffer, G4DynamicParticle::GetDefinition(), G4Element::GetIndex(), G4ReactionProduct::GetKineticEnergy(), G4DynamicParticle::GetKineticEnergy(), G4ReactionProduct::GetMass(), G4ReactionProduct::GetMomentum(), G4DynamicParticle::GetMomentum(), G4Element::GetN(), G4NucleiProperties::GetNuclearMass(), G4ParticleDefinition::GetPDGMass(), G4Nucleus::GetThermalNucleus(), G4NeutronHPChannelList::GetXsec(), G4Element::GetZ(), G4ReactionProduct::Lorentz(), and G4Neutron::Neutron().

Referenced by GetIsoCrossSection().

00185 {
00186 
00187   // G4cout << "Choice G4NeutronHPorLEInelasticData for element " << anE->GetName() << G4endl;
00188   G4double result = 0;
00189   //G4bool outOfRange;
00190   G4int index = anE->GetIndex();
00191 
00192   // prepare neutron
00193   G4double eKinetic = aP->GetKineticEnergy();
00194   G4ReactionProduct theNeutron( aP->GetDefinition() );
00195   theNeutron.SetMomentum( aP->GetMomentum() );
00196   theNeutron.SetKineticEnergy( eKinetic );
00197 
00198   // prepare thermal nucleus
00199   G4Nucleus aNuc;
00200   G4double eps = 0.0001;
00201   G4double theA = anE->GetN();
00202   G4double theZ = anE->GetZ();
00203   G4double eleMass; 
00204   eleMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theA+eps), static_cast<G4int>(theZ+eps))
00205              ) / G4Neutron::Neutron()->GetPDGMass();
00206   
00207   G4ReactionProduct boosted;
00208   G4double aXsection;
00209   
00210   // MC integration loop
00211   G4int counter = 0;
00212   G4double buffer = 0;
00213   G4int size = G4int(std::max(10., aT/60*kelvin));
00214   G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
00215   G4double neutronVMag = neutronVelocity.mag();
00216   while(counter == 0 || std::abs(buffer-result/std::max(1,counter)) > 0.03*buffer)
00217   {
00218     if(counter) buffer = result/counter;
00219     while (counter<size)
00220     {
00221       counter ++;
00222       G4ReactionProduct aThermalNuc = aNuc.GetThermalNucleus(eleMass, aT);
00223       boosted.Lorentz(theNeutron, aThermalNuc);
00224       G4double theEkin = boosted.GetKineticEnergy();
00225       //aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
00226       aXsection = theInelasticChannel[index].GetXsec( theEkin );
00227       // velocity correction.
00228       G4ThreeVector targetVelocity = 1./aThermalNuc.GetMass()*aThermalNuc.GetMomentum();
00229       aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
00230       result += aXsection;
00231     }
00232     size += size;
00233   }
00234   result /= counter;
00235   //return result;
00236   return result*barn;
00237 }

G4double G4NeutronHPorLEInelasticData::GetIsoCrossSection ( const G4DynamicParticle ,
G4int  ,
G4int  ,
const G4Isotope ,
const G4Element ,
const G4Material  
) [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 73 of file G4NeutronHPorLEInelasticData.cc.

References GetCrossSection(), and G4DynamicParticle::GetKineticEnergy().

00078 {
00079    if ( dp->GetKineticEnergy() == ke_cache && element == element_cache &&  material == material_cache ) return xs_cache;
00080 
00081    ke_cache = dp->GetKineticEnergy();
00082    element_cache = element;
00083    material_cache = material;
00084    G4double xs = GetCrossSection( dp , element , material->GetTemperature() );
00085    xs_cache = xs;
00086    return xs;
00087    //return GetCrossSection( dp , element , material->GetTemperature() );
00088 }

G4bool G4NeutronHPorLEInelasticData::IsIsoApplicable ( const G4DynamicParticle ,
G4int  ,
G4int  ,
const G4Element ,
const G4Material  
) [virtual]

Reimplemented from G4VCrossSectionDataSet.

Definition at line 59 of file G4NeutronHPorLEInelasticData.cc.

References G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4VCrossSectionDataSet::GetMaxKinEnergy(), G4VCrossSectionDataSet::GetMinKinEnergy(), G4Element::GetName(), and G4Neutron::Neutron().

00063 {
00064    G4double eKin = dp->GetKineticEnergy();
00065    if ( eKin > GetMaxKinEnergy() 
00066      || eKin < GetMinKinEnergy() 
00067      || dp->GetDefinition() != G4Neutron::Neutron() ) return false;                                   
00068    if ( unavailable_elements->find( element->GetName() ) != unavailable_elements->end() ) return false;
00069 
00070    return true;
00071 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:40 2013 for Geant4 by  doxygen 1.4.7