Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MinNLLTestStat.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id: MinNLLTestStat.h 43035 2012-02-16 16:48:57Z sven $
2// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
3// Additional Contributions: Giovanni Petrucciani
4/*************************************************************************
5 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOSTATS_MinNLLTestStat
13#define ROOSTATS_MinNLLTestStat
14
15
16#include "Rtypes.h"
17
19
20//#include "RooStats/DistributionCreator.h"
23
25
26#include "RooRealVar.h"
27#include "RooProfileLL.h"
28#include "RooNLLVar.h"
29#include "RooMsgService.h"
30
31#include "RooMinimizer.h"
33#include "TStopwatch.h"
35
36namespace RooStats {
37
38/** \class MinNLLTestStat
39 \ingroup Roostats
40
41MinNLLTestStat is an implementation of the TestStatistic interface that
42calculates the minimum value of the negative log likelihood
43function and returns it as a test statistic.
44Internally it operates by delegating to a MinNLLTestStat object.
45
46*/
47
49
50 public:
52 // Proof constructor. Do not use.
53 fProflts = 0;
54 }
57 }
58
60 RooAbsPdf * pdf = rhs.fProflts->GetPdf();
61 if (pdf) fProflts = new ProfileLikelihoodTestStat(*pdf);
62 }
63
65 if (this == &rhs) return *this;
66 RooAbsPdf * pdf = rhs.fProflts->GetPdf();
67 if (fProflts) delete fProflts;
68 fProflts = NULL;
69 if (pdf) fProflts = new ProfileLikelihoodTestStat(*pdf);
70 return *this;
71 }
72
73 virtual ~MinNLLTestStat() {
74 delete fProflts;
75 }
76
77 void SetOneSided(Bool_t flag=true) {fProflts->SetOneSided(flag);}
79 void SetReuseNLL(Bool_t flag) { fProflts->SetReuseNLL(flag); }
80 void SetMinimizer(const char* minimizer){ fProflts->SetMinimizer(minimizer); }
81 void SetStrategy(Int_t strategy){ fProflts->SetStrategy(strategy); }
82 void SetTolerance(double tol){ fProflts->SetTolerance(tol); }
83 void SetPrintLevel(Int_t printlevel){ fProflts->SetPrintLevel(printlevel); }
84 void SetLOffset(Bool_t flag=kTRUE) { fProflts->SetLOffset(flag) ; }
85
86 // Main interface to evaluate the test statistic on a dataset
87 virtual Double_t Evaluate(RooAbsData& data, RooArgSet& paramsOfInterest) {
88 return fProflts->EvaluateProfileLikelihood(1, data, paramsOfInterest); //find unconditional NLL minimum
89 }
90
91 virtual void EnableDetailedOutput( bool e=true ) { fProflts->EnableDetailedOutput(e); }
92
93 virtual const RooArgSet* GetDetailedOutput(void) const {
94 // Returns detailed output. The value returned by this function is updated after each call to Evaluate().
95 // The returned RooArgSet contains the following:
96 //
97 // - the minimum nll, fitstatus and convergence quality for each fit </li>
98 // - for all non-constant parameters their value, error and pull </li>
100 }
101
102 virtual void SetVarName(const char* name) { fProflts->SetVarName(name); }
103
104 virtual const TString GetVarName() const { return fProflts->GetVarName(); }
105
106 private:
108
109 protected:
110 ClassDef(MinNLLTestStat,1) // implements the minimum NLL as a test statistic to be used with several tools
111 };
112}
113
114
115#endif
#define e(i)
Definition RSha256.hxx:103
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:82
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:35
MinNLLTestStat is an implementation of the TestStatistic interface that calculates the minimum value ...
void SetOneSided(Bool_t flag=true)
virtual const TString GetVarName() const
MinNLLTestStat(const MinNLLTestStat &rhs)
void SetPrintLevel(Int_t printlevel)
void SetStrategy(Int_t strategy)
virtual Double_t Evaluate(RooAbsData &data, RooArgSet &paramsOfInterest)
Main interface to evaluate the test statistic on a dataset given the values for the Null Parameters O...
void SetOneSidedDiscovery(Bool_t flag=true)
virtual void SetVarName(const char *name)
void SetTolerance(double tol)
MinNLLTestStat(RooAbsPdf &pdf)
void SetMinimizer(const char *minimizer)
MinNLLTestStat & operator=(const MinNLLTestStat &rhs)
void SetReuseNLL(Bool_t flag)
ProfileLikelihoodTestStat * fProflts
virtual const RooArgSet * GetDetailedOutput(void) const
return detailed output: for fits this can be pulls, processing time, ... The returned pointer will no...
void SetLOffset(Bool_t flag=kTRUE)
virtual void EnableDetailedOutput(bool e=true)
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
virtual void EnableDetailedOutput(bool e=true, bool withErrorsAndPulls=false)
virtual Double_t EvaluateProfileLikelihood(int type, RooAbsData &data, RooArgSet &paramsOfInterest)
internal function to evaluate test statistics can do depending on type:
virtual const RooArgSet * GetDetailedOutput(void) const
return detailed output: for fits this can be pulls, processing time, ... The returned pointer will no...
virtual void SetVarName(const char *name)
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
Basic string class.
Definition TString.h:136
Namespace for the RooStats classes.
Definition Asimov.h:19