G4NeutronHPJENDLHEData Class Reference

#include <G4NeutronHPJENDLHEData.hh>

Inheritance diagram for G4NeutronHPJENDLHEData:

G4VCrossSectionDataSet G4NeutronHPJENDLHEElasticData G4NeutronHPJENDLHEInelasticData

Public Member Functions

 G4NeutronHPJENDLHEData ()
 G4NeutronHPJENDLHEData (G4String, G4ParticleDefinition *)
 ~G4NeutronHPJENDLHEData ()
G4bool IsApplicable (const G4DynamicParticle *, const G4Element *)
G4bool IsZAApplicable (const G4DynamicParticle *, G4double, G4double)
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, G4double aT)
void BuildPhysicsTable (const G4ParticleDefinition &)
void DumpPhysicsTable (const G4ParticleDefinition &)

Detailed Description

Definition at line 46 of file G4NeutronHPJENDLHEData.hh.


Constructor & Destructor Documentation

G4NeutronHPJENDLHEData::G4NeutronHPJENDLHEData (  ) 

Definition at line 58 of file G4NeutronHPJENDLHEData.cc.

00059 {
00060    ;
00061 }

G4NeutronHPJENDLHEData::G4NeutronHPJENDLHEData ( G4String  ,
G4ParticleDefinition  
)

Definition at line 65 of file G4NeutronHPJENDLHEData.cc.

References BuildPhysicsTable().

00066 :G4VCrossSectionDataSet( "JENDLHE"+reaction+"CrossSection" )
00067 {
00068    reactionName = reaction;
00069    BuildPhysicsTable( *pd );
00070 }

G4NeutronHPJENDLHEData::~G4NeutronHPJENDLHEData (  ) 

Definition at line 74 of file G4NeutronHPJENDLHEData.cc.

00075 {
00076    ; 
00077    //delete theCrossSections;
00078 }


Member Function Documentation

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 82 of file G4NeutronHPJENDLHEData.cc.

References FALSE, G4Element::GetElementTable(), G4StableIsotopes::GetFirstIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4NeutronHPNames::GetName(), G4Element::GetNumberOfElements(), G4StableIsotopes::GetNumberOfIsotopes(), G4ParticleDefinition::GetParticleName(), and TRUE.

Referenced by G4NeutronHPJENDLHEData().

00083 {
00084 
00085 //   if ( &aP != G4Neutron::Neutron() ) 
00086 //      throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");  
00087    particleName = aP.GetParticleName();
00088 
00089    G4String baseName = getenv( "G4NEUTRONHPDATA" );
00090    G4String dirName = baseName+"/JENDL_HE/"+particleName+"/"+reactionName ;
00091    G4String aFSType = "/CrossSection/";
00092    G4NeutronHPNames theNames; 
00093 
00094    G4String filename;
00095 
00096 // Create JENDL_HE data 
00097 // Create map element or isotope  
00098 
00099    size_t numberOfElements = G4Element::GetNumberOfElements();
00100    //theCrossSections = new G4PhysicsTable( numberOfElements );
00101 
00102    // make a PhysicsVector for each element
00103 
00104    static const G4ElementTable *theElementTable = G4Element::GetElementTable();
00105    vElement.clear();
00106    vElement.resize( numberOfElements );
00107    for ( size_t i = 0; i < numberOfElements; ++i )
00108    {
00109 
00110       G4Element* theElement = (*theElementTable)[i];
00111       vElement[i] = false;
00112 
00113       // isotope
00114       G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
00115       G4int Z = static_cast<G4int> ((*theElementTable)[i]->GetZ());
00116       if ( nIso!=0 )
00117       {
00118          G4bool found_at_least_one = false; 
00119          for ( G4int i1 = 0; i1 < nIso; i1++ )
00120          {
00121              G4int A = theElement->GetIsotope(i1)->GetN();
00122 
00123              if ( isThisNewIsotope( Z , A ) ) 
00124              { 
00125 
00126                 std::stringstream ss; 
00127                 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
00128                 filename = ss.str();
00129                 std::fstream file;
00130                 file.open ( filename , std::fstream::in );
00131                 G4int dummy;
00132                 file >> dummy;
00133                 if ( file.good() ) 
00134                 {
00135 
00136                    //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
00137                    found_at_least_one = true;
00138 
00139                    // read the file
00140                    G4PhysicsVector* aPhysVec = readAFile ( &file );
00141 
00142                    //Regist 
00143 
00144                    registAPhysicsVector( Z , A , aPhysVec );
00145 
00146                 }
00147                 else 
00148                 { 
00149                    //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
00150                 }
00151 
00152                 file.close();
00153 
00154              }
00155              else
00156              {
00157                 found_at_least_one = TRUE;
00158              }
00159           }
00160 
00161           if ( found_at_least_one ) vElement[i] = true;
00162 
00163        }
00164        else
00165        {
00166           G4StableIsotopes theStableOnes;
00167           G4int first = theStableOnes.GetFirstIsotope( Z );
00168           G4bool found_at_least_one = FALSE; 
00169           for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(theElement->GetZ() ) ); i1++)
00170           {
00171              G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
00172 
00173              if ( isThisNewIsotope( Z , A ) ) 
00174              {
00175 
00176                 std::stringstream ss; 
00177                 ss << dirName << aFSType << Z << "_" << A << "_" << theNames.GetName( Z-1 );
00178                 filename = ss.str();
00179 
00180                 std::fstream file;
00181                 file.open ( filename , std::fstream::in );
00182                 G4int dummy;
00183                 file >> dummy;
00184                 if ( file.good() ) 
00185                 {
00186                    //G4cout << "Found file for Z=" << Z << ", A=" << A << ", as " << filename << G4endl;
00187                    found_at_least_one = TRUE;
00188                    //Read the file
00189 
00190                    G4PhysicsVector* aPhysVec = readAFile ( &file );
00191 
00192                    //Regist the PhysicsVector
00193                    registAPhysicsVector( Z , A , aPhysVec );
00194 
00195                 }
00196                 else 
00197                 { 
00198                    //G4cout << "No file for "<< reactionType << " Z=" << Z << ", A=" << A << G4endl;
00199                 }
00200 
00201                 file.close();
00202              }
00203              else
00204              {
00205                 found_at_least_one = TRUE;
00206              }
00207           }
00208 
00209           if ( found_at_least_one ) vElement[i] = true;
00210 
00211        }
00212 
00213    }
00214 
00215 }

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 219 of file G4NeutronHPJENDLHEData.cc.

