CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProfiledLikelihoodRatioTestStat.cc
Go to the documentation of this file.
1 #include "../interface/ProfiledLikelihoodRatioTestStat.h"
2 #include "../interface/CloseCoutSentry.h"
3 #include <stdexcept>
4 #include <RooRealVar.h>
5 
6 Double_t ProfiledLikelihoodRatioTestStat::Evaluate(RooAbsData& data, RooArgSet& nullPOI)
7 {
8  if (data.numEntries() != 1) throw std::invalid_argument("HybridNew::TestSimpleStatistics: dataset doesn't have exactly 1 entry.");
9  CloseCoutSentry(true);
10 
11  const RooArgSet *entry = data.get(0);
12  *paramsNull_ = *entry;
15  *paramsNull_ = nullPOI;
16 
17  pdfNull_->fitTo(data, RooFit::Constrain(nuisances_), RooFit::Hesse(0), RooFit::PrintLevel(-1), RooFit::PrintEvalErrors(-1));
18  double nullNLL = pdfNull_->getVal();
19 
20  *paramsAlt_ = *entry;
23 
24  pdfAlt_->fitTo(data, RooFit::Constrain(nuisances_), RooFit::Hesse(0), RooFit::PrintLevel(-1), RooFit::PrintEvalErrors(-1));
25 
26  double altNLL = pdfAlt_->getVal();
27  return -log(nullNLL/altNLL);
28 }
29 
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
virtual Double_t Evaluate(RooAbsData &data, RooArgSet &nullPOI)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82