Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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=nullptr) ;
28 TObject* clone(const char* newname) const override { return new RooProfileLL(*this,newname); }
29
30 void setAlwaysStartFromMin(bool flag) { _startFromMin = flag ; }
31 bool alwaysStartFromMin() const { return _startFromMin ; }
32
34 RooAbsReal& nll() { return const_cast<RooAbsReal&>(_nll.arg()) ; }
35 const RooArgSet& bestFitParams() const ;
36 const RooArgSet& bestFitObs() const ;
37
38 RooFit::OwningPtr<RooAbsReal> createProfile(const RooArgSet& paramsOfInterest) override ;
39
40 bool redirectServersHook(const RooAbsCollection& /*newServerList*/, bool /*mustReplaceAll*/, bool /*nameChange*/, bool /*isRecursive*/) override ;
41
42 void clearAbsMin() { _absMinValid = false ; }
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 ; ///< Marginalised parameters of likelihood
55 bool _startFromMin = true; ///< Always start minimization for global minimum?
56
57 mutable std::unique_ptr<RooMinimizer> _minimizer = nullptr ; ///<! Internal minimizer instance
58
59 mutable bool _absMinValid = false; ///< flag if absmin is up-to-date
60 mutable double _absMin = 0.0; ///< absolute minimum of -log(L)
61 mutable RooArgSet _paramAbsMin ; ///< Parameter values at absolute minimum
62 mutable RooArgSet _obsAbsMin ; ///< Observable values at absolute minimum
63 mutable std::map<std::string,bool> _paramFixed ; ///< Parameter constant status at last time of use
64 mutable Int_t _neval = 0; ///< Number evaluations used in last minimization
65 double evaluate() const override ;
66
67
68private:
69
70 ClassDefOverride(RooProfileLL,0) // Real-valued function representing profile likelihood of external (likelihood) function
71};
72
73#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
char name[80]
Definition TGX11.cxx:110
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
Implements the profile likelihood estimator for a given likelihood and set of parameters of interest.
const RooArgSet & bestFitObs() const
RooArgSet _paramAbsMin
Parameter values at absolute minimum.
RooSetProxy _obs
Parameters of profile likelihood.
Int_t _neval
Number evaluations used in last minimization.
RooProfileLL()
Default constructor Should only be used by proof.
void initializeMinimizer() const
void clearAbsMin()
bool alwaysStartFromMin() const
RooAbsReal & nll()
bool _absMinValid
flag if absmin is up-to-date
std::map< std::string, bool > _paramFixed
Parameter constant status at last time of use.
RooMinimizer * minimizer()
void setAlwaysStartFromMin(bool flag)
bool _startFromMin
Always start minimization for global minimum?
std::unique_ptr< RooMinimizer > _minimizer
! Internal minimizer instance
RooArgSet _obsAbsMin
Observable values at absolute minimum.
void validateAbsMin() const
Check that parameters and likelihood value for 'best fit' are still valid.
RooSetProxy _par
Marginalised parameters of likelihood.
double _absMin
absolute minimum of -log(L)
double evaluate() const override
Evaluate profile likelihood by minimizing likelihood w.r.t.
RooFit::OwningPtr< RooAbsReal > createProfile(const RooArgSet &paramsOfInterest) override
Optimized implementation of createProfile for profile likelihoods.
TObject * clone(const char *newname) const override
RooRealProxy _nll
Input -log(L) function.
bool redirectServersHook(const RooAbsCollection &, bool, bool, bool) override
Function that is called at the end of redirectServers().
Int_t numEval() const
const RooArgSet & bestFitParams() const
const T & arg() const
Return reference to object held in proxy.
Mother of all ROOT objects.
Definition TObject.h:41
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35