Logo ROOT   master
Reference Guide
RooMoment.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_MOMENT
17 #define ROO_MOMENT
18 
19 #include "RooAbsMoment.h"
20 #include "RooRealProxy.h"
21 #include "RooSetProxy.h"
22 
23 
24 class RooRealVar;
25 class RooArgList ;
26 
27 class RooMoment : public RooAbsMoment {
28 public:
29 
30  RooMoment() ;
31  RooMoment(const char *name, const char *title, RooAbsReal& func, RooRealVar& x, Int_t order=1, Bool_t central=kFALSE, Bool_t takeRoot=kFALSE) ;
32  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,
33  Bool_t intNSet=kFALSE) ;
34  virtual ~RooMoment() ;
35 
36  RooMoment(const RooMoment& other, const char* name = 0);
37  virtual TObject* clone(const char* newname) const { return new RooMoment(*this, newname); }
38 
39  const RooAbsReal& xF() { return _xf.arg() ; }
40  const RooAbsReal& ixF() { return _ixf.arg() ; }
41  const RooAbsReal& iF() { return _if.arg() ; }
42 
43 protected:
44 
45  RooRealProxy _xf ; // X*F
46  RooRealProxy _ixf ; // Int(X*F(X))dx ;
47  RooRealProxy _if ; // Int(F(x))dx ;
48  Double_t evaluate() const;
49 
50  ClassDef(RooMoment,1) // Representation of moment in a RooAbsReal in a given RooRealVar
51 };
52 
53 #endif
RooRealProxy _ixf
Definition: RooMoment.h:46
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooAbsMoment represents the first, second, or third order derivative of any RooAbsReal as calculated ...
Definition: RooAbsMoment.h:27
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:322
RooRealProxy _if
Definition: RooMoment.h:47
Bool_t central() const
Definition: RooAbsMoment.h:36
RooMoment()
Default constructor.
Definition: RooMoment.cxx:57
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:35
RooRealProxy _xf
Definition: RooMoment.h:45
const T & arg() const
Return reference to object held in proxy.
const RooAbsReal & ixF()
Definition: RooMoment.h:40
virtual ~RooMoment()
Destructor.
Definition: RooMoment.cxx:169
virtual TObject * clone(const char *newname) const
Definition: RooMoment.h:37
const Bool_t kFALSE
Definition: RtypesCore.h:90
Double_t evaluate() const
Calculate value.
Definition: RooMoment.cxx:178
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
RooMoment represents the first, second, or third order derivative of any RooAbsReal as calculated (nu...
Definition: RooMoment.h:27
const RooAbsReal & xF()
Definition: RooMoment.h:39
Mother of all ROOT objects.
Definition: TObject.h:37
const RooAbsReal & iF()
Definition: RooMoment.h:41
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
Int_t order() const
Definition: RooAbsMoment.h:35
char name[80]
Definition: TGX11.cxx:109