Logo ROOT  
Reference Guide
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, bool takeOwnerShip=false) ;
32 RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2, bool takeOwnerShip=false) ;
33
34 RooAddition(const RooAddition& other, const char* name = nullptr);
35 TObject* clone(const char* newname) const override { return new RooAddition(*this, newname); }
36
37 double defaultErrorLevel() const override ;
38
39 void printMetaArgs(std::ostream& os) const override ;
40
41 const RooArgList& list1() const { return _set ; }
42 const RooArgList& list() const { return _set ; }
43
44 bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override {
45 // Force RooRealIntegral to offer all observables for internal integration
46 return true ;
47 }
48 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=nullptr) const override;
49 double analyticalIntegral(Int_t code, const char* rangeName=nullptr) const override ;
50
51 bool setData(RooAbsData& data, bool cloneData=true) override ;
52
53 std::list<double>* binBoundaries(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
54 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
55 bool isBinnedDistribution(const RooArgSet& obs) const override ;
56
57 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
58
59protected:
60
61 RooArgList _ownedList ; ///< List of owned components
62 RooListProxy _set ; ///< set of terms to be summed
63
65 public:
66 // Payload
68 RooArgList containedArgs(Action) override { return _I; }
69 };
70 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
71
72 double evaluate() const override;
73
74 ClassDefOverride(RooAddition,3) // Sum of RooAbsReal objects
75};
76
77#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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:71
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:62
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:68
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:44
const RooArgList & list1() const
Definition: RooAddition.h:41
const RooArgList & list() const
Definition: RooAddition.h:42
RooArgList _ownedList
List of owned components.
Definition: RooAddition.h:61
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:62
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:70
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:35
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:56
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()