#include #include "NdbDefs.h" #include "NdbEndfIO.h" #include "NdbMTReactionXS.h" ClassImp(NdbMTReactionXS); /* -------- LoadENDF -------- */ Bool_t NdbMTReactionXS::LoadENDF( char *filename ) { NdbEndfIO endf(filename,TENDF_READ); Bool_t error; if (!endf.IsOpen()) return kTRUE; minxs = MAX_REAL; maxxs = -MAX_REAL; endf.FindMFMT(3,MT()); // Find total cross section endf.ReadReal(&error); // ?? endf.ReadReal(&error); endf.ReadLine(); QM = endf.ReadReal(&error); QI = endf.ReadReal(&error); endf.ReadInt(&error); // Skip number LR = endf.ReadInt(&error); if (error) return error; NR = endf.ReadInt(&error); if (error) return error; NP = endf.ReadInt(&error); if (error) return error; endf.ReadLine(); // Skip line IT = endf.ReadInt(&error,2); // Interpolation type endf.ReadLine(); // Skip line ene.Set(NP); xs.Set(NP); for (int i=0; i ene[high]) return NOTFOUND; while (1) { mid = (low+high)/2; if (mid==low) return mid; if (e > ene[mid]) low = mid; else if (e < ene[mid]) high = mid; else return mid; } } // BinSearch /* -------- Interpolate -------- */ Float_t NdbMTReactionXS::Interpolate( Float_t e ) { Int_t p = BinSearch(e); if (p==NOTFOUND) return xs[ e