// neutron_hp -- source file // J.P. Wellisch, Nov-1996 // A prototype of the low energy neutron transport model. // #include "G4NeutronHPPartial.hh" #include "G4NeutronHPInterpolator.hh" #include "Randomize.hh" G4NeutronHPVector * G4NeutronHPPartial::GetY(G4double e1) { G4NeutronHPVector * aBuffer = new G4NeutronHPVector(); G4int i; if(nData==1) { for(i=0; iSetInterpolationManager(data[0].GetInterpolationManager()); aBuffer->SetData(i , data[0].GetX(i), data[0].GetY(i)); } return aBuffer; } for (i=0; ie1) break; } if(i==nData) i--; G4double x1,x2,y1,y2,y, off, slope; G4int i1=0, ib=0; G4double E1 = X[i-1]; G4double E2 = X[i]; for(G4int ii=0; iiSetData(ib, x1, y); aBuffer->SetScheme(ib++, data[i-1].GetScheme(i1)); i1++; if(x2-x1>0.001*x1) { ii--; } } else { y1 = data[i-1].GetY(x2); y2 = data[i].GetY(ii); if(E2-E1!=0) { y = theInt.Interpolate(theManager.GetScheme(i), e1, E1, E2, y1, y2); } else { y = 0.5*(y1+y2); } aBuffer->SetData(ib, x2, y); aBuffer->SetScheme(ib++, data[i].GetScheme(ii)); if(x1-x2<0.001*x2) i1++; } } return aBuffer; } G4double G4NeutronHPPartial::Sample(G4double x) { G4double result=0; G4int i; for (i=0; i