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() ;
31 RooAddition(const char *name, const char *title, const RooArgList& sumSet, Bool_t takeOwnerShip=kFALSE) ;
32 RooAddition(const char *name, const char *title, const RooArgList& sumSet1, const RooArgList& sumSet2, Bool_t takeOwnerShip=kFALSE) ;
33 virtual ~RooAddition() ;
34
35 RooAddition(const RooAddition& other, const char* name = 0);
36 virtual TObject* clone(const char* newname) const { return new RooAddition(*this, newname); }
37
38 virtual Double_t defaultErrorLevel() const ;
39
40 void printMetaArgs(std::ostream& os) const ;
41
42 const RooArgList& list1() const { return _set ; }
43 const RooArgList& list() const { return _set ; }
44
45 virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
46 // Force RooRealIntegral to offer all observables for internal integration
47 return kTRUE ;
48 }
49 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& numVars, const char* rangeName=0) const;
50 Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
51
52 Bool_t setData(RooAbsData& data, Bool_t cloneData=kTRUE) ;
53
54 virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
55 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
56 Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
57
58 virtual void enableOffsetting(Bool_t) ;
59
60 void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooFit::Detail::DataMap const&) const;
61
62protected:
63
64 RooArgList _ownedList ; // List of owned components
65 RooListProxy _set ; // set of terms to be summed
66
68 public:
69 virtual ~CacheElem();
70 // Payload
73 };
74 mutable RooObjCacheManager _cacheMgr ; //! The cache manager
75
76 Double_t evaluate() const;
77
78 ClassDef(RooAddition,3) // Sum of RooAbsReal objects
79};
80
81#endif
const Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
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:69
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:82
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
virtual RooArgList containedArgs(Action)
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
void printMetaArgs(std::ostream &os) const
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition RooAddition.h:45
const RooArgList & list1() const
Definition RooAddition.h:42
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
const RooArgList & list() const
Definition RooAddition.h:43
RooArgList _ownedList
Definition RooAddition.h:64
virtual void enableOffsetting(Bool_t)
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate integral cache.
RooListProxy _set
Definition RooAddition.h:65
Double_t evaluate() const
The cache manager.
virtual ~RooAddition()
RooAddition()
Empty constructor.
RooObjCacheManager _cacheMgr
Definition RooAddition.h:74
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
virtual TObject * clone(const char *newname) const
Definition RooAddition.h:36
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const
Compute addition of PDFs in batches.
Bool_t setData(RooAbsData &data, Bool_t cloneData=kTRUE)
virtual Double_t defaultErrorLevel() const
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
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:35
RooListProxy is the concrete proxy for RooArgList objects.
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:39
Mother of all ROOT objects.
Definition TObject.h:41
static void output(int code)
Definition gifencode.c:226