Logo ROOT  
Reference Guide
Go to the documentation of this file.
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
19#include "RooAbsReal.h"
20#include "RooListProxy.h"
21#include "RooObjCacheManager.h"
22#include <list>
24class RooRealVar;
25class RooArgList ;
27class RooAddition : public RooAbsReal {
30 RooAddition() ;
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 ~RooAddition() override ;
35 RooAddition(const RooAddition& other, const char* name = 0);
36 TObject* clone(const char* newname) const override { return new RooAddition(*this, newname); }
38 double defaultErrorLevel() const override ;
40 void printMetaArgs(std::ostream& os) const override ;
42 const RooArgList& list1() const { return _set ; }
43 const RooArgList& list() const { return _set ; }
45 bool forceAnalyticalInt(const RooAbsArg& /*dep*/) const override {
46 // Force RooRealIntegral to offer all observables for internal integration
47 return true ;
48 }
49 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=0) const override;
50 double analyticalIntegral(Int_t code, const char* rangeName=0) const override ;
52 bool setData(RooAbsData& data, bool cloneData=true) override ;
54 std::list<double>* binBoundaries(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
55 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
56 bool isBinnedDistribution(const RooArgSet& obs) const override ;
58 void enableOffsetting(bool) override ;
60 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const override;
64 RooArgList _ownedList ; ///< List of owned components
65 RooListProxy _set ; ///< set of terms to be summed
68 public:
69 ~CacheElem() override;
70 // Payload
73 };
74 mutable RooObjCacheManager _cacheMgr ; ///<! The cache manager
76 double evaluate() const override;
78 ClassDefOverride(RooAddition,3) // Sum of RooAbsReal objects
#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:72
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:64
RooArgList containedArgs(Action) override
Return list of all RooAbsArgs in cache element.
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:45
double analyticalIntegral(Int_t code, const char *rangeName=0) const override
Calculate integral internally from appropriate integral cache.
const RooArgList & list1() const
Definition: RooAddition.h:42
const RooArgList & list() const
Definition: RooAddition.h:43
RooArgList _ownedList
List of owned components.
Definition: RooAddition.h:64
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:65
void printMetaArgs(std::ostream &os) const override
~RooAddition() override
bool setData(RooAbsData &data, bool cloneData=true) override
Empty constructor.
Definition: RooAddition.cxx:52
RooObjCacheManager _cacheMgr
! The cache manager
Definition: RooAddition.h:74
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:36
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=0) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
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 enableOffsetting(bool) override
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:57
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:37
static void output()