#ifndef ROO_ERROR_VAR
#define ROO_ERROR_VAR
#include "Riosfwd.h"
#include <math.h>
#include <float.h>
#include "RooNumber.h"
#include "RooAbsReal.h"
#include "RooRealVar.h"
#include "RooRealProxy.h"
class RooVectorDataStore ;
class RooErrorVar : public RooAbsRealLValue {
public:
inline RooErrorVar() {
}
RooErrorVar(const char *name, const char *title, const RooRealVar& input) ;
RooErrorVar(const RooErrorVar& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooErrorVar(*this,newname); }
virtual ~RooErrorVar() ;
virtual Double_t getValV(const RooArgSet* set=0) const ;
virtual Double_t evaluate() const {
return ((RooRealVar&)_realVar.arg()).getError() ;
}
virtual void setVal(Double_t value) {
((RooRealVar&)_realVar.arg()).setVal(value) ;
}
inline virtual Bool_t isFundamental() const {
return kTRUE ;
}
virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
inline void setMin(Double_t value) {
setMin(0,value) ;
}
inline void setMax(Double_t value) {
setMax(0,value) ;
}
inline void setRange(Double_t min, Double_t max) {
setRange(0,min,max) ;
}
void setMin(const char* name, Double_t value) ;
void setMax(const char* name, Double_t value) ;
void setRange(const char* name, Double_t min, Double_t max) ;
void setBins(Int_t nBins) {
setBinning(RooUniformBinning(getMin(),getMax(),nBins)) ;
}
void setBinning(const RooAbsBinning& binning, const char* name=0) ;
const RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const ;
RooAbsBinning& getBinning(const char* name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) ;
Bool_t hasBinning(const char* name) const ;
std::list<std::string> getBinningNames() const ;
inline void removeMin(const char* name=0) {
getBinning(name).setMin(-RooNumber::infinity()) ;
}
inline void removeMax(const char* name=0) {
getBinning(name).setMax(RooNumber::infinity()) ;
}
inline void removeRange(const char* name=0) {
getBinning(name).setRange(-RooNumber::infinity(),RooNumber::infinity()) ;
}
using RooAbsRealLValue::operator= ;
using RooAbsRealLValue::setVal ;
protected:
RooLinkedList _altBinning ;
void syncCache(const RooArgSet* set=0) ;
RooRealProxy _realVar ;
RooAbsBinning* _binning ;
ClassDef(RooErrorVar,1)
};
#endif