Logo ROOT  
Reference Guide
RooSimultaneous.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooSimultaneous.h,v 1.42 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_SIMULTANEOUS
17#define ROO_SIMULTANEOUS
18
19//#include "THashList.h"
20#include "TList.h"
21#include "RooAbsPdf.h"
22#include "RooCategoryProxy.h"
23#include "RooRealProxy.h"
24#include "RooSetProxy.h"
25#include "RooAICRegistry.h"
26#include "RooObjCacheManager.h"
27#include "RooAbsCacheElement.h"
28#include "RooArgList.h"
29#include <map>
30#include <string>
32class RooFitResult ;
33class RooPlot ;
34class RooAbsData ;
35class RooLinkedList ;
36
37class RooSimultaneous : public RooAbsPdf {
38public:
39
40 // Constructors, assignment etc
42 RooSimultaneous(const char *name, const char *title, RooAbsCategoryLValue& indexCat) ;
43 RooSimultaneous(const char *name, const char *title, std::map<std::string,RooAbsPdf*> pdfMap, RooAbsCategoryLValue& inIndexCat) ;
44 RooSimultaneous(const char *name, const char *title, const RooArgList& pdfList, RooAbsCategoryLValue& indexCat) ;
45 RooSimultaneous(const RooSimultaneous& other, const char* name=0);
46 TObject* clone(const char* newname) const override { return new RooSimultaneous(*this,newname) ; }
47 ~RooSimultaneous() override ;
48
49 double evaluate() const override ;
50 bool selfNormalized() const override { return true ; }
51 bool addPdf(const RooAbsPdf& pdf, const char* catLabel) ;
52
53 ExtendMode extendMode() const override ;
54
55 double expectedEvents(const RooArgSet* nset) const override ;
56
57 bool forceAnalyticalInt(const RooAbsArg&) const override { return true ; }
58 Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const override ;
59 double analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const override ;
60
61 using RooAbsPdf::plotOn ;
63 const RooCmdArg& arg1 , const RooCmdArg& arg2=RooCmdArg(),
64 const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(),
65 const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(),
66 const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(),
67 const RooCmdArg& arg9=RooCmdArg(), const RooCmdArg& arg10=RooCmdArg()) const override {
68 return RooAbsReal::plotOn(frame,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) ;
69 }
70 RooPlot* plotOn(RooPlot* frame, RooLinkedList& cmdList) const override ;
71
72 // Backward compatibility function
73 virtual RooPlot *plotOn(RooPlot *frame, Option_t* drawOptions, double scaleFactor=1.0,
74 ScaleType stype=Relative, const RooAbsData* projData=0, const RooArgSet* projSet=0,
75 double precision=1e-3, bool shiftToZero=false, const RooArgSet* projDataSet=0,
76 double rangeLo=0, double rangeHi=0, RooCurve::WingMode wmode=RooCurve::Extended) const;
77
78 RooAbsPdf* getPdf(const char* catName) const ;
80
81
82 RooDataSet* generateSimGlobal(const RooArgSet& whatVars, Int_t nEvents) override ;
83
84 virtual RooDataHist* fillDataHist(RooDataHist *hist, const RooArgSet* nset, double scaleFactor,
85 bool correctForBinVolume=false, bool showProgress=false) const ;
86
87 void wrapPdfsInBinSamplingPdfs(RooAbsData const &data, double precision);
89 std::map<std::string, double> const& precisions,
90 bool useCategoryNames=false);
91
92protected:
93
94 void initialize(RooAbsCategoryLValue& inIndexCat, std::map<std::string,RooAbsPdf*> pdfMap) ;
95
96 void selectNormalization(const RooArgSet* depSet=0, bool force=false) override ;
97 void selectNormalizationRange(const char* rangeName=0, bool force=false) override ;
100
102 public:
103 ~CacheElem() override {} ;
106 } ;
107 mutable RooObjCacheManager _partIntMgr ; ///<! Component normalization manager
108
109
110 friend class RooSimGenContext ;
112 RooAbsGenContext* autoGenContext(const RooArgSet &vars, const RooDataSet* prototype=0, const RooArgSet* auxProto=0,
113 bool verbose=false, bool autoBinned=true, const char* binnedTag="") const override ;
114 RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0,
115 const RooArgSet* auxProto=0, bool verbose= false) const override ;
116
117 RooCategoryProxy _indexCat ; ///< Index category
118 TList _pdfProxyList ; ///< List of PDF proxies (named after applicable category state)
119 Int_t _numPdf ; ///< Number of registered PDFs
120
121 ClassDefOverride(RooSimultaneous,3) // Simultaneous operator p.d.f, functions like C++ 'switch()' on input p.d.fs operating on index category5A
122};
123
124#endif
#define e(i)
Definition: RSha256.hxx:103
const char Option_t
Definition: RtypesCore.h:66
#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...
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:62
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none(), const RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const override
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
Definition: RooAbsPdf.h:126
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
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
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:26
@ Extended
Definition: RooCurve.h:35
The RooDataHist is a container class to hold N-dimensional binned data.
Definition: RooDataHist.h:45
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:55
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:38
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:43
RooSimGenContext is an efficient implementation of the generator context specific for RooSimultaneous...
RooSimSplitGenContext is an efficient implementation of the generator context specific for RooSimulta...
RooArgList containedArgs(Action) override
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
double evaluate() const override
Return the current value: the value of the PDF associated with the current index category state.
Int_t _numPdf
Number of registered PDFs.
TList _pdfProxyList
List of PDF proxies (named after applicable category state)
RooObjCacheManager _partIntMgr
! Component normalization manager
void selectNormalization(const RooArgSet *depSet=0, bool force=false) override
Interface function used by test statistics to freeze choice of observables for interpretation of frac...
RooAbsGenContext * autoGenContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, bool verbose=false, bool autoBinned=true, const char *binnedTag="") const override
RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const override
RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents) override
Special generator interface for generation of 'global observables' – for RooStats tools.
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const override
Forward determination of analytical integration capabilities to component p.d.f.s A unique code is as...
~RooSimultaneous() override
Destructor.
ExtendMode extendMode() const override
Examine the pdf components and check if one of them can be extended or must be extended It is enough ...
RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, bool verbose=false) const override
Return specialized generator context for simultaneous p.d.f.s.
RooCategoryProxy _indexCat
Index category.
bool forceAnalyticalInt(const RooAbsArg &) const override
void selectNormalizationRange(const char *rangeName=0, bool force=false) override
Interface function used by test statistics to freeze choice of range for interpretation of fraction c...
double expectedEvents(const RooArgSet *nset) const override
Return the number of expected events: If the index is in nset, then return the sum of the expected ev...
TObject * clone(const char *newname) const override
void initialize(RooAbsCategoryLValue &inIndexCat, std::map< std::string, RooAbsPdf * > pdfMap)
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const override
Return analytical integration defined by given code.
void wrapPdfsInBinSamplingPdfs(RooAbsData const &data, double precision)
Wraps the components of this RooSimultaneous in RooBinSamplingPdfs.
const TNamed * _plotCoefNormRange
bool addPdf(const RooAbsPdf &pdf, const char *catLabel)
Associate given PDF with index category state label 'catLabel'.
bool selfNormalized() const override
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
RooSetProxy _plotCoefNormSet
const RooAbsCategoryLValue & indexCat() const
virtual RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, double scaleFactor, bool correctForBinVolume=false, bool showProgress=false) const
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
const T & arg() const
Return reference to object held in proxy.
A doubly linked list.
Definition: TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37