#include <G4ParticleHPArbitaryTab.hh>
Definition at line 45 of file G4ParticleHPArbitaryTab.hh.
G4ParticleHPArbitaryTab::G4ParticleHPArbitaryTab |
( |
| ) |
|
|
inline |
G4ParticleHPArbitaryTab::~G4ParticleHPArbitaryTab |
( |
| ) |
|
|
inline |
void G4ParticleHPArbitaryTab::Init |
( |
std::istream & |
theData | ) |
|
|
inlinevirtual |
Implements G4VParticleHPEDis.
Definition at line 58 of file G4ParticleHPArbitaryTab.hh.
64 theManager.
Init(theData);
66 for(i=0; i<nDistFunc; i++)
68 theData >> currentEnergy;
70 theDistFunc[i].
Init(theData, CLHEP::eV);
82 for(i=0; i<nDistFunc; i++){
84 theLowThreshold[i]=theDistFunc[i].
GetEnergy(0);
85 theHighThreshold[i]=theDistFunc[i].
GetEnergy(np-1);
86 for(
G4int j=0;j<np-1;j++){
87 if(theDistFunc[i].GetXsec(j+1)>1.e-20){
88 theLowThreshold[i]=theDistFunc[i].
GetEnergy(j);
92 for(
G4int j=1;j<np;j++){
93 if(theDistFunc[i].GetXsec(j-1)>1.e-20){
94 theHighThreshold[i]=theDistFunc[i].
GetEnergy(j);
G4double GetEnergy(G4int i) const
G4int GetVectorLength() const
void Init(G4int aScheme, G4int aRange)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
void IntegrateAndNormalise()
static constexpr double eV
void SetLabel(G4double aLabel)
Implements G4VParticleHPEDis.
Definition at line 35 of file G4ParticleHPArbitaryTab.cc.
38 for(i=0;i<nDistFunc;i++)
40 if(anEnergy<theDistFunc[i].GetLabel())
break;
42 G4int low(0), high(0);
52 G4cerr <<
"No distribution functions to sample "
53 <<
"from in G4ParticleHPArbitaryTab::Sample"<<
G4endl;
58 return theDistFunc[0].
Sample();
77 G4double rval=(anEnergy-elow)/(ehigh-elow);
78 G4double eoutlow=theLowThreshold[low]+rval*(theLowThreshold[high]-theLowThreshold[low]);
79 G4double eouthigh=theHighThreshold[low]+rval*(theHighThreshold[high]-theHighThreshold[low]);
83 Eout_1=theDistFunc[low].
Sample();
84 Eout_2=eoutlow+(Eout_1-theLowThreshold[low])*(eouthigh-eoutlow)/(theHighThreshold[low]-theLowThreshold[low]);
87 Eout_1=theDistFunc[high].
Sample();
88 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: