RooMoment.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooMoment.h 30333 2009-09-21 15:39:17Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
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 ;                         // Moment order
00051   Int_t _takeRoot ;                      // Return n-order root of moment
00052   RooSetProxy  _nset ;                   // Normalization set (optional)
00053   RooRealProxy _func ;                   // Input function
00054   RooRealProxy _x     ;                  // Observable
00055   RooRealProxy _mean ;                   // Mean (if calculated for central moment)
00056 
00057   RooRealProxy _xf ;                     // X*F 
00058   RooRealProxy _ixf ;                    // Int(X*F(X))dx ;
00059   RooRealProxy _if ;                     // Int(F(x))dx ;
00060   Double_t evaluate() const;
00061 
00062   ClassDef(RooMoment,1) // Representation of moment in a RooAbsReal in a given RooRealVar
00063 };
00064 
00065 #endif

Generated on Tue Jul 5 14:26:14 2011 for ROOT_528-00b_version by  doxygen 1.5.1