83 ProfileLikelihoodCalculator::ProfileLikelihoodCalculator() :
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) {
267 TString
name = TString(
"LikelihoodInterval_");
283 delete constrainedParams;
302 if (!data || !pdf)
return 0;
329 std::vector<double> oldValues(poiList.
getSize() );
330 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
333 oldValues[i] = mytarget->
getVal();
344 RooArgSet nuisParams(*constrainedParams);
350 bool existVarParams =
false;
355 existVarParams =
true;
361 if (existVarParams) {
368 nLLatCondMLE = fit2->
minNll();
378 nLLatCondMLE = nll->
getVal();
384 Double_t deltaNLL = std::max( nLLatCondMLE-nLLatMLE, 0.);
393 if (ndf == 1) pvalue = 0.5 * pvalue;
395 TString
name = TString(
"ProfileLRHypoTestResult_");
399 for (
unsigned int i = 0; i < oldValues.size(); ++i) {
402 mytarget->
setVal(oldValues[i] );
407 delete constrainedParams;
virtual RooAbsReal * createNLL(RooAbsData &data, const RooLinkedList &cmdList)
Construct representation of -log(L) of PDFwith given dataset.
virtual const char * GetName() const
Returns name of object.
RooAbsReal * DoGlobalFit() const
RooCmdArg Offset(Bool_t flag=kTRUE)
TIterator * createIterator(Bool_t dir=kIterForward) const
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
const RooArgList & floatParsFinal() const
void optimizeConst(Int_t flag)
If flag is true, perform constant term optimization on function being minimized.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual LikelihoodInterval * GetInterval() const
Return a likelihood interval.
static int DefaultStrategy()
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
RooCmdArg CloneData(Bool_t flag)
Double_t getVal(const RooArgSet *set=0) const
static RooFitResult * DoMinimizeNLL(RooAbsReal *nll)
RooFitResult * fFitResult
virtual HypoTestResult * GetHypoTest() const
Return the hypothesis test result obtained from the likelihood ratio of the maximum likelihood value ...
HypoTestResult is a base class for results from hypothesis tests.
RooAbsPdf * GetPdf() const
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
virtual Int_t defaultPrintContents(Option_t *opt) const
Configure default contents to be printed.
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
ProfileLikelihoodCalculator()
Default constructor (needed for I/O)
void setEps(Double_t eps)
Change MINUIT epsilon.
void setStrategy(Int_t strat)
Change MINUIT strategy to istrat.
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Configure mapping of Print() arguments to RooPrintable print styles.
RooRealVar represents a fundamental (non-derived) real valued object.
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...
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooCmdArg GlobalObservables(const RooArgSet &globs)
RooAbsData * GetData() const
static const std::string & DefaultMinimizerType()
void setConstant(Bool_t value=kTRUE)
RooFitResult * save(const char *name=0, const char *title=0)
Save and return a RooFitResult snaphot of current minimizer status.
RooArgSet fConditionalObs
static int DefaultPrintLevel()
RooAbsData is the common abstract base class for binned and unbinned datasets.
CombinedCalculator is an interface class for a tools which can produce both RooStats HypoTestResults ...
static const std::string & DefaultMinimizerAlgo()
Namespace for the RooStats classes.
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
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...
Int_t minimize(const char *type, const char *alg=0)
virtual ~ProfileLikelihoodCalculator()
destructor cannot delete prod pdf because it will delete all the composing pdf's if (fOwnPdf) delete ...
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (e.g 0.682 for a 1-sigma interval)
const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
Int_t setPrintLevel(Int_t newLevel)
Change the MINUIT internal printing level.
void RemoveConstantParameters(RooArgSet *set)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
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...
RooMinimizer is a wrapper class around ROOT::Fit:Fitter that provides a seamless interface between th...
virtual RooAbsReal * createProfile(const RooArgSet ¶msOfInterest)
Create a RooProfileLL object that eliminates all nuisance parameters in the present function...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
static double DefaultTolerance()
RooCmdArg ConditionalObservables(const RooArgSet &set)
Double_t getError() const
Bool_t isConstant() const
RooCmdArg Constrain(const RooArgSet ¶ms)
void setError(Double_t value)