Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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
68  RooArgList _I ;
69  virtual RooArgList containedArgs(Action) ;
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