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 RooProduct(const char *name, const char *title, RooAbsReal& real1, RooAbsReal& real2) ;
35
36 RooProduct(const RooProduct& other, const char *name = nullptr);
37
38 void addTerm(RooAbsArg* term);
39
40 TObject* clone(const char* newname) const override { return new RooProduct(*this, newname); }
41 bool forceAnalyticalInt(const RooAbsArg& dep) const override ;
43 const RooArgSet* normSet,
44 const char* rangeName=nullptr) const override ;
45 double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const override;
46
47
48 RooArgList components() { RooArgList tmp(_compRSet) ; tmp.add(_compCSet) ; return tmp ; }
49
50 const RooArgList& realComponents() const { return _compRSet; }
51 const RooArgList& categoricalComponents() const { return _compCSet; }
52
53 ~RooProduct() override ;
54
55 class ProdMap ;
56
57 void printMetaArgs(std::ostream& os) const override ;
58
59 std::list<double>* binBoundaries(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
60 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
61 bool isBinnedDistribution(const RooArgSet& obs) const override ;
62
63 CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised ; } ;
64 void setCacheAndTrackHints(RooArgSet&) override ;
65
66 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
67protected:
68
69 void ioStreamerPass2() override ;
70
73
75 public:
76 ~CacheElem() override;
77 // Payload
81 };
82 mutable RooObjCacheManager _cacheMgr ; //! The cache manager
83
84
85 double calculate(const RooArgList& partIntList) const;
86 double evaluate() const override;
87 void doEval(RooFit::EvalContext &) const override;
88
89 const char* makeFPName(const char *pfx,const RooArgSet& terms) const ;
90 ProdMap* groupProductTerms(const RooArgSet&) const;
91 Int_t getPartIntList(const RooArgSet* iset, const char *rangeName=nullptr) const;
92
93 ClassDefOverride(RooProduct,3) // Product of RooAbsReal and/or RooAbsCategory terms
94};
95
96#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
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:55
A class to maintain the context for squashing of RooFit models into code.
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
RooArgList containedArgs(Action) override
Return list of all RooAbsArgs in cache element.
RooArgList _ownedList
Definition RooProduct.h:79
~CacheElem() override
Destructor.
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.
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
RooListProxy _compRSet
Definition RooProduct.h:71
double evaluate() const override
Evaluate product of input functions.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate integral internally from appropriate partial integral cache.
void addTerm(RooAbsArg *term)
Add a term to this product.
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
void translate(RooFit::Detail::CodeSquashContext &ctx) const override
This function defines a translation for each RooAbsReal based object that can be used to express the ...
double calculate(const RooArgList &partIntList) const
The cache manager.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force internal handling of integration of given observable if any of the product terms depend on it.
const RooArgList & categoricalComponents() const
Definition RooProduct.h:51
const RooArgList & realComponents() const
Definition RooProduct.h:50
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components of a RooProduct with cache-and-track.
~RooProduct() override
Destructor.
bool isBinnedDistribution(const RooArgSet &obs) const override
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
TObject * clone(const char *newname) const override
Definition RooProduct.h:40
CacheMode canNodeBeCached() const override
Definition RooProduct.h:63
void ioStreamerPass2() override
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Int_t getPartIntList(const RooArgSet *iset, const char *rangeName=nullptr) const
Return list of (partial) integrals whose product defines the integral of this RooProduct over the obs...
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Declare that we handle all integrations internally.
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
RooProduct()
Default constructor.
RooObjCacheManager _cacheMgr
Definition RooProduct.h:82
RooListProxy _compCSet
Definition RooProduct.h:72
RooArgList components()
Definition RooProduct.h:48
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Mother of all ROOT objects.
Definition TObject.h:41