37 #define TF_COMPLETENESSBINS_CC_VERSION \ 38 "TF_COMPLETENESSBINS_CC V1.0 " 40 #include <tfxx/error.h> 45 const libtime::TAbsoluteTime& latest,
46 const libtime::TRelativeTime& binsize)
77 TFXX_assert((i>=0) && (i<this->
nbins()),
"illegal bin index");
78 libtime::TAbsoluteTime retval=this->
firstbin();
95 const unsigned int& i)
const 97 libtime::TAbsoluteTime thisbin=this->
bin(i);
99 return((d>=thisbin) && (d<
nextbin));
108 "date is out of range");
109 unsigned int retval=0;
110 while ((retval<
Mnbins) && !this->
isinbin(d, retval)) { ++retval; }
118 const libtime::TRelativeTime dt)
const 125 else if ((i+1)==this->
nbins())
129 unsigned int nsamples=
binsize/dt;
130 nsamples = nsamples > 0 ? nsamples : 1;
142 unsigned int nsamples=
binsize/dt;
143 nsamples = nsamples > 0 ? nsamples : 1;
libtime::TAbsoluteTime firstbin() const
libtime::TAbsoluteTime Mearliest
libtime::TAbsoluteTime earliest() const
unsigned int nbins() const
class to define completenessbins (prototypes)
libtime::TRelativeTime Mbinsize
CompletenessBins(const libtime::TAbsoluteTime &earliest, const libtime::TAbsoluteTime &latest, const libtime::TRelativeTime &binsize)
constructor
libtime::TAbsoluteTime bin(const unsigned int &i) const
beginnig of bin (according to bin raster)
libtime::TAbsoluteTime Mlatest
bool isinbin(const libtime::TAbsoluteTime &d, const unsigned int &i) const
libtime::TAbsoluteTime latest() const
libtime::TAbsoluteTime Mfirstbin
unsigned int samplesinbin(const libtime::TRelativeTime dt) const
number of samples to be expected in a bin
libtime::TRelativeTime binsize() const
libtime::TAbsoluteTime nextbin(const unsigned int &i) const
start of bin (will be earliest for fisrt bin)