Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAddition.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAddition.h,v 1.3 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_ADDITION
17#define ROO_ADDITION
18
19#include "RooAbsReal.h"
20#include "RooListProxy.h"
21#include "RooObjCacheManager.h"
22#include <list>
23
24class RooRealVar;
25class RooArgList ;
26
27class RooAddition : public RooAbsReal {
28public:
29
30 RooAddition() : _cacheMgr(this,10) {}
31 RooAddition(const char *name, const char *title, const RooArgList& sumSet
32#ifndef ROOFIT_MEMORY_SAFE_INTERFACES
33 , bool takeOwnership=false
34#endif
35 );
36 RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2
37#ifndef ROOFIT_MEMORY_SAFE_INTERFACES
38 , bool takeOwnership=false
39#endif
40 );
41
42 RooAddition(const RooAddition& other, const char* name = nullptr);
43 TObject* clone(const char* newname) const override { return new RooAddition(*this, newname); }
44
45 double defaultErrorLevel() const override ;
46
47 void printMetaArgs(std::ostream& os) const override ;
48
49 const RooArgList& list1() const { return _set ; }
50 const RooArgList& list() const { return _set ; }
51
52 bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override {
53 // Force RooRealIntegral to offer all observables for internal integration
54 return true ;
55 }
56 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=nullptr) const override;
57 double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const override ;
58
59 bool setData(RooAbsData& data, bool cloneData=true) override ;
60
61 std::list<double>* binBoundaries(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
62 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
63 bool isBinnedDistribution(const RooArgSet& obs) const override ;
64
65 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
66
67protected:
68
69 RooArgList _ownedList ; ///< List of owned components
70 RooListProxy _set ; ///< set of terms to be summed
71
73 public:
74 // Payload
76 RooArgList containedArgs(Action) override { return _I; }
77 };
78 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
79
80 double evaluate() const override;
81
82 ClassDefOverride(RooAddition,3) // Sum of RooAbsReal objects
83};
84
85#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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:74
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:59
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:62
RooArgList containedArgs(Action) override
Definition RooAddition.h:76
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
Definition RooAddition.h:27
bool forceAnalyticalInt(const RooAbsArg &) const override
Definition RooAddition.h:52
const RooArgList & list1() const
Definition RooAddition.h:49
const RooArgList & list() const
Definition RooAddition.h:50
RooArgList _ownedList
List of owned components.
Definition RooAddition.h:69
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Compute addition of PDFs in batches.
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Retrieve bin boundaries if this distribution is binned in obs.
RooListProxy _set
set of terms to be summed
Definition RooAddition.h:70
void printMetaArgs(std::ostream &os) const override
bool setData(RooAbsData &data, bool cloneData=true) override
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate integral internally from appropriate integral cache.
RooObjCacheManager _cacheMgr
! The cache manager
Definition RooAddition.h:78
double defaultErrorLevel() const override
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
double evaluate() const override
Calculate and return current value of self.
TObject * clone(const char *newname) const override
Definition RooAddition.h:43
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
bool isBinnedDistribution(const RooArgSet &obs) const override
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
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
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
Mother of all ROOT objects.
Definition TObject.h:41
static void output()