83ProfileLikelihoodCalculator::ProfileLikelihoodCalculator() :
91 fFitResult(0), fGlobalFitDone(false)
99 fFitResult(0), fGlobalFitDone(false)
132 if (!data || !pdf )
return 0;
136 if (!constrainedParams)
return 0;
144 delete constrainedParams;
164 delete constrainedParams;
176 oocoutP((
TObject*)0,
Minimization) <<
"ProfileLikelihoodCalcultor::DoMinimizeNLL - using " << minimType <<
" / " << minimAlgo <<
" with strategy " << strategy << std::endl;
186 for (
int tries = 1, maxtries = 4; tries <= maxtries; ++tries) {
187 status = minim.
minimize(minimType,minimAlgo);
188 if (status%1000 == 0) {
190 }
else if (tries < maxtries) {
191 cout <<
" ----> Doing a re-scan first" << endl;
194 if (strategy == 0 ) {
195 cout <<
" ----> trying with strategy = 1" << endl;;
202 cout <<
" ----> trying with improve" << endl;;
203 minimType =
"Minuit";
204 minimAlgo =
"migradimproved";
224 if (!data || !pdf ||
fPOI.
getSize() == 0)
return 0;
251 for (
int i = 0; i < fitParams.
getSize(); ++i) {
283 delete constrainedParams;
304 if (!data || !pdf)
return 0;
331 std::vector<double> oldValues(poiList.
getSize() );
332 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
335 oldValues[i] = mytarget->
getVal();
346 RooArgSet nuisParams(*constrainedParams);
352 bool existVarParams =
false;
357 existVarParams =
true;
363 if (existVarParams) {
370 nLLatCondMLE = fit2->
minNll();
380 nLLatCondMLE = nll->
getVal();
386 Double_t deltaNLL = std::max( nLLatCondMLE-nLLatMLE, 0.);
395 if (ndf == 1) pvalue = 0.5 * pvalue;
401 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
404 mytarget->
setVal(oldValues[i] );
409 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
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 R__SUGGEST_ALTERNATIVE("begin()
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...
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)
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 fundamental (non-derived) real valued object.
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.
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...
Template specialisation used in RooAbsArg:
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)
Namespace for the RooStats classes.
void RemoveConstantParameters(RooArgSet *set)