Logo ROOT  
Reference Guide
RooRealSumFunc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooRealSumFunc.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
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_REAL_SUM_FUNC
17#define ROO_REAL_SUM_FUNC
18
19#include "RooAbsPdf.h"
20#include "RooListProxy.h"
21#include "RooAICRegistry.h"
22#include "RooObjCacheManager.h"
23
24class RooRealSumFunc : public RooAbsReal {
25public:
27 RooRealSumFunc(const char *name, const char *title);
28 RooRealSumFunc(const char *name, const char *title, const RooArgList &funcList, const RooArgList &coefList);
29 RooRealSumFunc(const char *name, const char *title, RooAbsReal &func1, RooAbsReal &func2, RooAbsReal &coef1);
30 RooRealSumFunc(const RooRealSumFunc &other, const char *name = 0);
31 virtual TObject *clone(const char *newname) const { return new RooRealSumFunc(*this, newname); }
32 virtual ~RooRealSumFunc();
33
34 Double_t evaluate() const;
35 virtual Bool_t checkObservables(const RooArgSet *nset) const;
36
37 virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const { return arg.isFundamental(); }
38 Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet,
39 const char *rangeName = 0) const;
40 Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName = 0) const;
41
42 const RooArgList &funcList() const { return _funcList; }
43 const RooArgList &coefList() const { return _coefList; }
44
45 void printMetaArgs(std::ostream &os) const;
46
47 virtual std::list<Double_t> *binBoundaries(RooAbsRealLValue & /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const;
48 virtual std::list<Double_t> *plotSamplingHint(RooAbsRealLValue & /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const;
49 Bool_t isBinnedDistribution(const RooArgSet &obs) const;
50
51 void setFloor(Bool_t flag) { _doFloor = flag; }
52 Bool_t getFloor() const { return _doFloor; }
53 static void setFloorGlobal(Bool_t flag) { _doFloorGlobal = flag; }
55
56 virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised; };
57 virtual void setCacheAndTrackHints(RooArgSet &);
58
59protected:
61 public:
63 virtual ~CacheElem(){};
65 {
67 ret.add(_funcNormList);
68 return ret;
69 }
72 };
73 mutable RooObjCacheManager _normIntMgr; // The integration cache manager
74
76
77 RooListProxy _funcList; // List of component FUNCs
78 RooListProxy _coefList; // List of coefficients
79 TIterator *_funcIter; //! Iterator over FUNC list
80 TIterator *_coefIter; //! Iterator over coefficient list
81
82 Bool_t _doFloor; // Introduce floor at zero in pdf
83 static Bool_t _doFloorGlobal; // Global flag for introducing floor at zero in pdf
84
85private:
86 ClassDef(RooRealSumFunc, 3) // PDF constructed from a sum of (non-pdf) functions
87};
88
89#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:71
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:207
@ NotAdvised
Definition: RooAbsArg.h:370
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
virtual RooArgList containedArgs(Action)
const RooArgList & coefList() const
virtual TObject * clone(const char *newname) const
TIterator * _funcIter
virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const
void setFloor(Bool_t flag)
Bool_t _doFloor
Iterator over coefficient list.
TIterator * _coefIter
Iterator over FUNC list.
Bool_t _haveLastCoef
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
static Bool_t _doFloorGlobal
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
const RooArgList & funcList() const
RooListProxy _funcList
RooObjCacheManager _normIntMgr
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
virtual CacheMode canNodeBeCached() const
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual ~RooRealSumFunc()
RooListProxy _coefList
virtual void setCacheAndTrackHints(RooArgSet &)
static void setFloorGlobal(Bool_t flag)
Bool_t getFloor() const
static Bool_t getFloorGlobal()
void printMetaArgs(std::ostream &os) const
Iterator abstract base class.
Definition: TIterator.h:30
Mother of all ROOT objects.
Definition: TObject.h:37