Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "RooObjCacheManager.h"
22
23#include <list>
24
25class RooRealVar;
26class RooArgList;
27
28
29class RooProduct : public RooAbsReal {
30public:
31
32 RooProduct() ;
33 RooProduct(const char *name, const char *title, const RooArgList& _prodSet) ;
34
35 RooProduct(const RooProduct& other, const char* name = 0);
36
37 void addTerm(RooAbsArg* term);
38
39 virtual TObject* clone(const char* newname) const { return new RooProduct(*this, newname); }
40 virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
41 virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars,
42 const RooArgSet* normSet,
43 const char* rangeName=0) const ;
44 virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const;
45
46
47 RooArgList components() { RooArgList tmp(_compRSet) ; tmp.add(_compCSet) ; return tmp ; }
48
49 virtual ~RooProduct() ;
50
51 class ProdMap ;
52
53 void printMetaArgs(std::ostream& os) const ;
54
55 virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
56 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
57 virtual Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
58
59 virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised ; } ;
60 virtual void setCacheAndTrackHints(RooArgSet&) ;
61
62protected:
63
66
68 public:
69 virtual ~CacheElem();
70 // Payload
74 };
75 mutable RooObjCacheManager _cacheMgr ; //! The cache manager
76
77
78
79 double calculate(const RooArgList& partIntList) const;
80 double evaluate() const;
81 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const;
82
83 const char* makeFPName(const char *pfx,const RooArgSet& terms) const ;
84 ProdMap* groupProductTerms(const RooArgSet&) const;
85 Int_t getPartIntList(const RooArgSet* iset, const char *rangeName=0) const;
86
87
88
89
90 ClassDef(RooProduct,3) // Product of RooAbsReal and/or RooAbsCategory terms
91};
92
93#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:69
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:64
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
RooListProxy is the concrete proxy for RooArgList objects.
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
virtual ~CacheElem()
Destructor.
RooArgList _ownedList
Definition RooProduct.h:72
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
A RooProduct represents the product of a given set of RooAbsReal objects.
Definition RooProduct.h:29
virtual CacheMode canNodeBeCached() const
Definition RooProduct.h:59
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
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
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const
Base function for computing multiple values of a RooAbsReal.
RooListProxy _compRSet
Definition RooProduct.h:64
void addTerm(RooAbsArg *term)
Add a term to this product.
virtual TObject * clone(const char *newname) const
Definition RooProduct.h:39
virtual ~RooProduct()
Destructor.
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
double calculate(const RooArgList &partIntList) const
The cache manager.
double evaluate() const
Evaluate product of input functions.
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Declare that we handle all integrations internally.
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
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
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.
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate partial integral cache.
RooProduct()
Default constructor.
RooObjCacheManager _cacheMgr
Definition RooProduct.h:75
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...
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooProduct with cache-and-track.
RooListProxy _compCSet
Definition RooProduct.h:65
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
RooArgList components()
Definition RooProduct.h:47
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:39
Mother of all ROOT objects.
Definition TObject.h:41
static void output(int code)
Definition gifencode.c:226