42using std::cout, std::endl;
57 if (fDetailedOutputEnabled) {
58 fDetailedOutput = std::make_unique<RooArgSet>();
70 if (fPrintLevel > 1) {
71 cout <<
"POIs: " << endl;
79 bool reuse=(fReuseNll || fgAlwaysReuseNll) ;
82 if (!
reuse || fNll==
nullptr) {
83 std::unique_ptr<RooArgSet> allParams{fPdf->getParameters(
data)};
90 if (fPrintLevel > 0 && fLOffset) cout <<
"ProfileLikelihoodTestStat::Evaluate - Use Offset in creating NLL " << endl ;
93 if (fPrintLevel > 1) cout <<
"creating NLL " << &*fNll <<
" with data = " << &
data << endl ;
96 if (fPrintLevel > 1) cout <<
"reusing NLL " << &*fNll <<
" new data = " << &
data << endl ;
97 fNll->setData(
data,
false) ;
100 if (fPrintLevel > 1 &&
data.numEntries() == 1) {
101 std::cout <<
"Data set used is: ";
107 std::unique_ptr<RooArgSet>
attachedSet{fNll->getVariables()};
132 fNll->clearEvalErrorLog();
133 if (fPrintLevel>1) std::cout <<
"Do unconditional fit" << std::endl;
134 std::unique_ptr<RooFitResult>
result{GetMinNLL()};
143 if( fDetailedOutputEnabled ) {
165 if (!fSigned &&
type==0 &&
174 if (fPrintLevel>1) std::cout <<
"Do conditional fit " << std::endl;
194 if (allParams.
empty() ) {
201 fNll->clearEvalErrorLog();
202 std::unique_ptr<RooFitResult>
result{GetMinNLL()};
206 if( fDetailedOutputEnabled ) {
228 pll = fNll->getVal();
233 }
else if (
type == 2) {
244 if (fPrintLevel > 0) std::cout <<
"pll is negative - setting it to zero " << std::endl;
253 if (fPrintLevel > 0) {
254 std::cout <<
"EvaluateProfileLikelihood - ";
258 std::cout <<
", cond ML = " <<
condML;
260 std::cout <<
" pll = " << pll;
293 minim.setStrategy(fStrategy);
294 minim.setEvalErrorWall(config.useEvalErrorWall);
296 int level = (fPrintLevel == 0) ? -1 : fPrintLevel -2;
297 minim.setPrintLevel(level);
298 minim.setEps(fTolerance);
300 minim.optimizeConst(2);
301 TString minimizer = fMinimizer;
307 if (status%1000 == 0) {
310 cout <<
" ----> Doing a re-scan first" << endl;
311 minim.minimize(minimizer,
"Scan");
313 if (fStrategy == 0 ) {
314 cout <<
" ----> trying with strategy = 1" << endl;
315 minim.setStrategy(1);
321 cout <<
" ----> trying with improve" << endl;
322 minimizer =
"Minuit";
329 return std::unique_ptr<RooFitResult>{
minim.save()};
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static const std::string & DefaultMinimizerAlgo()
Abstract base class for binned and unbinned datasets.
static void setHideOffset(bool flag)
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...
static RooMsgService & instance()
Return reference to singleton instance.
Variable that can be changed from the outside.
static RooArgSet * GetAsArgSet(RooFitResult *result, TString prefix="", bool withErrorsAndPulls=false)
Translate the given fit result to a RooArgSet in a generic way.
static void SetAlwaysReuseNLL(bool flag)
static bool fgAlwaysReuseNll
virtual double EvaluateProfileLikelihood(int type, RooAbsData &data, RooArgSet ¶msOfInterest)
evaluate the profile likelihood ratio (type = 0) or the minimum of likelihood (type=1) or the conditi...
std::unique_ptr< RooFitResult > GetMinNLL()
find minimum of NLL using RooMinimizer
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.
MsgLevel
Verbosity level for RooMsgService::StreamConfig in RooMsgService.
void RemoveConstantParameters(RooArgSet *set)
RooStatsConfig & GetGlobalRooStatsConfig()
Retrieve the config object which can be used to set flags for things like offsetting the likelihood o...
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
useful function to print in one line the content of a set with their values
Double_t SignalingNaN()
Returns a signaling NaN as defined by IEEE 754](http://en.wikipedia.org/wiki/NaN#Signaling_NaN).