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]);
G4DLLIMPORT std::ostream G4cerr
G4double Sample(G4double anEnergy)