Logo ROOT  
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 #include <list>
23 
24 class RooRealVar;
25 class RooArgList ;
26 
27 class RooAddition : public RooAbsReal {
28 public:
29 
30  RooAddition() ;
31  RooAddition(const char *name, const char *title, const RooArgList& sumSet, Bool_t takeOwnerShip=kFALSE) ;
32  RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2, Bool_t takeOwnerShip=kFALSE) ;
33  virtual ~RooAddition() ;
34 
35  RooAddition(const RooAddition& other, const char* name = 0);
36  virtual TObject* clone(const char* newname) const { return new RooAddition(*this, newname); }
37 
38  virtual Double_t defaultErrorLevel() const ;
39 
40  void printMetaArgs(std::ostream& os) const ;
41 
42  const RooArgList& list1() const { return _set ; }
43  const RooArgList& list() const { return _set ; }
44 
45  virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
46  // Force RooRealIntegral to offer all observables for internal integration
47  return kTRUE ;
48  }
49  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=0) const;
50  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
51 
52  Bool_t setData(RooAbsData& data, Bool_t cloneData=kTRUE) ;
53 
54  virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
55  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
56  Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
57 
58  virtual void enableOffsetting(Bool_t) ;
59 
60 protected:
61 
62  RooArgList _ownedList ; // List of owned components
63  RooListProxy _set ; // set of terms to be summed
64 
65  class CacheElem : public RooAbsCacheElement {
66  public:
67  virtual ~CacheElem();
68  // Payload
71  };
72  mutable RooObjCacheManager _cacheMgr ; // The cache manager
73 
74  Double_t evaluate() const;
75 
76  ClassDef(RooAddition,2) // Sum of RooAbsReal objects
77 };
78 
79 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsReal.h
RooAddition::CacheElem
Definition: RooAddition.h:65
RooAbsData
Definition: RooAbsData.h:46
RooAddition::CacheElem::~CacheElem
virtual ~CacheElem()
Definition: RooAddition.cxx:445
RooArgList
Definition: RooArgList.h:21
RooAddition::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooAddition.h:45
RooAbsReal
Definition: RooAbsReal.h:61
RooAddition::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAddition.cxx:391
RooAddition::analyticalIntegral
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate integral cache.
Definition: RooAddition.cxx:299
RooAbsCacheElement
Definition: RooAbsCacheElement.h:26
RooAddition::RooAddition
RooAddition()
Empty constructor.
Definition: RooAddition.cxx:52
bool
RooAddition::CacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
Definition: RooAddition.cxx:439
RooAddition::clone
virtual TObject * clone(const char *newname) const
Definition: RooAddition.h:36
RooAddition::CacheElem::_I
RooArgList _I
Definition: RooAddition.h:69
RooAddition::_set
RooListProxy _set
Definition: RooAddition.h:63
RooAddition::evaluate
Double_t evaluate() const
Calculate and return current value of self.
Definition: RooAddition.cxx:164
RooAddition::_ownedList
RooArgList _ownedList
Definition: RooAddition.h:62
RooAddition::enableOffsetting
virtual void enableOffsetting(Bool_t)
Definition: RooAddition.cxx:233
RooAddition::setData
Bool_t setData(RooAbsData &data, Bool_t cloneData=kTRUE)
Definition: RooAddition.cxx:244
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAddition::getAnalyticalIntegral
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Definition: RooAddition.cxx:272
RooAddition
Definition: RooAddition.h:27
RooAddition::_cacheMgr
RooObjCacheManager _cacheMgr
Definition: RooAddition.h:72
RooAddition::defaultErrorLevel
virtual Double_t defaultErrorLevel() const
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
Definition: RooAddition.cxx:191
RooAddition::isBinnedDistribution
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Definition: RooAddition.cxx:371
RooListProxy
Definition: RooListProxy.h:24
RooObjCacheManager.h
RooListProxy.h
Double_t
double Double_t
Definition: RtypesCore.h:59
RooObjCacheManager
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
RooAddition::list
const RooArgList & list() const
Definition: RooAddition.h:43
RooAddition::~RooAddition
virtual ~RooAddition()
Definition: RooAddition.cxx:156
RooAddition::list1
const RooArgList & list1() const
Definition: RooAddition.h:42
RooAbsArg
Definition: RooAbsArg.h:73
RooRealVar
Definition: RooRealVar.h:36
RooAbsRealLValue
Definition: RooAbsRealLValue.h:31
RooAddition::binBoundaries
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAddition.cxx:327
RooArgSet
Definition: RooArgSet.h:28
int
RooAddition::printMetaArgs
void printMetaArgs(std::ostream &os) const
Definition: RooAddition.cxx:256