References G4Neutron::Neutron().

00220 {
00221   if(&aP!=G4Neutron::Neutron()) 
00222      throw G4HadronicException(__FILE__, __LINE__, "Attempt to use NeutronHP data for particles other than neutrons!!!");  
00223 //  G4cout << "G4NeutronHPJENDLHEData::DumpPhysicsTable still to be implemented"<<G4endl;
00224 }

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

Definition at line 229 of file G4NeutronHPJENDLHEData.cc.

References G4StableIsotopes::GetAbundance(), G4StableIsotopes::GetFirstIsotope(), G4Element::GetIsotope(), G4StableIsotopes::GetIsotopeNucleonCount(), G4DynamicParticle::GetKineticEnergy(), G4Isotope::GetN(), G4StableIsotopes::GetNumberOfIsotopes(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), and G4Element::GetZ().

00231 {
00232 
00233    // Primary energy >20MeV
00234    // Thus
00235    // Not take account of Doppler broadening 
00236    // also
00237    // Not take account of Target thermal motions
00238 
00239    G4double result = 0;
00240 
00241    G4double ek = aP->GetKineticEnergy();
00242 
00243    G4int nIso = anE->GetNumberOfIsotopes();
00244    G4int Z = static_cast<G4int> ( anE->GetZ() );
00245    if ( nIso!=0 )
00246    {
00247       for ( G4int i1 = 0; i1 < nIso; i1++ )
00248       {
00249 
00250          G4int A = anE->GetIsotope(i1)->GetN();
00251          G4double frac = anE->GetRelativeAbundanceVector()[ i1 ];   // This case do NOT request "*perCent".    
00252 
00253          result += frac * getXSfromThisIsotope( Z , A , ek );
00254          //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl; 
00255 
00256       }
00257    }
00258    else
00259    {
00260 
00261       G4StableIsotopes theStableOnes;
00262       G4int first = theStableOnes.GetFirstIsotope( Z );
00263       for ( G4int i1 = 0; i1 < theStableOnes.GetNumberOfIsotopes( static_cast<G4int>(anE->GetZ() ) ); i1++)
00264       {
00265          
00266          G4int A = theStableOnes.GetIsotopeNucleonCount( first+i1 );
00267          G4double frac = theStableOnes.GetAbundance( first+i1 )*perCent;  // This case request "*perCent". 
00268 
00269          result += frac * getXSfromThisIsotope( Z , A , ek );
00270          //G4cout << reactionType << " XS in barn " << Z << " " << A << " " << frac << " " << getXSfromThisIsotope( Z , A , ek )/barn << G4endl; 
00271           
00272       }
00273    }
00274    return result;
00275 
00276 }

G4bool G4NeutronHPJENDLHEData::IsApplicable ( const G4DynamicParticle ,
const G4Element  
)

Definition at line 39 of file G4NeutronHPJENDLHEData.cc.

References G4Element::GetIndex(), G4DynamicParticle::GetKineticEnergy(), and G4Neutron::Neutron().

00040 {
00041 
00042    G4bool result = true;
00043    G4double eKin = aP->GetKineticEnergy();
00044    //if(eKin>20*MeV||aP->GetDefinition()!=G4Neutron::Neutron()) result = false;
00045    if ( eKin < 20*MeV || 3*GeV < eKin || aP->GetDefinition()!=G4Neutron::Neutron() ) 
00046    {
00047       result = false;
00048    } 
00049 // Element Check 
00050    else if ( !(vElement[ anE->GetIndex() ]) ) result = false;
00051 
00052    return result;
00053 
00054 }

G4bool G4NeutronHPJENDLHEData::IsZAApplicable ( const G4DynamicParticle ,
G4double  ,
G4double   
) [inline]

Definition at line 58 of file G4NeutronHPJENDLHEData.hh.

00059    { return false; }


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