Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRealSumPdf.h
Go to the documentation of this file.
1/*****************************************************************************
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
18
19#include "RooAbsPdf.h"
20#include "RooListProxy.h"
21#include "RooAICRegistry.h"
22#include "RooObjCacheManager.h"
23
24class RooRealSumPdf : public RooAbsPdf {
25public:
26
28 RooRealSumPdf(const char *name, const char *title);
29 RooRealSumPdf(const char *name, const char *title, const RooArgList& funcList, const RooArgList& coefList, Bool_t extended=kFALSE) ;
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 virtual TObject* clone(const char* newname) const { return new RooRealSumPdf(*this,newname) ; }
34 virtual ~RooRealSumPdf() ;
35
36 Double_t evaluate() const ;
37 virtual Bool_t checkObservables(const RooArgSet* nset) const ;
38
39 void computeBatch(cudaStream_t*, double* output, size_t size, RooFit::Detail::DataMap const&) const;
40
41 virtual Bool_t forceAnalyticalInt(const RooAbsArg& arg) const { return arg.isFundamental() ; }
42 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
43 Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
44
45 const RooArgList& funcList() const { return _funcList ; }
46 const RooArgList& coefList() const { return _coefList ; }
47
48 virtual ExtendMode extendMode() const ;
49
50 /// Return expected number of events for extended likelihood calculation, which
51 /// is the sum of all coefficients.
52 virtual Double_t expectedEvents(const RooArgSet* nset) const ;
53
54 virtual Bool_t selfNormalized() const { return getAttribute("BinnedLikelihoodActive") ; }
55
56 void printMetaArgs(std::ostream& os) const ;
57
58
59 virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
60 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
61 Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
62
63 void setFloor(Bool_t flag) { _doFloor = flag ; }
64 Bool_t getFloor() const { return _doFloor ; }
65 static void setFloorGlobal(Bool_t flag) { _doFloorGlobal = flag ; }
66 static Bool_t getFloorGlobal() { return _doFloorGlobal ; }
67
68 virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised ; } ;
69 virtual void setCacheAndTrackHints(RooArgSet&) ;
70
71 std::unique_ptr<RooArgSet> fillNormSetForServer(RooArgSet const& /*normSet*/, RooAbsArg const& /*server*/) const {
72 return std::make_unique<RooArgSet>();
73 }
74
75protected:
76
78 public:
79 CacheElem() {} ;
80 virtual ~CacheElem() {} ;
81 virtual RooArgList containedArgs(Action) { RooArgList ret(_funcIntList) ; ret.add(_funcNormList) ; return ret ; }
84 } ;
85 mutable RooObjCacheManager _normIntMgr ; //! The integration cache manager
86
87
88 RooListProxy _funcList ; // List of component FUNCs
89 RooListProxy _coefList ; // List of coefficients
90 Bool_t _extended ; // Allow use as extended p.d.f.
91
92 Bool_t _doFloor = false; // Introduce floor at zero in pdf
93 mutable bool _haveWarned{false}; //!
94 static Bool_t _doFloorGlobal ; // Global flag for introducing floor at zero in pdf
95
96private:
97
98 bool haveLastCoef() const {
99 return _funcList.size() == _coefList.size();
100 }
101
102 ClassDef(RooRealSumPdf, 5) // PDF constructed from a sum of (non-pdf) functions
103};
104
105#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const Bool_t kFALSE
Definition RtypesCore.h:101
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
virtual Bool_t isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition RooAbsArg.h:239
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
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.
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:35
RooListProxy is the concrete proxy for RooArgList objects.
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
virtual RooArgList containedArgs(Action)
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
virtual ExtendMode extendMode() const
Returns ability of PDF to provide extended likelihood terms.
const RooArgList & funcList() const
RooObjCacheManager _normIntMgr
static Bool_t getFloorGlobal()
Double_t evaluate() const
Calculate the current value.
virtual Bool_t selfNormalized() const
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
RooListProxy _coefList
std::unique_ptr< RooArgSet > fillNormSetForServer(RooArgSet const &, RooAbsArg const &) const
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
RooListProxy _funcList
The integration cache manager.
RooRealSumPdf()
Default constructor coverity[UNINIT_CTOR].
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events for extended likelihood calculation, which is the sum of all coeffic...
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Check if all components that depend on obs are binned.
static Bool_t _doFloorGlobal
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
virtual ~RooRealSumPdf()
Destructor.
virtual Bool_t checkObservables(const RooArgSet *nset) const
Check if FUNC is valid for given normalization set.
void setFloor(Bool_t flag)
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooRealSumPdf to more intuitively reflect the contents of the p...
virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooRealSumPdf with cache-and-track.
virtual TObject * clone(const char *newname) const
Bool_t getFloor() const
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Advertise that all integrals can be handled internally.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implement analytical integrations by deferring integration of component functions to integrators of c...
bool haveLastCoef() const
void computeBatch(cudaStream_t *, double *output, size_t size, RooFit::Detail::DataMap const &) const
Base function for computing multiple values of a RooAbsReal.
const RooArgList & coefList() const
virtual CacheMode canNodeBeCached() const
static void setFloorGlobal(Bool_t flag)
Mother of all ROOT objects.
Definition TObject.h:41
static void output(int code)
Definition gifencode.c:226