Logo ROOT  
Reference Guide
RooProfileLL.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * *
4 * Copyright (c) 2000-2005, Regents of the University of California *
5 * and Stanford University. All rights reserved. *
6 * *
7 * Redistribution and use in source and binary forms, *
8 * with or without modification, are permitted according to the terms *
9 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
10 *****************************************************************************/
11
12#ifndef ROOPROFILELL
13#define ROOPROFILELL
14
15#include "RooAbsReal.h"
16#include "RooMinimizer.h"
17#include "RooRealProxy.h"
18#include "RooSetProxy.h"
19#include <map>
20#include <string>
21
22class RooProfileLL : public RooAbsReal {
23public:
24
25 RooProfileLL() ;
26 RooProfileLL(const char *name, const char *title, RooAbsReal& nll, const RooArgSet& observables);
27 RooProfileLL(const RooProfileLL& other, const char* name=0) ;
28 virtual TObject* clone(const char* newname) const { return new RooProfileLL(*this,newname); }
29
32
34 RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
35 const RooArgSet& bestFitParams() const ;
36 const RooArgSet& bestFitObs() const ;
37
38 virtual RooAbsReal* createProfile(const RooArgSet& paramsOfInterest) ;
39
40 virtual Bool_t redirectServersHook(const RooAbsCollection& /*newServerList*/, Bool_t /*mustReplaceAll*/, Bool_t /*nameChange*/, Bool_t /*isRecursive*/) ;
41
43
44 Int_t numEval() const { return _neval ; }
45
46
47protected:
48
49 void validateAbsMin() const ;
50 void initializeMinimizer() const ;
51
52 RooRealProxy _nll ; // Input -log(L) function
53 RooSetProxy _obs ; // Parameters of profile likelihood
54 RooSetProxy _par ; // Marginialized parameters of likelihood
55 Bool_t _startFromMin ; // Always start minimization for global minimum?
56
57 TIterator* _piter ; //! Iterator over profile likelihood parameters to be minimized
58 TIterator* _oiter ; //! Iterator of profile likelihood output parameter(s)
59
60 mutable std::unique_ptr<RooMinimizer> _minimizer = nullptr ; //! Internal minimizer instance
61
62 mutable Bool_t _absMinValid ; // flag if absmin is up-to-date
63 mutable Double_t _absMin ; // absolute minimum of -log(L)
64 mutable RooArgSet _paramAbsMin ; // Parameter values at absolute minimum
65 mutable RooArgSet _obsAbsMin ; // Observable values at absolute minimum
66 mutable std::map<std::string,bool> _paramFixed ; // Parameter constant status at last time of use
67 mutable Int_t _neval ; // Number evaluations used in last minimization
68 Double_t evaluate() const ;
69
70
71private:
72
73 ClassDef(RooProfileLL,0) // Real-valued function representing profile likelihood of external (likelihood) function
74};
75
76#endif
int Int_t
Definition: RtypesCore.h:45
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
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.
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:35
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
Definition: RooMinimizer.h:55
Class RooProfileLL implements the profile likelihood estimator for a given likelihood and set of para...
Definition: RooProfileLL.h:22
const RooArgSet & bestFitObs() const
RooArgSet _paramAbsMin
Definition: RooProfileLL.h:64
RooSetProxy _obs
Definition: RooProfileLL.h:53
RooProfileLL()
Default constructor Should only be used by proof.
void initializeMinimizer() const
TIterator * _piter
Definition: RooProfileLL.h:57
void clearAbsMin()
Definition: RooProfileLL.h:42
RooAbsReal & nll()
Definition: RooProfileLL.h:34
std::map< std::string, bool > _paramFixed
Definition: RooProfileLL.h:66
RooMinimizer * minimizer()
Definition: RooProfileLL.h:33
virtual TObject * clone(const char *newname) const
Definition: RooProfileLL.h:28
void setAlwaysStartFromMin(Bool_t flag)
Definition: RooProfileLL.h:30
Double_t evaluate() const
Evaluate profile likelihood by minimizing likelihood w.r.t.
std::unique_ptr< RooMinimizer > _minimizer
Iterator of profile likelihood output parameter(s)
Definition: RooProfileLL.h:60
RooArgSet _obsAbsMin
Definition: RooProfileLL.h:65
Bool_t _startFromMin
Definition: RooProfileLL.h:55
TIterator * _oiter
Iterator over profile likelihood parameters to be minimized.
Definition: RooProfileLL.h:58
void validateAbsMin() const
Check that parameters and likelihood value for 'best fit' are still valid.
RooSetProxy _par
Definition: RooProfileLL.h:54
Bool_t alwaysStartFromMin() const
Definition: RooProfileLL.h:31
virtual RooAbsReal * createProfile(const RooArgSet &paramsOfInterest)
Optimized implementation of createProfile for profile likelihoods.
virtual Bool_t redirectServersHook(const RooAbsCollection &, Bool_t, Bool_t, Bool_t)
RooRealProxy _nll
Definition: RooProfileLL.h:52
Double_t _absMin
Definition: RooProfileLL.h:63
Int_t numEval() const
Definition: RooProfileLL.h:44
const RooArgSet & bestFitParams() const
Bool_t _absMinValid
Internal minimizer instance.
Definition: RooProfileLL.h:62
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
const T & arg() const
Return reference to object held in proxy.
Iterator abstract base class.
Definition: TIterator.h:30
Mother of all ROOT objects.
Definition: TObject.h:37