88 if (
fMax -
fMin < 0)
Log() << kFATAL <<
"maximum lower than minimum" <<
Endl;
90 Log() << kFATAL <<
"nbins < 0" <<
Endl;
93 else if (nbins == 1) {
94 Log() << kFATAL <<
"interval has to have at least 2 bins if discrete" <<
Endl;
102 fNbins( other.fNbins )
122 Log() << kFATAL <<
"GetElement only defined for discrete value Intervals" <<
Endl;
125 else if (bin < 0 || bin >= fNbins) {
126 Log() << kFATAL <<
"bin " << bin <<
" out of range: interval *bins* count from 0 to " << fNbins-1 <<
Endl;
129 return fMin + ( (
Double_t(bin)/(fNbins-1)) *(fMax - fMin) );
138 Log() << kFATAL <<
"GetElement only defined for discrete value Intervals" <<
Endl;
141 Log() << kFATAL <<
"You asked for iBin=" << iBin
142 <<
" in interval .. and.. sorry, I cannot let this happen.."<<
Endl;
144 return (fMax-fMin)/(
Double_t)(fNbins-1);
152 return rnd.
Rndm()*(fMax - fMin) + fMin;
161 return (fMax + fMin)/2;
166 for (
Int_t i=0; i<GetNbins(); i++){
167 os <<
"| " << GetElement(i)<<
" |" ;
172 TTHREAD_TLS_DECL_ARG(
MsgLogger,logger,
"Interval");
The TMVA::Interval Class.
virtual Double_t GetRndm(TRandom3 &) const
get uniformly distributed number within interval
virtual void Print(std::ostream &os) const
virtual ~Interval()
destructor
Double_t fMax
the constraints of the Interval
virtual Double_t GetElement(Int_t position) const
calculates the value of the "number" bin in a discrete interval.
virtual Double_t GetStepSize(Int_t iBin=0) const
returns the step size between the numbers of a "discrete Interval"
virtual Double_t GetWidth() const
Interval(Double_t min, Double_t max, Int_t nbins=0)
defines minimum and maximum of an interval
virtual Double_t GetMean() const
ostringstream derivative to redirect and format output
Random number generator class based on M.
Double_t Rndm() override
Machine independent random number generator.
MsgLogger & Endl(MsgLogger &ml)