Logo ROOT   master
Reference Guide
RooAddition.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAddition.h,v 1.3 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_ADDITION
17 #define ROO_ADDITION
18 
19 #include "RooAbsReal.h"
20 #include "RooListProxy.h"
21 #include "RooObjCacheManager.h"
22 
23 class RooRealVar;
24 class RooArgList ;
25 
26 class RooAddition : public RooAbsReal {
27 public:
28 
29  RooAddition() ;
30  RooAddition(const char *name, const char *title, const RooArgList& sumSet, Bool_t takeOwnerShip=kFALSE) ;
31  RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2, Bool_t takeOwnerShip=kFALSE) ;
32  virtual ~RooAddition() ;
33 
34  RooAddition(const RooAddition& other, const char* name = 0);
35  virtual TObject* clone(const char* newname) const { return new RooAddition(*this, newname); }
36 
37  virtual Double_t defaultErrorLevel() const ;
38 
39  void printMetaArgs(std::ostream& os) const ;
40 
41  const RooArgList& list1() const { return _set ; }
42  const RooArgList& list() const { return _set ; }
43 
44  virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
45  // Force RooRealIntegral to offer all observables for internal integration
46  return kTRUE ;
47  }
48  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=0) const;
49  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
50 
51  Bool_t setData(RooAbsData& data, Bool_t cloneData=kTRUE) ;
52 
53  virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
54  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
55  Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
56 
57  virtual void enableOffsetting(Bool_t) ;
58 
59 protected:
60 
61  RooArgList _ownedList ; // List of owned components
62  RooListProxy _set ; // set of terms to be summed
63 
64  class CacheElem : public RooAbsCacheElement {
65  public:
66  virtual ~CacheElem();
67  // Payload
70  };
71  mutable RooObjCacheManager _cacheMgr ; // The cache manager
72 
73  Double_t evaluate() const;
74 
75  ClassDef(RooAddition,2) // Sum of RooAbsReal objects
76 };
77 
78 #endif
void printMetaArgs(std::ostream &os) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooAddition.h:44
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate integral cache.
RooAddition()
Empty constructor.
Definition: RooAddition.cxx:52
virtual TObject * clone(const char *newname) const
Definition: RooAddition.h:35
#define ClassDef(name, id)
Definition: Rtypes.h:322
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Double_t evaluate() const
Calculate and return current value of self.
RooArgList _ownedList
Definition: RooAddition.h:61
Bool_t setData(RooAbsData &data, Bool_t cloneData=kTRUE)
RooListProxy _set
Definition: RooAddition.h:62
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:35
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported...
RooObjCacheManager _cacheMgr
Definition: RooAddition.h:71
virtual void enableOffsetting(Bool_t)
Bool_t isBinnedDistribution(const RooArgSet &obs) const
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:44
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
const Bool_t kFALSE
Definition: RtypesCore.h:90
virtual Double_t defaultErrorLevel() const
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
double Double_t
Definition: RtypesCore.h:57
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...
const RooArgList & list() const
Definition: RooAddition.h:42
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...
virtual ~RooAddition()
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
const RooArgList & list1() const
Definition: RooAddition.h:41
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets...
Definition: RooAddition.h:26
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
const Bool_t kTRUE
Definition: RtypesCore.h:89
char name[80]
Definition: TGX11.cxx:109