55 if (fDetailedOutputEnabled) {
56 fDetailedOutput = std::make_unique<RooArgSet>();
68 if (fPrintLevel > 1) {
69 std::cout <<
"POIs: " << std::endl;
77 bool reuse=(fReuseNll || fgAlwaysReuseNll) ;
80 if (!
reuse || fNll==
nullptr) {
81 std::unique_ptr<RooArgSet> allParams{fPdf->getParameters(
data)};
88 if (fPrintLevel > 0) {
89 std::cout <<
"ProfileLikelihoodTestStat::Evaluate - Use Offset mode \""
90 << fLOffset <<
"\" in creating NLL" << std::endl;
94 if (fPrintLevel > 1) std::cout <<
"creating NLL " << &*fNll <<
" with data = " << &
data << std::endl ;
97 if (fPrintLevel > 1) std::cout <<
"reusing NLL " << &*fNll <<
" new data = " << &
data << std::endl ;
98 fNll->setData(
data,
false) ;
101 if (fPrintLevel > 1 &&
data.numEntries() == 1) {
102 std::cout <<
"Data set used is: ";
108 std::unique_ptr<RooArgSet>
attachedSet{fNll->getVariables()};
133 fNll->clearEvalErrorLog();
134 if (fPrintLevel>1) std::cout <<
"Do unconditional fit" << std::endl;
135 std::unique_ptr<RooFitResult>
result{GetMinNLL()};
144 if( fDetailedOutputEnabled ) {
166 if (!fSigned &&
type==0 &&
175 if (fPrintLevel>1) std::cout <<
"Do conditional fit " << std::endl;
195 if (allParams.
empty() ) {
202 fNll->clearEvalErrorLog();
203 std::unique_ptr<RooFitResult>
result{GetMinNLL()};
207 if( fDetailedOutputEnabled ) {
227 if (fLOffset ==
"initial") {
229 pll = fNll->getVal();
234 }
else if (
type == 2) {
245 if (fPrintLevel > 0) std::cout <<
"pll is negative - setting it to zero " << std::endl;
254 if (fPrintLevel > 0) {
255 std::cout <<
"EvaluateProfileLikelihood - ";
259 std::cout <<
", cond ML = " <<
condML;
261 std::cout <<
" pll = " << pll;
294 minim.setStrategy(fStrategy);
295 minim.setEvalErrorWall(config.useEvalErrorWall);
297 int level = (fPrintLevel == 0) ? -1 : fPrintLevel -2;
298 minim.setPrintLevel(level);
299 minim.setEps(fTolerance);
301 minim.optimizeConst(2);
302 TString minimizer = fMinimizer;
308 if (status%1000 == 0) {
311 std::cout <<
" ----> Doing a re-scan first" << std::endl;
312 minim.minimize(minimizer,
"Scan");
314 if (fStrategy == 0 ) {
315 std::cout <<
" ----> trying with strategy = 1" << std::endl;
316 minim.setStrategy(1);
322 std::cout <<
" ----> trying with improve" << std::endl;
323 minimizer =
"Minuit";
330 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).