32 if (fFirstEval && ParamsAreEqual()) {
33 oocoutW(fNullParameters,InputArguments)
34 <<
"Same RooArgSet used for null and alternate, so you must explicitly SetNullParameters and SetAlternateParameters or the likelihood ratio will always be 1."
49 bool reuse = (fReuseNll || fgAlwaysReuseNll) ;
51 bool created = false ;
53 std::unique_ptr<RooArgSet> allParams{fNullPdf->getParameters(
data)};
55 fNllNull = std::unique_ptr<RooAbsReal>{fNullPdf->createNLL(
data, CloneData(
false), Constrain(*allParams), GlobalObservables(fGlobalObs), ConditionalObservables(fConditionalObs))};
58 if (reuse && !created) {
59 fNllNull->setData(
data,
false) ;
63 std::unique_ptr<RooArgSet> attachedSet{fNllNull->getVariables()};
64 attachedSet->assign(*fNullParameters);
65 attachedSet->assign(nullPOI);
66 double nullNLL = fNllNull->getVal();
78 std::unique_ptr<RooArgSet> allParams{fAltPdf->getParameters(
data)};
80 fNllAlt = std::unique_ptr<RooAbsReal>{fAltPdf->createNLL(
data, CloneData(
false), Constrain(*allParams), GlobalObservables(fGlobalObs), ConditionalObservables(fConditionalObs))};
83 if (reuse && !created) {
84 fNllAlt->setData(
data,
false) ;
87 attachedSet = std::unique_ptr<RooArgSet>{fNllAlt->getVariables()};
88 attachedSet->assign(*fAltParameters);
89 double altNLL = fNllAlt->getVal();
105 if( fDetailedOutputEnabled ) {
106 if( !fDetailedOutput ) {
107 fDetailedOutput =
new RooArgSet( *(
new RooRealVar(
"nullNLL",
"null NLL",0)),
"detailedOut_SLRTS" );
108 fDetailedOutput->add( *(
new RooRealVar(
"altNLL",
"alternate NLL",0)) );
110 fDetailedOutput->setRealValue(
"nullNLL", nullNLL );
111 fDetailedOutput->setRealValue(
"altNLL", altNLL );
120 return nullNLL - altNLL;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static RooMsgService & instance()
Return reference to singleton instance.
void setGlobalKillBelow(RooFit::MsgLevel level)
RooFit::MsgLevel globalKillBelow() const
RooRealVar represents a variable that can be changed from the outside.
static void SetAlwaysReuseNLL(bool flag)
double Evaluate(RooAbsData &data, RooArgSet &nullPOI) override
Main interface to evaluate the test statistic on a dataset given the values for the Null Parameters O...
static bool fgAlwaysReuseNll
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
RooAbsPdf * MakeUnconstrainedPdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name=nullptr)
remove constraints from pdf and return the unconstrained pdf