Logo ROOT  
Reference Guide
Go to the documentation of this file.
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
19#include "RooAbsReal.h"
20#include "RooListProxy.h"
21#include "RooObjCacheManager.h"
23#include <list>
25class RooRealVar;
26class RooArgList;
29class RooProduct : public RooAbsReal {
32 RooProduct() ;
33 RooProduct(const char *name, const char *title, const RooArgList& _prodSet) ;
35 RooProduct(const RooProduct& other, const char* name = 0);
37 void addTerm(RooAbsArg* term);
39 TObject* clone(const char* newname) const override { return new RooProduct(*this, newname); }
40 bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
42 const RooArgSet* normSet,
43 const char* rangeName=0) const override ;
44 double analyticalIntegral(Int_t code, const char* rangeName=0) const override;
47 RooArgList components() { RooArgList tmp(_compRSet) ; tmp.add(_compCSet) ; return tmp ; }
49 ~RooProduct() override ;
51 class ProdMap ;
53 void printMetaArgs(std::ostream& os) const override ;
55 std::list<double>* binBoundaries(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
56 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
57 bool isBinnedDistribution(const RooArgSet& obs) const override ;
59 CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised ; } ;
60 void setCacheAndTrackHints(RooArgSet&) override ;
68 public:
69 ~CacheElem() override;
70 // Payload
74 };
75 mutable RooObjCacheManager _cacheMgr ; //! The cache manager
78 double calculate(const RooArgList& partIntList) const;
79 double evaluate() const override;
80 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
82 const char* makeFPName(const char *pfx,const RooArgSet& terms) const ;
83 ProdMap* groupProductTerms(const RooArgSet&) const;
84 Int_t getPartIntList(const RooArgSet* iset, const char *rangeName=0) const;
86 ClassDefOverride(RooProduct,3) // Product of RooAbsReal and/or RooAbsCategory terms
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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:77
@ NotAdvised
Definition: RooAbsArg.h:412
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual bool add(const RooAbsArg &var, bool silent=false)
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:57
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooArgList containedArgs(Action) override
Return list of all RooAbsArgs in cache element.
Definition: RooProduct.cxx:481
RooArgList _prodList
Definition: RooProduct.h:71
RooArgList _ownedList
Definition: RooProduct.h:72
~CacheElem() override
Definition: RooProduct.cxx:473
A RooProduct represents the product of a given set of RooAbsReal objects.
Definition: RooProduct.h:29
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
Definition: RooProduct.cxx:418
RooListProxy _compRSet
Definition: RooProduct.h:64
double evaluate() const override
Evaluate product of input functions.
Definition: RooProduct.cxx:368
void addTerm(RooAbsArg *term)
Add a term to this product.
Definition: RooProduct.cxx:106
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
Definition: RooProduct.cxx:454
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
Definition: RooProduct.cxx:142
double calculate(const RooArgList &partIntList) const
The cache manager.
Definition: RooProduct.cxx:333
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force internal handling of integration of given observable if any of the product terms depend on it.
Definition: RooProduct.cxx:122
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components of a RooProduct with cache-and-track.
Definition: RooProduct.cxx:493
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const override
Declare that we handle all integrations internally.
Definition: RooProduct.cxx:293
~RooProduct() override
Definition: RooProduct.cxx:67
bool isBinnedDistribution(const RooArgSet &obs) const override
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooProduct.cxx:434
TObject * clone(const char *newname) const override
Definition: RooProduct.h:39
CacheMode canNodeBeCached() const override
Definition: RooProduct.h:59
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
Definition: RooProduct.cxx:514
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
Definition: RooProduct.cxx:348
double analyticalIntegral(Int_t code, const char *rangeName=0) const override
Calculate integral internally from appropriate partial integral cache.
Definition: RooProduct.cxx:312
Default constructor.
Definition: RooProduct.cxx:57
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...
Definition: RooProduct.cxx:220
RooListProxy _compCSet
Definition: RooProduct.h:65
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
Definition: RooProduct.cxx:389
RooArgList components()
Definition: RooProduct.h:47
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:40
Mother of all ROOT objects.
Definition: TObject.h:37
std::map< DataKey, RooSpan< const double > > DataMap
Definition: DataMap.h:59
static void output()