Logo ROOT  
Reference Guide
Go to the documentation of this file.
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooRealSumPdf.h,v 1.10 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_REAL_SUM_PDF
17#define ROO_REAL_SUM_PDF
19#include "RooAbsPdf.h"
20#include "RooListProxy.h"
21#include "RooAICRegistry.h"
22#include "RooObjCacheManager.h"
24class RooRealSumPdf : public RooAbsPdf {
28 RooRealSumPdf(const char *name, const char *title);
29 RooRealSumPdf(const char *name, const char *title, const RooArgList& funcList, const RooArgList& coefList, bool extended=false) ;
30 RooRealSumPdf(const char *name, const char *title,
31 RooAbsReal& func1, RooAbsReal& func2, RooAbsReal& coef1) ;
32 RooRealSumPdf(const RooRealSumPdf& other, const char* name=0) ;
33 TObject* clone(const char* newname) const override { return new RooRealSumPdf(*this,newname) ; }
34 ~RooRealSumPdf() override ;
36 double evaluate() const override ;
37 bool checkObservables(const RooArgSet* nset) const override ;
39 void computeBatch(cudaStream_t*, double* output, size_t size, RooFit::Detail::DataMap const&) const override;
41 bool forceAnalyticalInt(const RooAbsArg& arg) const override { return arg.isFundamental() ; }
42 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const override ;
43 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const override ;
45 const RooArgList& funcList() const { return _funcList ; }
46 const RooArgList& coefList() const { return _coefList ; }
48 ExtendMode extendMode() const override ;
50 /// Return expected number of events for extended likelihood calculation, which
51 /// is the sum of all coefficients.
52 double expectedEvents(const RooArgSet* nset) const override ;
54 bool selfNormalized() const override { return getAttribute("BinnedLikelihoodActive") ; }
56 void printMetaArgs(std::ostream& os) const override ;
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 ;
63 void setFloor(bool flag) { _doFloor = flag ; }
64 bool getFloor() const { return _doFloor ; }
65 static void setFloorGlobal(bool flag) { _doFloorGlobal = flag ; }
66 static bool getFloorGlobal() { return _doFloorGlobal ; }
68 CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised ; } ;
69 void setCacheAndTrackHints(RooArgSet&) override ;
71 std::unique_ptr<RooArgSet> fillNormSetForServer(RooArgSet const& /*normSet*/, RooAbsArg const& /*server*/) const override {
72 return std::make_unique<RooArgSet>();
73 }
78 public:
79 CacheElem() {} ;
80 ~CacheElem() override {} ;
81 RooArgList containedArgs(Action) override { RooArgList ret(_funcIntList) ; ret.add(_funcNormList) ; return ret ; }
84 } ;
85 mutable RooObjCacheManager _normIntMgr ; ///<! The integration cache manager
88 RooListProxy _funcList ; ///< List of component FUNCs
89 RooListProxy _coefList ; ///< List of coefficients
90 bool _extended ; ///< Allow use as extended p.d.f.
92 bool _doFloor = false; ///< Introduce floor at zero in pdf
93 mutable bool _haveWarned{false}; ///<!
94 static bool _doFloorGlobal ; ///< Global flag for introducing floor at zero in pdf
98 bool haveLastCoef() const {
99 return _funcList.size() == _coefList.size();
100 }
102 ClassDefOverride(RooRealSumPdf, 5) // PDF constructed from a sum of (non-pdf) functions
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#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:72
@ NotAdvised
Definition: RooAbsArg.h:407
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:301
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:242
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.
Storage_t::size_type size() const
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
Definition: RooRealSumPdf.h:81
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
Definition: RooRealSumPdf.h:24
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components of a RooRealSumPdf with cache-and-track.
CacheMode canNodeBeCached() const override
Definition: RooRealSumPdf.h:68
bool forceAnalyticalInt(const RooAbsArg &arg) const override
Definition: RooRealSumPdf.h:41
static bool getFloorGlobal()
Definition: RooRealSumPdf.h:66
static bool _doFloorGlobal
Global flag for introducing floor at zero in pdf.
Definition: RooRealSumPdf.h:94
TObject * clone(const char *newname) const override
Definition: RooRealSumPdf.h:33
bool _doFloor
Introduce floor at zero in pdf.
Definition: RooRealSumPdf.h:92
bool checkObservables(const RooArgSet *nset) const override
Check if FUNC is valid for given normalization set.
const RooArgList & funcList() const
Definition: RooRealSumPdf.h:45
~RooRealSumPdf() override
RooObjCacheManager _normIntMgr
! The integration cache manager
Definition: RooRealSumPdf.h:85
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const override
Advertise that all integrals can be handled internally.
void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
double evaluate() const override
Calculate the current value.
ExtendMode extendMode() const override
Returns ability of PDF to provide extended likelihood terms.
RooListProxy _coefList
List of coefficients.
Definition: RooRealSumPdf.h:89
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
Definition: RooRealSumPdf.h:54
RooListProxy _funcList
List of component FUNCs.
Definition: RooRealSumPdf.h:88
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Retrieve bin boundaries if this distribution is binned in obs.
Default constructor coverity[UNINIT_CTOR].
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooRealSumPdf to more intuitively reflect the contents of the p...
double expectedEvents(const RooArgSet *nset) const override
Return expected number of events for extended likelihood calculation, which is the sum of all coeffic...
bool getFloor() const
Definition: RooRealSumPdf.h:64
static void setFloorGlobal(bool flag)
Definition: RooRealSumPdf.h:65
void setFloor(bool flag)
Definition: RooRealSumPdf.h:63
bool haveLastCoef() const
Definition: RooRealSumPdf.h:98
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const override
Implement analytical integrations by deferring integration of component functions to integrators of c...
const RooArgList & coefList() const
Definition: RooRealSumPdf.h:46
bool _extended
Allow use as extended p.d.f.
Definition: RooRealSumPdf.h:90
bool isBinnedDistribution(const RooArgSet &obs) const override
Check if all components that depend on obs are binned.
std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &, RooAbsArg const &) const override
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
Definition: RooRealSumPdf.h:71
Mother of all ROOT objects.
Definition: TObject.h:37
static void output()