Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBarlowBeestonLL.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: George Lewis, Kyle Cranmer
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOBARLOWBEESTONLL
12#define ROOBARLOWBEESTONLL
13
14#include "RooAbsReal.h"
15#include "RooRealProxy.h"
16#include "RooSetProxy.h"
17#include <map>
18#include <set>
19#include <string>
20#include <vector>
21
22class RooMinuit ;
23
24namespace RooStats{
25 namespace HistFactory{
26
28public:
29
31 RooBarlowBeestonLL(const char *name, const char *title, RooAbsReal& nll /*, const RooArgSet& observables*/);
32 RooBarlowBeestonLL(const RooBarlowBeestonLL& other, const char* name=0) ;
33 virtual TObject* clone(const char* newname) const { return new RooBarlowBeestonLL(*this,newname); }
34 virtual ~RooBarlowBeestonLL() ;
35
36 // A simple class to store the
37 // necessary objects for a
38 // single gamma in a single channel
40 public:
41 BarlowCache() : hasStatUncert(false), gamma(NULL),
42 observables(NULL), bin_center(NULL),
43 tau(NULL), nom_pois_mean(NULL),
44 sumPdf(NULL), nData(-1) {}
48 RooArgSet* bin_center; // Snapshot
52 double nData;
53 double binVolume;
54 void SetBinCenter() const;
55 /*
56 // Restore original values and constant status of observables
57 TIterator* iter = obsSetOrig->createIterator() ;
58 RooRealVar* var ;
59 while((var=(RooRealVar*)iter->Next())) {
60 RooRealVar* target = (RooRealVar*) _obs.find(var->GetName()) ;
61 target->setVal(var->getVal()) ;
62 target->setConstant(var->isConstant()) ;
63 }
64 */
65
66 };
67
68
70
71 bool getParameters(const RooArgSet* depList, RooArgSet& outputSet, bool stripDisconnected=true) const;
72
73 // void setAlwaysStartFromMin(Bool_t flag) { _startFromMin = flag ; }
74 // Bool_t alwaysStartFromMin() const { return _startFromMin ; }
75
76 //RooMinuit* minuit() { return _minuit ; }
77 RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
78 // const RooArgSet& bestFitParams() const ;
79 // const RooArgSet& bestFitObs() const ;
80
81 // virtual RooAbsReal* createProfile(const RooArgSet& paramsOfInterest) ;
82
83 virtual Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
84
85 // void clearAbsMin() { _absMinValid = kFALSE ; }
86
87 // Int_t numEval() const { return _neval ; }
88
89 void setPdf(RooAbsPdf* pdf) { _pdf = pdf; }
90 void setDataset(RooAbsData* data) { _data = data; }
91
92 //void FactorizePdf(const RooArgSet &observables, RooAbsPdf &pdf,
93 // RooArgList &obsTerms, RooArgList &constraints) const;
94
95
96protected:
97
98 // void validateAbsMin() const ;
99
100
101 RooRealProxy _nll ; // Input -log(L) function
102 /*
103 RooSetProxy _obs ; // Parameters of profile likelihood
104 RooSetProxy _par ; // Marginialized parameters of likelihood
105 */
108 mutable std::map< std::string, std::vector< BarlowCache > > _barlowCache;
109 mutable std::set< std::string > _statUncertParams;
110 // Bool_t _startFromMin ; // Always start minimization for global minimum?
111
112 /*
113 TIterator* _piter ; //! Iterator over profile likelihood parameters to be minimized
114 TIterator* _oiter ; //! Iterator of profile likelihood output parameter(s)
115 */
116
117 // mutable RooMinuit* _minuit ; //! Internal minuit instance
118
119 // mutable Bool_t _absMinValid ; // flag if absmin is up-to-date
120 // mutable Double_t _absMin ; // absolute minimum of -log(L)
121 // mutable RooArgSet _paramAbsMin ; // Parameter values at absolute minimum
122 // mutable RooArgSet _obsAbsMin ; // Observable values at absolute minimum
123 mutable std::map<std::string,bool> _paramFixed ; // Parameter constant status at last time of use
124 // mutable Int_t _neval ; // Number evaluations used in last minimization
125 Double_t evaluate() const ;
126 //Double_t evaluate_bad() const ;
127
128
129private:
130
131 ClassDef(RooStats::HistFactory::RooBarlowBeestonLL,0) // Real-valued function representing a Barlow-Beeston minimized profile likelihood of external (likelihood) function
132};
133
134 }
135}
136
137#endif
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:49
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:61
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
RooMinuit is a wrapper class around TFitter/TMinuit that provides a seamless interface between the MI...
Definition RooMinuit.h:39
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:39
Class RooBarlowBeestonLL implements the profile likelihood estimator for a given likelihood and set o...
bool getParameters(const RooArgSet *depList, RooArgSet &outputSet, bool stripDisconnected=true) const
Fills a list with leaf nodes in the arg tree starting with ourself as top node that don't match any o...
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
Function that is called at the end of redirectServers().
std::map< std::string, bool > _paramFixed
std::map< std::string, std::vector< BarlowCache > > _barlowCache
Double_t evaluate() const
Optimized implementation of createProfile for profile likelihoods.
virtual TObject * clone(const char *newname) const
const T & arg() const
Return reference to object held in proxy.
Mother of all ROOT objects.
Definition TObject.h:37
Namespace for the RooStats classes.
Definition Asimov.h:19