Logo ROOT  
Reference Guide
RooProduct.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooProduct.h,v 1.5 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * GR, Gerhard Raven, VU Amsterdan, graven@nikhef.nl *
8  * *
9  * Copyright (c) 2000-2007, 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_PRODUCT
17 #define ROO_PRODUCT
18 
19 #include "RooAbsReal.h"
20 #include "RooListProxy.h"
21 #include "RooCacheManager.h"
22 #include "RooObjCacheManager.h"
23 
24 #include <list>
25 
26 class RooRealVar;
27 class RooArgList;
28 
29 
30 class RooProduct : public RooAbsReal {
31 public:
32 
33  RooProduct() ;
34  RooProduct(const char *name, const char *title, const RooArgList& _prodSet) ;
35 
36  RooProduct(const RooProduct& other, const char* name = 0);
37  virtual TObject* clone(const char* newname) const { return new RooProduct(*this, newname); }
38  virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
39  virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars,
40  const RooArgSet* normSet,
41  const char* rangeName=0) const ;
42  virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const;
43 
44 
45  RooArgList components() { RooArgList tmp(_compRSet) ; tmp.add(_compCSet) ; return tmp ; }
46 
47  virtual ~RooProduct() ;
48 
49  class ProdMap ;
50 
51  void printMetaArgs(std::ostream& os) const ;
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  virtual Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
56 
57  virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised ; } ;
58  virtual void setCacheAndTrackHints(RooArgSet&) ;
59 
60 protected:
61 
64 
65  class CacheElem : public RooAbsCacheElement {
66  public:
67  virtual ~CacheElem();
68  // Payload
72  };
73  mutable RooObjCacheManager _cacheMgr ; // The cache manager
74 
75 
76  Double_t calculate(const RooArgList& partIntList) const;
77  Double_t evaluate() const;
78  const char* makeFPName(const char *pfx,const RooArgSet& terms) const ;
79  ProdMap* groupProductTerms(const RooArgSet&) const;
80  Int_t getPartIntList(const RooArgSet* iset, const char *rangeName=0) const;
81 
82 
83 
84 
85  ClassDef(RooProduct,2) // Product of RooAbsReal and/or RooAbsCategory terms
86 };
87 
88 #endif
RooProduct::CacheElem::_ownedList
RooArgList _ownedList
Definition: RooProduct.h:70
RooCacheManager.h
RooAbsReal.h
RooProduct::CacheElem::~CacheElem
virtual ~CacheElem()
Destructor.
Definition: RooProduct.cxx:440
RooProduct::clone
virtual TObject * clone(const char *newname) const
Definition: RooProduct.h:37
RooProduct::canNodeBeCached
virtual CacheMode canNodeBeCached() const
Definition: RooProduct.h:57
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooProduct::_cacheMgr
RooObjCacheManager _cacheMgr
Definition: RooProduct.h:73
RooProduct::CacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
Definition: RooProduct.cxx:448
RooProduct::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate partial integral cache.
Definition: RooProduct.cxx:303
RooProduct::calculate
Double_t calculate(const RooArgList &partIntList) const
Calculate and return product of partial terms in partIntList.
Definition: RooProduct.cxx:324
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooProduct::getAnalyticalIntegralWN
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Declare that we handle all integrations internally.
Definition: RooProduct.cxx:284
RooAbsArg::CacheMode
CacheMode
Definition: RooAbsArg.h:387
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
RooProduct::_compRSet
RooListProxy _compRSet
Definition: RooProduct.h:62
bool
RooProduct::printMetaArgs
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
Definition: RooProduct.cxx:481
RooProduct
A RooProduct represents the product of a given set of RooAbsReal objects.
Definition: RooProduct.h:30
RooProduct::components
RooArgList components()
Definition: RooProduct.h:45
RooProduct::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs
Definition: RooProduct.cxx:421
RooProduct::setCacheAndTrackHints
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooProduct with cache-and-track.
Definition: RooProduct.cxx:460
RooProduct::binBoundaries
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs
Definition: RooProduct.cxx:385
RooProduct::getPartIntList
Int_t getPartIntList(const RooArgSet *iset, const char *rangeName=0) const
Return list of (partial) integrals whose product defines the integral of this RooProduct over the obs...
Definition: RooProduct.cxx:211
RooProduct::CacheElem
Definition: RooProduct.h:65
RooProduct::makeFPName
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
Definition: RooProduct.cxx:340
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooProduct::groupProductTerms
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
Definition: RooProduct.cxx:137
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooObjCacheManager.h
RooProduct::CacheElem::_prodList
RooArgList _prodList
Definition: RooProduct.h:69
RooListProxy.h
Double_t
double Double_t
Definition: RtypesCore.h:59
RooProduct::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
Force internal handling of integration of given observable if any of the product terms depend on it.
Definition: RooProduct.cxx:117
RooObjCacheManager
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooAbsArg::NotAdvised
@ NotAdvised
Definition: RooAbsArg.h:387
name
char name[80]
Definition: TGX11.cxx:110
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooProduct::evaluate
Double_t evaluate() const
Evaluate product of input functions.
Definition: RooProduct.cxx:360
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:37
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooProduct::isBinnedDistribution
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooProduct.cxx:401
RooProduct::RooProduct
RooProduct()
Default constructor.
Definition: RooProduct.cxx:57
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
RooProduct::_compCSet
RooListProxy _compCSet
Definition: RooProduct.h:63
RooProduct::~RooProduct
virtual ~RooProduct()
Destructor.
Definition: RooProduct.cxx:67
int