50 #ifndef RooStats_ProfileLikelihoodCalculator
54 #ifndef RooStats_RooStatsUtils
76 using namespace RooFit;
77 using namespace RooStats;
83 ProfileLikelihoodCalculator::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;
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();
393 if (ndf == 1) pvalue = 0.5 * pvalue;
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.
RooCmdArg Offset(Bool_t flag=kTRUE)
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)
void optimizeConst(Int_t flag)
If flag is true, perform constant term optimization on function being minimized.
const RooArgList & floatParsFinal() const
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
static int DefaultStrategy()
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'.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
RooCmdArg CloneData(Bool_t flag)
static RooFitResult * DoMinimizeNLL(RooAbsReal *nll)
RooFitResult * fFitResult
HypoTestResult is a base class for results from hypothesis tests.
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
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 LikelihoodInterval * GetInterval() const
Return a likelihood interval.
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
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...
RooAbsReal * DoGlobalFit() const
RooRealVar represents a fundamental (non-derived) real valued object.
ClassImp(RooStats::ProfileLikelihoodCalculator)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooAbsArg * find(const char *name) const
Find object with given name in list.
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()
virtual const char * GetName() const
Returns name of object.
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 ...
Bool_t isConstant() const
static const std::string & DefaultMinimizerAlgo()
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Configure mapping of Print() arguments to RooPrintable print styles.
virtual HypoTestResult * GetHypoTest() const
Return the hypothesis test result obtained from the likelihood ratio of the maximum likelihood value ...
RooAbsPdf * GetPdf() const
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 ...
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (e.g 0.682 for a 1-sigma interval)
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...
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add clone of specified element to an owning set.
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)
virtual Int_t defaultPrintContents(Option_t *opt) const
Configure default contents to be printed.
RooAbsData * GetData() const
RooCmdArg Constrain(const RooArgSet ¶ms)
const char * GetName() const
Returns name of object.
void setError(Double_t value)
Double_t getError() const