ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_ABS_MOMENT
#define ROO_ABS_MOMENT

#include "RooAbsReal.h"
#include "RooRealProxy.h"
#include "RooSetProxy.h"


class RooRealVar;
class RooArgList ;

class RooAbsMoment : public RooAbsReal {
public:

  RooAbsMoment() ;
  RooAbsMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, Bool_t takeRoot=kFALSE) ;
  RooAbsMoment(const RooAbsMoment& other, const char* name = 0);
  virtual ~RooAbsMoment() ;

  Int_t order() const { return _order ; }
  Bool_t central() const { return _mean.absArg() ? kTRUE : kFALSE ; }
  RooAbsReal* mean() { return (RooAbsReal*) _mean.absArg() ; }


protected:

  Int_t _order ;                         // Moment order
  Int_t _takeRoot ;                      // Return n-order root of moment
  RooSetProxy  _nset ;                   // Normalization set (optional)
  RooRealProxy _func ;                   // Input function
  RooRealProxy _x     ;                  // Observable
  RooRealProxy _mean ;                   // Mean (if calculated for central moment)

  ClassDef(RooAbsMoment,1) // Abstract representation of moment in a RooAbsReal in a given RooRealVar
};

#endif
 RooAbsMoment.h:1
 RooAbsMoment.h:2
 RooAbsMoment.h:3
 RooAbsMoment.h:4
 RooAbsMoment.h:5
 RooAbsMoment.h:6
 RooAbsMoment.h:7
 RooAbsMoment.h:8
 RooAbsMoment.h:9
 RooAbsMoment.h:10
 RooAbsMoment.h:11
 RooAbsMoment.h:12
 RooAbsMoment.h:13
 RooAbsMoment.h:14
 RooAbsMoment.h:15
 RooAbsMoment.h:16
 RooAbsMoment.h:17
 RooAbsMoment.h:18
 RooAbsMoment.h:19
 RooAbsMoment.h:20
 RooAbsMoment.h:21
 RooAbsMoment.h:22
 RooAbsMoment.h:23
 RooAbsMoment.h:24
 RooAbsMoment.h:25
 RooAbsMoment.h:26
 RooAbsMoment.h:27
 RooAbsMoment.h:28
 RooAbsMoment.h:29
 RooAbsMoment.h:30
 RooAbsMoment.h:31
 RooAbsMoment.h:32
 RooAbsMoment.h:33
 RooAbsMoment.h:34
 RooAbsMoment.h:35
 RooAbsMoment.h:36
 RooAbsMoment.h:37
 RooAbsMoment.h:38
 RooAbsMoment.h:39
 RooAbsMoment.h:40
 RooAbsMoment.h:41
 RooAbsMoment.h:42
 RooAbsMoment.h:43
 RooAbsMoment.h:44
 RooAbsMoment.h:45
 RooAbsMoment.h:46
 RooAbsMoment.h:47
 RooAbsMoment.h:48
 RooAbsMoment.h:49
 RooAbsMoment.h:50
 RooAbsMoment.h:51
 RooAbsMoment.h:52