Logo ROOT   master
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 
24 class RooRealSumFunc : public RooAbsReal {
25 public:
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; }
54  static Bool_t getFloorGlobal() { return _doFloorGlobal; }
55 
56  virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised; };
57  virtual void setCacheAndTrackHints(RooArgSet &);
58 
59 protected:
60  class CacheElem : public RooAbsCacheElement {
61  public:
62  CacheElem(){};
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 
85 private:
86  ClassDef(RooRealSumFunc, 3) // PDF constructed from a sum of (non-pdf) functions
87 };
88 
89 #endif
void setFloor(Bool_t flag)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
void printMetaArgs(std::ostream &os) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
const RooArgList & coefList() const
Bool_t _doFloor
Iterator over coefficient list.
static Bool_t getFloorGlobal()
const RooArgList & funcList() const
virtual ~RooRealSumFunc()
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Iterator abstract base class.
Definition: TIterator.h:30
virtual RooArgList containedArgs(Action)
#define ClassDef(name, id)
Definition: Rtypes.h:322
RooListProxy _coefList
Bool_t getFloor() const
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables...
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:243
static void setFloorGlobal(Bool_t flag)
virtual TObject * clone(const char *newname) const
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual void setCacheAndTrackHints(RooArgSet &)
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
virtual CacheMode canNodeBeCached() const
TIterator * _coefIter
Iterator over FUNC list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooListProxy _funcList
virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const
Mother of all ROOT objects.
Definition: TObject.h:37
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
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
RooObjCacheManager _normIntMgr
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
Bool_t _haveLastCoef
static Bool_t _doFloorGlobal
TIterator * _funcIter
char name[80]
Definition: TGX11.cxx:109