G4NeutronHPorLEInelastic Class Reference

#include <G4NeutronHPorLEInelastic.hh>

Inheritance diagram for G4NeutronHPorLEInelastic:

G4HadronicInteraction

Public Member Functions

 G4NeutronHPorLEInelastic ()
 ~G4NeutronHPorLEInelastic ()
G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus)
virtual const std::pair< G4double,
G4double
GetFatalEnergyCheckLevels () const
G4bool IsThisElementOK (G4String)
G4VCrossSectionDataSetGiveXSectionDataSet ()

Detailed Description

Definition at line 95 of file G4NeutronHPorLEInelastic.hh.


Constructor & Destructor Documentation

G4NeutronHPorLEInelastic::G4NeutronHPorLEInelastic (  ) 

Definition at line 41 of file G4NeutronHPorLEInelastic.cc.

References G4cout, G4endl, G4Element::GetElementTable(), G4Element::GetNumberOfElements(), G4NeutronHPChannelList::Register(), G4NeutronHPChannelList::RestartRegistration(), G4HadronicInteraction::SetMaxEnergy(), and G4HadronicInteraction::SetMinEnergy().

00042   :G4HadronicInteraction("NeutronHPorLEInelastic")
00043 {
00044    SetMinEnergy(0.*eV);
00045    SetMaxEnergy(20.*MeV);
00046 
00047 //   G4NeutronHPInelasticFS * theFS = new G4NeutronHPInelasticFS;
00048    if(!getenv("G4NEUTRONHPDATA")) 
00049        throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
00050    dirName = getenv("G4NEUTRONHPDATA");
00051    G4String tString = "/Inelastic/";
00052    dirName = dirName + tString;
00053 //    G4cout <<"G4NeutronHPorLEInelastic::G4NeutronHPorLEInelastic testit "<<dirName<<G4endl;
00054    numEle = G4Element::GetNumberOfElements();
00055    theInelastic = new G4NeutronHPChannelList[numEle];
00056    unavailable_elements.clear();
00057    for (G4int i=0; i<numEle; i++)
00058    {
00059       theInelastic[i].Init( (*(G4Element::GetElementTable()))[i] , dirName );
00060       do
00061       {
00062        
00063          try 
00064          {
00065             theInelastic[i].Register(&theNFS, "F01"); // has
00066             theInelastic[i].Register(&theNXFS, "F02");
00067             theInelastic[i].Register(&the2NDFS, "F03");
00068             theInelastic[i].Register(&the2NFS, "F04"); // has, E Done
00069             theInelastic[i].Register(&the3NFS, "F05"); // has, E Done
00070             theInelastic[i].Register(&theNAFS, "F06");
00071             theInelastic[i].Register(&theN3AFS, "F07");
00072             theInelastic[i].Register(&the2NAFS, "F08");
00073             theInelastic[i].Register(&the3NAFS, "F09");
00074             theInelastic[i].Register(&theNPFS, "F10");
00075             theInelastic[i].Register(&theN2AFS, "F11");
00076             theInelastic[i].Register(&the2N2AFS, "F12");
00077             theInelastic[i].Register(&theNDFS, "F13");
00078             theInelastic[i].Register(&theNTFS, "F14");
00079             theInelastic[i].Register(&theNHe3FS, "F15");
00080             theInelastic[i].Register(&theND2AFS, "F16");
00081             theInelastic[i].Register(&theNT2AFS, "F17");
00082             theInelastic[i].Register(&the4NFS, "F18"); // has, E Done
00083             theInelastic[i].Register(&the2NPFS, "F19");
00084             theInelastic[i].Register(&the3NPFS, "F20");
00085             theInelastic[i].Register(&theN2PFS, "F21");
00086             theInelastic[i].Register(&theNPAFS, "F22");
00087             theInelastic[i].Register(&thePFS, "F23");
00088             theInelastic[i].Register(&theDFS, "F24");
00089             theInelastic[i].Register(&theTFS, "F25");
00090             theInelastic[i].Register(&theHe3FS, "F26");
00091             theInelastic[i].Register(&theAFS, "F27");
00092             theInelastic[i].Register(&the2AFS, "F28");
00093             theInelastic[i].Register(&the3AFS, "F29");
00094             theInelastic[i].Register(&the2PFS, "F30");
00095             theInelastic[i].Register(&thePAFS, "F31");
00096             theInelastic[i].Register(&theD2AFS, "F32");
00097             theInelastic[i].Register(&theT2AFS, "F33");
00098             theInelastic[i].Register(&thePDFS, "F34");
00099             theInelastic[i].Register(&thePTFS, "F35");
00100             theInelastic[i].Register(&theDAFS, "F36");
00101          } 
00102 
00103          catch ( G4HadronicException )
00104          {
00105             unavailable_elements.insert ( (*(G4Element::GetElementTable()))[i]->GetName() ); 
00106          }
00107          theInelastic[i].RestartRegistration();
00108       } 
00109       while( !theInelastic[i].HasDataInAnyFinalState()); 
00110 
00111    }
00112 
00113 //   delete theFS;
00114    if ( unavailable_elements.size() > 0 ) 
00115    {
00116       std::set< G4String>::iterator it;
00117       G4cout << "HP Inelastic data are not available for thess  elements "<< G4endl;
00118       for ( it = unavailable_elements.begin() ; it != unavailable_elements.end() ; it++ )
00119          G4cout << *it << G4endl;
00120       G4cout << "Low Energy Parameterization Models will be used."<< G4endl;
00121    }
00122 
00123    createXSectionDataSet();
00124 }

