00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_MOMENT
00017 #define ROO_MOMENT
00018
00019 #include "RooAbsReal.h"
00020 #include "RooRealProxy.h"
00021 #include "RooSetProxy.h"
00022
00023
00024 class RooRealVar;
00025 class RooArgList ;
00026
00027 class RooMoment : public RooAbsReal {
00028 public:
00029
00030 RooMoment() ;
00031 RooMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, Bool_t central=kFALSE, Bool_t takeRoot=kFALSE) ;
00032 RooMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Int_t order=1, Bool_t central=kFALSE, Bool_t takeRoot=kFALSE,
00033 Bool_t intNSet=kFALSE) ;
00034 virtual ~RooMoment() ;
00035
00036 RooMoment(const RooMoment& other, const char* name = 0);
00037 virtual TObject* clone(const char* newname) const { return new RooMoment(*this, newname); }
00038
00039 Int_t order() const { return _order ; }
00040 Bool_t central() const { return _mean.absArg() ? kTRUE : kFALSE ; }
00041
00042 RooAbsReal* mean() { return (RooAbsReal*) _mean.absArg() ; }
00043
00044 const RooAbsReal& xF() { return _xf.arg() ; }
00045 const RooAbsReal& ixF() { return _ixf.arg() ; }
00046 const RooAbsReal& iF() { return _if.arg() ; }
00047
00048 protected:
00049
00050 Int_t _order ;
00051 Int_t _takeRoot ;
00052 RooSetProxy _nset ;
00053 RooRealProxy _func ;
00054 RooRealProxy _x ;
00055 RooRealProxy _mean ;
00056
00057 RooRealProxy _xf ;
00058 RooRealProxy _ixf ;
00059 RooRealProxy _if ;
00060 Double_t evaluate() const;
00061
00062 ClassDef(RooMoment,1)
00063 };
00064
00065 #endif