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>
32 class RooFitResult ;
33 class RooPlot ;
34 class RooAbsData ;
35 class RooLinkedList ;
36 
37 class RooSimultaneous : public RooAbsPdf {
38 public:
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  virtual TObject* clone(const char* newname) const { return new RooSimultaneous(*this,newname) ; }
47  virtual ~RooSimultaneous() ;
48 
49  virtual Double_t evaluate() const ;
50  virtual Bool_t selfNormalized() const { return kTRUE ; }
51  Bool_t addPdf(const RooAbsPdf& pdf, const char* catLabel) ;
52 
53  virtual ExtendMode extendMode() const ;
54 
55  virtual Double_t expectedEvents(const RooArgSet* nset) const ;
56  virtual Double_t expectedEvents(const RooArgSet& nset) const { return expectedEvents(&nset) ; }
57 
58  virtual Bool_t forceAnalyticalInt(const RooAbsArg&) const { return kTRUE ; }
59  Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
60  Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
61 
62  using RooAbsPdf::plotOn ;
63  virtual RooPlot* plotOn(RooPlot* frame,
64  const RooCmdArg& arg1 , const RooCmdArg& arg2=RooCmdArg(),
65  const RooCmdArg& arg3=RooCmdArg(), const RooCmdArg& arg4=RooCmdArg(),
66  const RooCmdArg& arg5=RooCmdArg(), const RooCmdArg& arg6=RooCmdArg(),
67  const RooCmdArg& arg7=RooCmdArg(), const RooCmdArg& arg8=RooCmdArg(),
68  const RooCmdArg& arg9=RooCmdArg(), const RooCmdArg& arg10=RooCmdArg()) const {
69  return RooAbsReal::plotOn(frame,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) ;
70  }
71  virtual RooPlot* plotOn(RooPlot* frame, RooLinkedList& cmdList) const ;
72 
73  // Backward compatibility function
74  virtual RooPlot *plotOn(RooPlot *frame, Option_t* drawOptions, Double_t scaleFactor=1.0,
75  ScaleType stype=Relative, const RooAbsData* projData=0, const RooArgSet* projSet=0,
76  Double_t precision=1e-3, Bool_t shiftToZero=kFALSE, const RooArgSet* projDataSet=0,
77  Double_t rangeLo=0, Double_t rangeHi=0, RooCurve::WingMode wmode=RooCurve::Extended) const;
78 
79  RooAbsPdf* getPdf(const char* catName) const ;
81 
82 
83  virtual RooDataSet* generateSimGlobal(const RooArgSet& whatVars, Int_t nEvents) ;
84 
85  virtual RooDataHist* fillDataHist(RooDataHist *hist, const RooArgSet* nset, Double_t scaleFactor,
86  Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const ;
87 
88 protected:
89 
90  void initialize(RooAbsCategoryLValue& inIndexCat, std::map<std::string,RooAbsPdf*> pdfMap) ;
91 
92  virtual void selectNormalization(const RooArgSet* depSet=0, Bool_t force=kFALSE) ;
93  virtual void selectNormalizationRange(const char* rangeName=0, Bool_t force=kFALSE) ;
96 
97  class CacheElem : public RooAbsCacheElement {
98  public:
99  virtual ~CacheElem() {} ;
102  } ;
103  mutable RooObjCacheManager _partIntMgr ; // Component normalization manager
104 
105 
106  friend class RooSimGenContext ;
107  friend class RooSimSplitGenContext ;
108  virtual RooAbsGenContext* autoGenContext(const RooArgSet &vars, const RooDataSet* prototype=0, const RooArgSet* auxProto=0,
109  Bool_t verbose=kFALSE, Bool_t autoBinned=kTRUE, const char* binnedTag="") const ;
110  virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype=0,
111  const RooArgSet* auxProto=0, Bool_t verbose= kFALSE) const ;
112 
113  RooCategoryProxy _indexCat ; // Index category
114  TList _pdfProxyList ; // List of PDF proxies (named after applicable category state)
115  Int_t _numPdf ; // Number of registered PDFs
116 
117  ClassDef(RooSimultaneous,2) // Simultaneous operator p.d.f, functions like C++ 'switch()' on input p.d.fs operating on index category5A
118 };
119 
120 #endif
RooSimultaneous::CacheElem::~CacheElem
virtual ~CacheElem()
Definition: RooSimultaneous.h:99
RooCmdArg
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:27
RooSimultaneous::extendMode
virtual ExtendMode extendMode() const
WVE NEEDS FIX.
Definition: RooSimultaneous.cxx:415
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
e
#define e(i)
Definition: RSha256.hxx:103
RooSimSplitGenContext
RooSimSplitGenContext is an efficient implementation of the generator context specific for RooSimulta...
Definition: RooSimSplitGenContext.h:27
Option_t
const char Option_t
Definition: RtypesCore.h:66
RooSimultaneous::indexCat
const RooAbsCategoryLValue & indexCat() const
Definition: RooSimultaneous.h:80
RooAbsData
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:46
RooSimultaneous::_numPdf
Int_t _numPdf
Definition: RooSimultaneous.h:115
RooSimultaneous::initialize
void initialize(RooAbsCategoryLValue &inIndexCat, std::map< std::string, RooAbsPdf * > pdfMap)
Definition: RooSimultaneous.cxx:168
RooSimultaneous::CacheElem::_partIntList
RooArgList _partIntList
Definition: RooSimultaneous.h:101
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:271
RooAbsCacheElement.h
RooSetProxy
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
RooSimultaneous::analyticalIntegralWN
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integration defined by given code.
Definition: RooSimultaneous.cxx:560
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
TList.h
RooSimultaneous::expectedEvents
virtual Double_t expectedEvents(const RooArgSet &nset) const
Definition: RooSimultaneous.h:56
RooSetProxy.h
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
RooSimGenContext
RooSimGenContext is an efficient implementation of the generator context specific for RooSimultaneous...
Definition: RooSimGenContext.h:27
RooSimultaneous::addPdf
Bool_t addPdf(const RooAbsPdf &pdf, const char *catLabel)
Associate given PDF with index category state label 'catLabel'.
Definition: RooSimultaneous.cxx:373
RooCurve::Extended
@ Extended
Definition: RooCurve.h:35
RooAbsPdf::plotOn
virtual 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
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
Definition: RooAbsPdf.h:118
bool
RooFitResult
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
RooAbsReal::ScaleType
ScaleType
Definition: RooAbsReal.h:253
RooSimultaneous::CacheElem
Definition: RooSimultaneous.h:97
RooSimultaneous::getAnalyticalIntegralWN
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Forward determination of analytical integration capabilities to component p.d.f.s A unique code is as...
Definition: RooSimultaneous.cxx:523
RooAbsPdf::ExtendMode
ExtendMode
Definition: RooAbsPdf.h:229
RooDataHist
The RooDataHist is a container class to hold N-dimensional binned data.
Definition: RooDataHist.h:39
RooSimultaneous::selectNormalizationRange
virtual void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of range for interpretation of fraction c...
Definition: RooSimultaneous.cxx:968
RooSimultaneous::fillDataHist
virtual RooDataHist * fillDataHist(RooDataHist *hist, const RooArgSet *nset, Double_t scaleFactor, Bool_t correctForBinVolume=kFALSE, Bool_t showProgress=kFALSE) const
Definition: RooSimultaneous.cxx:1062
RooAICRegistry.h
RooCurve::WingMode
WingMode
Definition: RooCurve.h:35
RooAbsPdf.h
RooSimultaneous::selfNormalized
virtual Bool_t selfNormalized() const
Shows if a PDF is self-normalized, which means that no attempt is made to add a normalization term.
Definition: RooSimultaneous.h:50
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooLinkedList
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:35
RooRealProxy.h
RooSimultaneous::genContext
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Return specialized generator context for simultaneous p.d.f.s.
Definition: RooSimultaneous.cxx:1002
RooPlot
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:44
RooSimultaneous::selectNormalization
virtual void selectNormalization(const RooArgSet *depSet=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of observables for interpretation of frac...
Definition: RooSimultaneous.cxx:956
RooSimultaneous::autoGenContext
virtual RooAbsGenContext * autoGenContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE, Bool_t autoBinned=kTRUE, const char *binnedTag="") const
Definition: RooSimultaneous.cxx:978
RooAbsGenContext
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
Definition: RooAbsGenContext.h:26
RooSimultaneous::_indexCat
RooCategoryProxy _indexCat
Definition: RooSimultaneous.h:113
RooSimultaneous::RooSimultaneous
RooSimultaneous()
Definition: RooSimultaneous.h:41
RooCategoryProxy.h
RooObjCacheManager.h
RooAbsReal::plotOn
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.
Definition: RooAbsReal.cxx:1714
RooSimultaneous::expectedEvents
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return the number of expected events: If the index is in nset, then return the sum of the expected ev...
Definition: RooSimultaneous.cxx:488
RooTemplateProxy< RooAbsCategory >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooSimultaneous::_partIntMgr
RooObjCacheManager _partIntMgr
Definition: RooSimultaneous.h:103
RooObjCacheManager
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
RooSimultaneous::CacheElem::containedArgs
RooArgList containedArgs(Action)
Definition: RooSimultaneous.h:100
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooSimultaneous::clone
virtual TObject * clone(const char *newname) const
Definition: RooSimultaneous.h:46
RooSimultaneous::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Definition: RooSimultaneous.h:58
name
char name[80]
Definition: TGX11.cxx:110
RooSimultaneous::generateSimGlobal
virtual RooDataSet * generateSimGlobal(const RooArgSet &whatVars, Int_t nEvents)
Special generator interface for generation of 'global observables' – for RooStats tools.
Definition: RooSimultaneous.cxx:1093
RooSimultaneous::getPdf
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
Definition: RooSimultaneous.cxx:351
RooSimultaneous::~RooSimultaneous
virtual ~RooSimultaneous()
Destructor.
Definition: RooSimultaneous.cxx:341
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:33
RooSimultaneous::_plotCoefNormSet
RooSetProxy _plotCoefNormSet
Definition: RooSimultaneous.h:94
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
RooSimultaneous::_pdfProxyList
TList _pdfProxyList
Definition: RooSimultaneous.h:114
RooSimultaneous::plotOn
virtual 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
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
Definition: RooAbsPdf.h:118
RooAbsPdf
Definition: RooAbsPdf.h:40
RooSimultaneous::plotOn
virtual 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
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
Definition: RooSimultaneous.h:63
RooAbsReal::Relative
@ Relative
Definition: RooAbsReal.h:253
RooSimultaneous
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Definition: RooSimultaneous.h:37
RooAbsCategoryLValue
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
Definition: RooAbsCategoryLValue.h:25
RooArgList.h
RooSimultaneous::_plotCoefNormRange
const TNamed * _plotCoefNormRange
Definition: RooSimultaneous.h:95
TList
A doubly linked list.
Definition: TList.h:44
RooSimultaneous::evaluate
virtual Double_t evaluate() const
Return the current value: the value of the PDF associated with the current index category state.
Definition: RooSimultaneous.cxx:453
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
int