1 #ifndef StDetectorDbInterpolator_h
2 #define StDetectorDbInterpolator_h
25 unsigned int mNumEntries;
33 mNumEntries = numEntries;
47 if(time >= mTimes[mNumEntries-1])
48 return mArray[mNumEntries-1];
50 while(mTimes[i] < time && i < mNumEntries)
52 double relTime = (time - mTimes[i-1]);
53 double denominator = (mTimes[i]-mTimes[i-1]);
58 return (relTime/denominator)*(mArray[i]-mArray[i-1])+mArray[i-1];
73 if(time >= mTimes[mNumEntries-1])
74 return mArray[mNumEntries-1];
79 while(mTimes[i] < time && i < mNumEntries){
StDetectorDbInterpolator(unsigned int numEntries, unsigned int *times, T *array)
Constructor for time interpolator.
T interpolate(unsigned int time)
Interpolates value based on timestamp.
T getLowerValue(unsigned int time)