Logo ROOT  
Reference Guide
HistFactorySimultaneous.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
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
17//////////////////////////////////////////////////////////////////////////////
18/** \class RooStats::HistFactory::HistFactorySimultaneous
19 * \ingroup HistFactory
20 * RooSimultaneous facilitates simultaneous fitting of multiple PDFs
21 * to subsets of a given dataset.
22 *
23 * The class takes an index category, which is interpreted as
24 * the data subset indicator, and a list of PDFs, each associated
25 * with a state of the index category. RooSimultaneous always returns
26 * the value of the PDF that is associated with the current value
27 * of the index category
28 *
29 * Extended likelihood fitting is supported if all components support
30 * extended likelihood mode. The expected number of events by a RooSimultaneous
31 * is that of the component p.d.f. selected by the index category
32 *
33 */
34
35
36#include "RooNLLVar.h"
37
40
41using namespace std ;
42
44;
45
46
47////////////////////////////////////////////////////////////////////////////////
48
50 RooAbsCategoryLValue& inIndexCat) :
51 RooSimultaneous(name, title, inIndexCat ) {}
52
53
54////////////////////////////////////////////////////////////////////////////////
55
57 const RooArgList& inPdfList, RooAbsCategoryLValue& inIndexCat) :
58 RooSimultaneous(name, title, inPdfList, inIndexCat) {}
59
60
61////////////////////////////////////////////////////////////////////////////////
62
64 map<string,RooAbsPdf*> pdfMap, RooAbsCategoryLValue& inIndexCat) :
65 RooSimultaneous(name, title, pdfMap, inIndexCat) {}
66
67
68////////////////////////////////////////////////////////////////////////////////
69
71 RooSimultaneous(other, name) {}
72
73////////////////////////////////////////////////////////////////////////////////
74
76 RooSimultaneous(other, name) {}
77
78////////////////////////////////////////////////////////////////////////////////
79/// Destructor
80
82{
83}
84
85
86////////////////////////////////////////////////////////////////////////////////
87
89 const RooCmdArg& arg1, const RooCmdArg& arg2,
90 const RooCmdArg& arg3, const RooCmdArg& arg4,
91 const RooCmdArg& arg5, const RooCmdArg& arg6,
92 const RooCmdArg& arg7, const RooCmdArg& arg8) {
93 // Probably not necessary because createNLL is virtual...
94
96 l.Add((TObject*)&arg1) ; l.Add((TObject*)&arg2) ;
97 l.Add((TObject*)&arg3) ; l.Add((TObject*)&arg4) ;
98 l.Add((TObject*)&arg5) ; l.Add((TObject*)&arg6) ;
99 l.Add((TObject*)&arg7) ; l.Add((TObject*)&arg8) ;
100 return createNLL(data,l) ;
101
102}
103
104
105//_____________________________________________________________________________
106
108
109 // We want to overload the method createNLL so it return
110 // a RooBarlow-Beeston NLL function, which can be used
111 // in HistFactory to minimize statistical uncertainty analytically
112 //
113 // The only problem is one of ownership
114 // This HistFactorySimultaneous and the RooAbsData& data must
115 // exist for as long as the RooBarlowBeestonLL does
116 //
117 // This could be solved if we instead refer to the cloned
118 // pdf's and data set in the nll that we create here, but
119 // it's unclear how to do so
120 //
121 // Also, check for ownership/memory issue with the newly created nll
122 // and whether RooBarlowBeestonLL owns it, etc
123
124 // Create a standard nll
125 RooNLLVar* nll = (RooNLLVar*) RooSimultaneous::createNLL( data, cmdList );
126
127 RooBarlowBeestonLL* bbnll = new RooBarlowBeestonLL("bbnll", "bbnll", *nll); //, *observables);
128 bbnll->setPdf( this );
129 bbnll->setDataset( &data );
130 bbnll->initializeBarlowCache();
131
132 return bbnll;
133
134}
#define ClassImp(name)
Definition: Rtypes.h:361
char name[80]
Definition: TGX11.cxx:109
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:44
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
Definition: RooAbsPdf.cxx:918
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:28
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:35
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
Definition: RooNLLVar.h:26
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
Class RooBarlowBeestonLL implements the profile likelihood estimator for a given likelihood and set o...
Mother of all ROOT objects.
Definition: TObject.h:37
auto * l
Definition: textangle.C:4