G4NeutronHPorLEInelastic::~G4NeutronHPorLEInelastic (  ) 

Definition at line 126 of file G4NeutronHPorLEInelastic.cc.

00127 {
00128    delete [] theInelastic;
00129    delete theDataSet; 
00130 }


Member Function Documentation

G4HadFinalState * G4NeutronHPorLEInelastic::ApplyYourself ( const G4HadProjectile aTrack,
G4Nucleus aTargetNucleus 
) [virtual]

Implements G4HadronicInteraction.

Definition at line 134 of file G4NeutronHPorLEInelastic.cc.

References G4NeutronHPChannelList::ApplyYourself(), G4UniformRand, G4Material::GetElement(), G4Element::GetIndex(), G4HadProjectile::GetMaterial(), G4Material::GetNumberOfElements(), G4Material::GetTemperature(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4Material::GetVecNbOfAtomsPerVolume(), G4NeutronHPChannelList::GetXsec(), and CLHEP::detail::n.

Referenced by G4NeutronHPorLEInelasticModel::ApplyYourself().

00135 {
00136    G4int it=0;
00137    const G4Material * theMaterial = aTrack.GetMaterial();
00138    G4int n = theMaterial->GetNumberOfElements();
00139    G4int index = theMaterial->GetElement(0)->GetIndex();
00140    if(n!=1)
00141    {
00142       G4int i;
00143       xSec = new G4double[n];
00144       G4double sum=0;
00145       const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume();
00146       G4double rWeight;    
00147       G4NeutronHPThermalBoost aThermalE;
00148       for (i=0; i<n; i++)
00149       {
00150         index = theMaterial->GetElement(i)->GetIndex();
00151         rWeight = NumAtomsPerVolume[i];
00152         G4double x = aThermalE.GetThermalEnergy(aTrack, theMaterial->GetElement(i), theMaterial->GetTemperature());
00153 
00154         //xSec[i] = theInelastic[index].GetXsec(aThermalE.GetThermalEnergy(aTrack,
00155         //                                                                   theMaterial->GetElement(i),
00156         //                                                                   theMaterial->GetTemperature()));
00157         xSec[i] = theInelastic[index].GetXsec(x);
00158 
00159         xSec[i] *= rWeight;
00160         sum+=xSec[i];
00161       }
00162       G4double random = G4UniformRand();
00163       G4double running = 0;
00164       for (i=0; i<n; i++)
00165       {
00166         running += xSec[i];
00167         index = theMaterial->GetElement(i)->GetIndex();
00168         it = i;
00169         if(random<=running/sum) break;
00170       }
00171       delete [] xSec;
00172       // it is element-wise initialised.
00173     }
00174     //return theInelastic[index].ApplyYourself(aTrack); 
00175    return theInelastic[index].ApplyYourself( theMaterial->GetElement(it) , aTrack ); 
00176 }

const std::pair< G4double, G4double > G4NeutronHPorLEInelastic::GetFatalEnergyCheckLevels (  )  const [virtual]

Reimplemented from G4HadronicInteraction.

Definition at line 194 of file G4NeutronHPorLEInelastic.cc.

References DBL_MAX.

00195 {
00196    //return std::pair<G4double, G4double>(10*perCent,10*GeV);
00197    return std::pair<G4double, G4double>(10*perCent,DBL_MAX);
00198 }

G4VCrossSectionDataSet* G4NeutronHPorLEInelastic::GiveXSectionDataSet (  )  [inline]

Definition at line 158 of file G4NeutronHPorLEInelastic.hh.

Referenced by G4NeutronHPorLEInelasticModel::GiveHPXSectionDataSet().

00158 { return theDataSet; }; 

G4bool G4NeutronHPorLEInelastic::IsThisElementOK ( G4String   ) 

Definition at line 180 of file G4NeutronHPorLEInelastic.cc.

References FALSE, and TRUE.

Referenced by G4NeutronHPorLEInelasticModel::ApplyYourself().

00181 {
00182    if ( unavailable_elements.find( name ) == unavailable_elements.end() ) 
00183       return TRUE;
00184    else 
00185       return FALSE; 
00186 }


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