#include <G4NeutronHPArbitaryTab.hh>
Definition at line 43 of file G4NeutronHPArbitaryTab.hh.
G4NeutronHPArbitaryTab::G4NeutronHPArbitaryTab |
( |
| ) |
|
|
inline |
G4NeutronHPArbitaryTab::~G4NeutronHPArbitaryTab |
( |
| ) |
|
|
inline |
void G4NeutronHPArbitaryTab::Init |
( |
std::istream & |
theData | ) |
|
|
inlinevirtual |
Implements G4VNeutronHPEDis.
Definition at line 55 of file G4NeutronHPArbitaryTab.hh.
References G4NeutronHPVector::GetEnergy(), G4NeutronHPVector::GetVectorLength(), G4InterpolationManager::Init(), G4NeutronHPVector::Init(), and G4NeutronHPVector::SetLabel().
58 theFractionalProb.
Init(theData, CLHEP::eV);
61 theManager.
Init(theData);
63 for(i=0; i<nDistFunc; i++)
65 theData >> currentEnergy;
66 theDistFunc[i].
SetLabel(currentEnergy*CLHEP::eV);
67 theDistFunc[i].
Init(theData, CLHEP::eV);
78 for(i=0; i<nDistFunc; i++){
80 theLowThreshold[i]=theDistFunc[i].
GetEnergy(0);
81 theHighThreshold[i]=theDistFunc[i].
GetEnergy(np-1);
82 for(
G4int j=0;j<np-1;j++){
83 if(theDistFunc[i].GetXsec(j+1)>1.e-20){
84 theLowThreshold[i]=theDistFunc[i].
GetEnergy(j);
88 for(
G4int j=1;j<np;j++){
89 if(theDistFunc[i].GetXsec(j-1)>1.e-20){
90 theHighThreshold[i]=theDistFunc[i].
GetEnergy(j);
G4double GetEnergy(G4int i) const
void SetLabel(G4double aLabel)
G4int GetVectorLength() const
void Init(G4int aScheme, G4int aRange)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
Implements G4VNeutronHPEDis.
Definition at line 33 of file G4NeutronHPArbitaryTab.cc.
References G4cerr, G4endl, G4UniformRand, G4NeutronHPVector::GetLabel(), and G4NeutronHPVector::Sample().
36 for(i=0;i<nDistFunc;i++)
38 if(anEnergy<theDistFunc[i].GetLabel())
break;
40 G4int low(0), high(0);
50 G4cerr <<
"No distribution functions to sample "
51 <<
"from in G4NeutronHPArbitaryTab::Sample"<<
G4endl;
56 return theDistFunc[0].
Sample();
75 G4double rval=(anEnergy-elow)/(ehigh-elow);
76 G4double eoutlow=theLowThreshold[low]+rval*(theLowThreshold[high]-theLowThreshold[low]);
77 G4double eouthigh=theHighThreshold[low]+rval*(theHighThreshold[high]-theHighThreshold[low]);
81 Eout_1=theDistFunc[low].
Sample();
82 Eout_2=eoutlow+(Eout_1-theLowThreshold[low])*(eouthigh-eoutlow)/(theHighThreshold[low]-theLowThreshold[low]);
85 Eout_1=theDistFunc[high].
Sample();
86 Eout_2=eoutlow+(Eout_1-theLowThreshold[high])*(eouthigh-eoutlow)/(theHighThreshold[high]-theLowThreshold[high]);
G4GLOB_DLL std::ostream G4cerr
The documentation for this class was generated from the following files: