/*****************************************************************************
 * 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_FIRST_MOMENT
#define ROO_FIRST_MOMENT

#include "RooAbsMoment.h"
#include "RooRealProxy.h"
#include "RooSetProxy.h"


class RooRealVar;
class RooArgList ;

class RooFirstMoment : public RooAbsMoment {
public:

  RooFirstMoment() ;
  RooFirstMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x) ;
  RooFirstMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, const RooArgSet& nset, Bool_t intNSet=kFALSE) ;
  virtual ~RooFirstMoment() ;

  RooFirstMoment(const RooFirstMoment& other, const char* name = 0);
  virtual TObject* clone(const char* newname) const { return new RooFirstMoment(*this, newname); }

  const RooAbsReal& xF() { return _xf.arg() ; }
  const RooAbsReal& ixF() { return _ixf.arg() ; }
  const RooAbsReal& iF() { return _if.arg() ; }

protected:

  RooRealProxy _xf ;                     // X*F 
  RooRealProxy _ixf ;                    // Int(X*F(X))dx ;
  RooRealProxy _if ;                     // Int(F(x))dx ;
  Double_t evaluate() const;

  ClassDef(RooFirstMoment,1) // Representation of moment in a RooAbsReal in a given RooRealVar
};

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