#include <G4NeutronInelasticXS.hh>
Inheritance diagram for G4NeutronInelasticXS:
Public Member Functions | |
G4NeutronInelasticXS () | |
virtual | ~G4NeutronInelasticXS () |
virtual G4bool | IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *) |
virtual G4bool | IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) |
virtual G4double | GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0) |
virtual void | BuildPhysicsTable (const G4ParticleDefinition &) |
virtual void | CrossSectionDescription (std::ostream &) const |
Definition at line 59 of file G4NeutronInelasticXS.hh.
G4NeutronInelasticXS::G4NeutronInelasticXS | ( | ) |
Definition at line 60 of file G4NeutronInelasticXS.cc.
References G4cout, G4endl, and G4VCrossSectionDataSet::verboseLevel.
00061 : G4VCrossSectionDataSet("G4NeutronInelasticXS"), 00062 proton(G4Proton::Proton()), maxZ(92) 00063 { 00064 // verboseLevel = 0; 00065 if(verboseLevel > 0){ 00066 G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < " 00067 << maxZ + 1 << G4endl; 00068 } 00069 data.resize(maxZ+1, 0); 00070 coeff.resize(maxZ+1, 1.0); 00071 ggXsection = new G4GlauberGribovCrossSection(); 00072 fNucleon = new G4HadronNucleonXsc(); 00073 isInitialized = false; 00074 }
G4NeutronInelasticXS::~G4NeutronInelasticXS | ( | ) | [virtual] |
Definition at line 76 of file G4NeutronInelasticXS.cc.
00077 { 00078 delete fNucleon; 00079 for(G4int i=0; i<=maxZ; ++i) { 00080 delete data[i]; 00081 } 00082 }
void G4NeutronInelasticXS::BuildPhysicsTable | ( | const G4ParticleDefinition & | ) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 229 of file G4NeutronInelasticXS.cc.
References G4cout, G4endl, G4Element::GetElementTable(), G4Element::GetNumberOfElements(), G4ParticleDefinition::GetParticleName(), G4Neutron::Neutron(), and G4VCrossSectionDataSet::verboseLevel.
00230 { 00231 if(isInitialized) { return; } 00232 if(verboseLevel > 0){ 00233 G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for " 00234 << p.GetParticleName() << G4endl; 00235 } 00236 if(p.GetParticleName() != "neutron") { 00237 throw G4HadronicException(__FILE__, __LINE__,"Wrong particle type"); 00238 return; 00239 } 00240 isInitialized = true; 00241 00242 // check environment variable 00243 // Build the complete string identifying the file with the data set 00244 char* path = getenv("G4NEUTRONXSDATA"); 00245 if (!path){ 00246 throw G4HadronicException(__FILE__, __LINE__, 00247 "G4NEUTRONXSDATA environment variable not defined"); 00248 return; 00249 } 00250 00251 G4DynamicParticle* dynParticle = 00252 new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1); 00253 00254 // Access to elements 00255 const G4ElementTable* theElmTable = G4Element::GetElementTable(); 00256 size_t numOfElm = G4Element::GetNumberOfElements(); 00257 if(numOfElm > 0) { 00258 for(size_t i=0; i<numOfElm; ++i) { 00259 G4int Z = G4int(((*theElmTable)[i])->GetZ()); 00260 if(Z < 1) { Z = 1; } 00261 else if(Z > maxZ) { Z = maxZ; } 00262 //G4cout << "Z= " << Z << G4endl; 00263 // Initialisation 00264 if(!data[Z]) { Initialise(Z, dynParticle, path); } 00265 } 00266 } 00267 delete dynParticle; 00268 }
void G4NeutronInelasticXS::CrossSectionDescription | ( | std::ostream & | ) | const [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 84 of file G4NeutronInelasticXS.cc.
00085 { 00086 outFile << "G4NeutronInelasticXS calculates the neutron inelastic scattering\n" 00087 << "cross section on nuclei using data from the high precision\n" 00088 << "neutron database. These data are simplified and smoothed over\n" 00089 << "the resonance region in order to reduce CPU time.\n" 00090 << "G4NeutronInelasticXS is valid for energies up to 20 MeV, for\n" 00091 << "nuclei through U.\n"; 00092 }
G4double G4NeutronInelasticXS::GetElementCrossSection | ( | const G4DynamicParticle * | , | |
G4int | Z, | |||
const G4Material * | mat = 0 | |||
) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 110 of file G4NeutronInelasticXS.cc.
References G4PhysicsVector::Energy(), G4cout, G4endl, G4HadronNucleonXsc::GetHadronNucleonXscPDG(), G4GlauberGribovCrossSection::GetInelasticGlauberGribovXsc(), G4HadronNucleonXsc::GetInelasticHadronNucleonXsc(), G4GlauberGribovCrossSection::GetIsoCrossSection(), G4DynamicParticle::GetKineticEnergy(), G4PhysicsVector::GetVectorLength(), G4NistManager::Instance(), CLHEP::detail::n, G4PhysicsVector::Value(), and G4VCrossSectionDataSet::verboseLevel.
00112 { 00113 G4double xs = 0.0; 00114 G4double ekin = aParticle->GetKineticEnergy(); 00115 00116 if(Z < 1 || Z > maxZ) { return xs; } 00117 G4int Amean = G4int(G4NistManager::Instance()->GetAtomicMassAmu(Z)+0.5); 00118 G4PhysicsVector* pv = data[Z]; 00119 // G4cout << "G4NeutronInelasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl; 00120 00121 // element was not initialised 00122 if(!pv) { 00123 Initialise(Z); 00124 pv = data[Z]; 00125 if(!pv) { return xs; } 00126 } 00127 00128 G4double e1 = pv->Energy(0); 00129 if(ekin <= e1) { return xs; } 00130 00131 G4int n = pv->GetVectorLength() - 1; 00132 G4double e2 = pv->Energy(n); 00133 if(ekin <= e2) { 00134 xs = pv->Value(ekin); 00135 } else if(1 == Z) { 00136 fNucleon->GetHadronNucleonXscPDG(aParticle, proton); 00137 xs = coeff[1]*fNucleon->GetInelasticHadronNucleonXsc(); 00138 } else { 00139 ggXsection->GetIsoCrossSection(aParticle, Z, Amean); 00140 xs = coeff[Z]*ggXsection->GetInelasticGlauberGribovXsc(); 00141 } 00142 00143 if(verboseLevel > 0) { 00144 G4cout << "ekin= " << ekin << ", XSinel= " << xs << G4endl; 00145 } 00146 return xs; 00147 }
G4bool G4NeutronInelasticXS::IsElementApplicable | ( | const G4DynamicParticle * | , | |
G4int | Z, | |||
const G4Material * | ||||
) | [virtual] |
G4bool G4NeutronInelasticXS::IsIsoApplicable | ( | const G4DynamicParticle * | , | |
G4int | Z, | |||
G4int | A, | |||
const G4Element * | , | |||
const G4Material * | ||||
) | [virtual] |