121 if (!
data || !pdf )
return nullptr;
138 oocoutP(
nullptr,
Minimization) <<
"ProfileLikelihoodCalcultor::DoGLobalFit - find MLE " << std::endl;
147 oocoutW(
nullptr,
Minimization) <<
"ProfileLikelihoodCalcultor::DoGlobalFit - Global fit failed - status = " <<
fFitResult->status() << std::endl;
171 minim.setPrintLevel(level);
172 minim.optimizeConst(2);
173 minim.setEvalErrorWall(config.useEvalErrorWall);
181 if (status%1000 == 0) {
184 std::cout <<
" ----> Doing a re-scan first" << std::endl;
188 std::cout <<
" ----> trying with strategy = 1" << std::endl;
189 minim.setStrategy(1);
195 std::cout <<
" ----> trying with improve" << std::endl;
228 if (!nll)
return nullptr;
234 std::unique_ptr<RooAbsReal> profile{nll->createProfile(
fPOI)};
235 profile->addOwnedComponents(std::move(nll)) ;
240 for (std::size_t i = 0; i < fitParams.
size(); ++i) {
262 for (
auto const *arg :
fPOI){
291 if (!
data || !pdf)
return nullptr;
303 if (!nll)
return nullptr;
318 for (
unsigned int i = 0; i <
oldValues.size(); ++i) {
340 if ( !
myarg->isConstant() ) {
348 oocoutP(
nullptr,
Minimization) <<
"ProfileLikelihoodCalcultor::GetHypoTest - do conditional fit " << std::endl;
357 if (
fit2->status() != 0)
358 oocoutW(
nullptr,
Minimization) <<
"ProfileLikelihoodCalcultor::GetHypotest - Conditional fit failed - status = " <<
fit2->status() << std::endl;
385 for (
unsigned int i = 0; i <
oldValues.size(); ++i) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
static int DefaultPrintLevel()
static double DefaultTolerance()
static const std::string & DefaultMinimizerAlgo()
static int DefaultStrategy()
Common abstract base class for objects that represent a value and a "shape" in RooFit.
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Storage_t::size_type size() const
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
RooFit::OwningPtr< RooAbsReal > createNLL(RooAbsData &data, CmdArgs_t const &... cmdArgs)
Construct representation of -log(L) of PDF with given dataset.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
void setError(double value)
CombinedCalculator is an interface class for a tools which can produce both RooStats HypoTestResults ...
RooArgSet fNullParams
RooArgSet specifying null parameters for hypothesis test.
RooArgSet fPOI
RooArgSet specifying parameters of interest for interval.
RooAbsData * GetData() const
RooArgSet fGlobalObs
RooArgSet specifying the global observables.
RooAbsPdf * GetPdf() const
double fSize
size of the test (eg. specified rate of Type I error)
RooArgSet fConditionalObs
RooArgSet specifying the conditional observables.
HypoTestResult is a base class for results from hypothesis tests.
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
RooAbsPdf * GetPdf() const
get model PDF (return nullptr if pdf has not been specified or does not exist)
std::unique_ptr< RooFitResult > fFitResult
static RooFit::OwningPtr< RooFitResult > DoMinimizeNLL(RooAbsReal *nll)
minimize likelihood
HypoTestResult * GetHypoTest() const override
Return the hypothesis test result obtained from the likelihood ratio of the maximum likelihood value ...
RooFit::OwningPtr< RooAbsReal > DoGlobalFit() const
perform a global fit
bool fGlobalFitDone
flag to control if a global fit has been done
~ProfileLikelihoodCalculator() override
destructor cannot delete prod pdf because it will delete all the composing pdf's if (fOwnPdf) delete ...
void DoReset() const
clear internal fit result
LikelihoodInterval * GetInterval() const override
Return a likelihood interval.
ProfileLikelihoodCalculator()
Default constructor (needed for I/O)
RooCmdArg Offset(std::string const &mode)
RooCmdArg Constrain(const RooArgSet ¶ms)
RooCmdArg GlobalObservables(Args_t &&... argsOrArgSet)
RooCmdArg CloneData(bool flag)
RooCmdArg ConditionalObservables(Args_t &&... argsOrArgSet)
Create a RooCmdArg to declare conditional observables.
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...
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
OwningPtr< T > makeOwningPtr(std::unique_ptr< T > &&ptr)
Internal helper to turn a std::unique_ptr<T> into an OwningPtr.
Namespace for the RooStats classes.
void RemoveConstantParameters(RooArgSet *set)
std::string const & NLLOffsetMode()
Test what offsetting mode RooStats should use by default.
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...