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(double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
66
67 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
68
69protected:
70
71 RooArgList _ownedList ; ///< List of owned components
72 RooListProxy _set ; ///< set of terms to be summed
73
75 public:
76 // Payload
78 RooArgList containedArgs(Action) override { return _I; }
79 };
80 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
81
82 double evaluate() const override;
83
84 ClassDefOverride(RooAddition,3) // Sum of RooAbsReal objects
85};
86
87#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
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgList containedArgs(Action) override
Definition RooAddition.h:78
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:71
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(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:72
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:80
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.
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 ...
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.
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:37
Mother of all ROOT objects.
Definition TObject.h:41
static void output()