21 if (fFirstEval && ParamsAreEqual()) {
23 <<
"Same RooArgSet used for null and alternate, so you must explicitly SetNullParameters and SetAlternateParameters or the likelihood ratio will always be 1."
38 Bool_t reuse = (fReuseNll || fgAlwaysReuseNll) ;
42 RooArgSet* allParams = fNullPdf->getParameters(data);
47 if (reuse && !created) {
48 fNllNull->setData(data,
kFALSE) ;
52 RooArgSet* attachedSet = fNllNull->getVariables();
53 *attachedSet = *fNullParameters;
54 *attachedSet = nullPOI;
55 double nullNLL = fNllNull->getVal();
62 delete fNllNull ; fNllNull =
NULL ;
68 RooArgSet* allParams = fAltPdf->getParameters(data);
73 if (reuse && !created) {
74 fNllAlt->setData(data,
kFALSE) ;
77 attachedSet = fNllAlt->getVariables();
78 *attachedSet = *fAltParameters;
79 double altNLL = fNllAlt->getVal();
89 delete fNllAlt ; fNllAlt =
NULL ;
96 if( fDetailedOutputEnabled ) {
97 if( !fDetailedOutput ) {
98 fDetailedOutput =
new RooArgSet( *(
new RooRealVar(
"nullNLL",
"null NLL",0)),
"detailedOut_SLRTS" );
99 fDetailedOutput->add( *(
new RooRealVar(
"altNLL",
"alternate NLL",0)) );
101 fDetailedOutput->setRealValue(
"nullNLL", nullNLL );
102 fDetailedOutput->setRealValue(
"altNLL", altNLL );
111 return nullNLL - altNLL;
RooCmdArg CloneData(Bool_t flag)
static RooMsgService & instance()
Return reference to singleton instance.
virtual Double_t Evaluate(RooAbsData &data, RooArgSet &nullPOI)
Main interface to evaluate the test statistic on a dataset given the values for the Null Parameters O...
RooFit::MsgLevel globalKillBelow() const
RooAbsPdf * MakeUnconstrainedPdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name=NULL)
void setGlobalKillBelow(RooFit::MsgLevel level)
static void SetAlwaysReuseNLL(Bool_t flag)
static Bool_t fgAlwaysReuseNll
transient copy of the alt NLL
RooCmdArg ConditionalObservables(const RooArgSet &set)
RooCmdArg Constrain(const RooArgSet ¶ms)