83ProfileLikelihoodCalculator::ProfileLikelihoodCalculator() :
91 fFitResult(0), fGlobalFitDone(false)
99 fFitResult(0), fGlobalFitDone(false)
132 if (!data || !pdf )
return 0;
136 if (!constrainedParams)
return 0;
145 delete constrainedParams;
165 delete constrainedParams;
177 oocoutP((
TObject*)0,
Minimization) <<
"ProfileLikelihoodCalcultor::DoMinimizeNLL - using " << minimType <<
" / " << minimAlgo <<
" with strategy " << strategy << std::endl;
190 for (
int tries = 1, maxtries = 4; tries <= maxtries; ++tries) {
191 status = minim.
minimize(minimType,minimAlgo);
192 if (status%1000 == 0) {
194 }
else if (tries < maxtries) {
195 cout <<
" ----> Doing a re-scan first" << endl;
198 if (strategy == 0 ) {
199 cout <<
" ----> trying with strategy = 1" << endl;;
206 cout <<
" ----> trying with improve" << endl;;
207 minimType =
"Minuit";
208 minimAlgo =
"migradimproved";
228 if (!data || !pdf ||
fPOI.
getSize() == 0)
return 0;
255 for (
int i = 0; i < fitParams.
getSize(); ++i) {
287 delete constrainedParams;
308 if (!data || !pdf)
return 0;
335 std::vector<double> oldValues(poiList.
getSize() );
336 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
339 oldValues[i] = mytarget->
getVal();
350 RooArgSet nuisParams(*constrainedParams);
356 bool existVarParams =
false;
361 existVarParams =
true;
367 if (existVarParams) {
374 nLLatCondMLE = fit2->
minNll();
384 nLLatCondMLE = nll->
getVal();
390 Double_t deltaNLL = std::max( nLLatCondMLE-nLLatMLE, 0.);
399 if (ndf == 1) pvalue = 0.5 * pvalue;
405 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
408 mytarget->
setVal(oldValues[i] );
413 delete constrainedParams;
static int DefaultPrintLevel()
static double DefaultTolerance()
static const std::string & DefaultMinimizerType()
static const std::string & DefaultMinimizerAlgo()
static int DefaultStrategy()
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
Bool_t isConstant() const
Check if the "Constant" attribute is set.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
void setConstant(Bool_t value=kTRUE)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual RooAbsReal * createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
virtual Int_t defaultPrintContents(Option_t *opt) const
Configure default contents to be printed.
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Configure mapping of Print() arguments to RooPrintable print styles.
const RooArgList & floatParsFinal() const
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
void setEvalErrorWall(Bool_t flag)
RooFitResult * save(const char *name=0, const char *title=0)
Save and return a RooFitResult snaphot of current minimizer status.
Int_t minimize(const char *type, const char *alg=0)
Minimise the function passed in the constructor.
void setEps(Double_t eps)
Change MINUIT epsilon.
Int_t setPrintLevel(Int_t newLevel)
Change the MINUIT internal printing level.
void optimizeConst(Int_t flag)
If flag is true, perform constant term optimization on function being minimized.
void setStrategy(Int_t strat)
Change MINUIT strategy to istrat.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
RooRealVar represents a variable that can be changed from the outside.
void setError(Double_t value)
Double_t getError() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
CombinedCalculator is an interface class for a tools which can produce both RooStats HypoTestResults ...
RooAbsData * GetData() const
RooAbsPdf * GetPdf() const
RooArgSet fConditionalObs
HypoTestResult is a base class for results from hypothesis tests.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (e.g 0.682 for a 1-sigma interval)
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
The ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface cla...
virtual HypoTestResult * GetHypoTest() const
Return the hypothesis test result obtained from the likelihood ratio of the maximum likelihood value ...
RooFitResult * fFitResult
static RooFitResult * DoMinimizeNLL(RooAbsReal *nll)
virtual LikelihoodInterval * GetInterval() const
Return a likelihood interval.
RooAbsReal * DoGlobalFit() const
ProfileLikelihoodCalculator()
Default constructor (needed for I/O)
virtual ~ProfileLikelihoodCalculator()
destructor cannot delete prod pdf because it will delete all the composing pdf's if (fOwnPdf) delete ...
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
RooCmdArg Constrain(const RooArgSet ¶ms)
RooCmdArg GlobalObservables(const RooArgSet &globs)
RooCmdArg CloneData(Bool_t flag)
RooCmdArg ConditionalObservables(const RooArgSet &set)
RooCmdArg Offset(Bool_t flag=kTRUE)
double chisquared_cdf_c(double x, double r, double x0=0)
Complement of the cumulative distribution function of the distribution with degrees of freedom (upp...
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.
void RemoveConstantParameters(RooArgSet *set)
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...
bool IsNLLOffset()
Test of RooStats should by default offset NLL calculations.