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 RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2);
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 doEval(RooFit::EvalContext &) const override;
58
59 void translate(RooFit::Detail::CodeSquashContext &ctx) const override;
60
61protected:
62
63 RooArgList _ownedList ; ///< List of owned components
64 RooListProxy _set ; ///< set of terms to be summed
65
67 public:
68 // Payload
70 RooArgList containedArgs(Action) override { return _I; }
71 };
72 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
73
74 double evaluate() const override;
75
76 ClassDefOverride(RooAddition,3) // Sum of RooAbsReal objects
77};
78
79#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:77
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
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
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:70
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:63
void doEval(RooFit::EvalContext &) const override
Compute addition of PDFs in batches.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
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:64
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:72
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.
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.
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Mother of all ROOT objects.
Definition TObject.h:41