Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
xRooNLLVar.h
Go to the documentation of this file.
1/*
2 * Project: xRooFit
3 * Author:
4 * Will Buttinger, RAL 2022
5 *
6 * Copyright (c) 2022, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#include "Config.h"
14
15#ifdef XROOFIT_USE_PRAGMA_ONCE
16#pragma once
17#endif
18#if !defined(XROOFIT_XROONLLVAR_H) || defined(XROOFIT_USE_PRAGMA_ONCE)
19#ifndef XROOFIT_USE_PRAGMA_ONCE
20#define XROOFIT_XROONLLVAR_H
21#endif
22
23#include "xRooFit.h"
24
25#include <RooFitResult.h>
26#include <RooLinkedList.h>
27
28#include <Fit/FitConfig.h>
29#include <Math/IOptions.h>
30#include <TAttFill.h>
31#include <TAttLine.h>
32#include <TAttMarker.h>
33
34#include <map>
35#include <set>
36
37class RooAbsReal;
38class RooAbsPdf;
39class RooAbsData;
42class RooRealVar;
43class RooCmdArg;
44
45class TGraph;
46class TGraphErrors;
47class TMultiGraph;
48class TFile;
49
50namespace RooStats {
51class HypoTestResult;
52class HypoTestInverterResult;
53} // namespace RooStats
54
56
57class xRooNode;
58
59class xRooNLLVar : public std::shared_ptr<RooAbsReal> {
60
61public:
62 struct xValueWithError : public std::pair<double, double> {
63 xValueWithError(const std::pair<double, double> &in = {0, 0}) : std::pair<double, double>(in) {}
64 double value() const { return std::pair<double, double>::first; }
65 double error() const { return std::pair<double, double>::second; }
66 };
67
68 void Print(Option_t *opt = "");
69
70 xRooNLLVar(RooAbsPdf &pdf, const std::pair<RooAbsData *, const RooAbsCollection *> &data,
72 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf, const std::shared_ptr<RooAbsData> &data,
74 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf,
75 const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &data,
77
79
80 // whenever implicitly converted to a RooAbsReal we will make sure our globs are set
81 RooAbsReal *get() const { return func().get(); }
82 RooAbsReal *operator->() const { return get(); }
83
84 void reinitialize();
85
86 void AddOption(const RooCmdArg &opt);
87
88 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
89 getData() const; // returns pointer to data and snapshot of globs
90 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
91 generate(bool expected = false, int seed = 0);
92 // std::shared_ptr<const RooFitResult> snapshot();
93
94 class xRooFitResult : public std::shared_ptr<const RooFitResult> {
95 public:
96 xRooFitResult(const RooFitResult &fr);
97 xRooFitResult(const std::shared_ptr<xRooNode> &in,
98 const std::shared_ptr<xRooNLLVar> &nll = nullptr); // : fNode(in) { }
99 const RooFitResult *operator->() const;
100 // operator std::shared_ptr<const RooFitResult>() const;
101 operator const RooFitResult *() const;
102 void Draw(Option_t *opt = "");
103
104 std::shared_ptr<xRooNLLVar> nll() const { return fNll; }
105
107 {
108 return get()
109 ? RooArgList(*std::unique_ptr<RooAbsCollection>(get()->floatParsFinal().selectByAttrib("poi", true)))
110 : RooArgList();
111 }
112
113 // generate a conditional fit using the given poi set to the given values
114 // alias is used to store the fit result in the map under a different name
115 xRooFitResult cfit(const char *poiValues, const char *alias = nullptr);
116 // generate the conditional fit required for an impact calculation
117 xRooFitResult ifit(const char *np, bool up, bool prefit = false);
118 // calculate the impact on poi due to np. if approx is true, will use the covariance approximation instead
119 double impact(const char *poi, const char *np, bool up = true, bool prefit = false, bool approx = false);
120 double impact(const char *np, bool up = true, bool prefit = false, bool approx = false)
121 {
122 auto _poi = poi();
123 if (_poi.size() != 1)
124 throw std::runtime_error("xRooFitResult::impact: not one POI");
125 return impact(poi().contentsString().c_str(), np, up, prefit, approx);
126 }
127
128 // calculate error on poi conditional on the given NPs being held constant at their post-fit values
129 // The conditional error is often presented as the difference in quadrature to the total error i.e.
130 // error contribution due to conditional NPs = sqrt( pow(totError,2) - pow(condError,2) )
131 double conditionalError(const char *poi, const char *nps, bool up = true, bool approx = false);
132
133 // rank all the np based on impact ... will use the covariance approximation if full impact not available
134 // the approxThreshold sets the level below which the approximation will be returned
135 // e.g. set it to 0 to not do approximation
136 RooArgList ranknp(const char *poi, bool up = true, bool prefit = false,
137 double approxThreshold = std::numeric_limits<double>::infinity());
138 // version that assumes only one parameter is poi
140 ranknp(bool up = true, bool prefit = false, double approxThreshold = std::numeric_limits<double>::infinity())
141 {
142 auto _poi = poi();
143 if (_poi.size() != 1)
144 throw std::runtime_error("xRooFitResult::ranknp: not one POI");
145 return ranknp(poi().contentsString().c_str(), up, prefit, approxThreshold);
146 }
147
148 std::shared_ptr<xRooNode> fNode;
149 std::shared_ptr<xRooNLLVar> fNll;
150
151 std::shared_ptr<std::map<std::string, xRooFitResult>> fCfits;
152 };
153
154 xRooFitResult minimize(const std::shared_ptr<ROOT::Fit::FitConfig> & = nullptr);
155
156 void SetFitConfig(const std::shared_ptr<ROOT::Fit::FitConfig> &in) { fFitConfig = in; }
157 std::shared_ptr<ROOT::Fit::FitConfig> fitConfig(); // returns fit config, or creates a default one if not existing
158 ROOT::Math::IOptions *fitConfigOptions(); // return pointer to non-const version of the options inside the fit config
159
160 class xRooHypoPoint : public TNamed {
161 public:
162 xRooHypoPoint(std::shared_ptr<RooStats::HypoTestResult> htr = nullptr, const RooAbsCollection *_coords = nullptr);
163 static std::set<int> allowedStatusCodes;
164 void Print(Option_t *opt = "") const override;
165 void Draw(Option_t *opt = "") override;
166
167 // status bitmask of the available fit results
168 // 0 = all ok
169 int status() const;
170
171 xValueWithError pll(bool readOnly = false); // observed test statistic value
172 xValueWithError sigma_mu(bool readOnly = false); // estimate of sigma_mu parameter
173 std::shared_ptr<const RooFitResult> ufit(bool readOnly = false);
174 std::shared_ptr<const RooFitResult> cfit_null(bool readOnly = false);
175 std::shared_ptr<const RooFitResult> cfit_alt(bool readOnly = false);
176 std::shared_ptr<const RooFitResult> cfit_lbound(bool readOnly = false); // cfit @ the lower bound of mu
177 std::shared_ptr<const RooFitResult> gfit() { return fGenFit; } // non-zero if data was generated
178
179 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> fData;
180 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> data();
181
182 xValueWithError getVal(const char *what);
183
184 // leave nSigma=NaN for observed p-value
185 xValueWithError pNull_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
186 xValueWithError pAlt_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
187 xValueWithError pCLs_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
188 xValueWithError ts_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
189
190 xValueWithError pNull_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
191 xValueWithError pAlt_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
192 xValueWithError pCLs_toys(double nSigma = std::numeric_limits<double>::quiet_NaN())
193 {
194 if (fNullVal() == fAltVal())
195 return std::pair<double, double>(1, 0); // by construction
196 auto null = pNull_toys(nSigma);
197 auto alt = pAlt_toys(nSigma);
198 double nom = (null.first == 0) ? 0 : null.first / alt.first;
199 // double up = (null.first + null.second == 0) ? 0 : ((alt.first-alt.second<=0) ?
200 // std::numeric_limits<double>::infinity() : (null.first + null.second)/(alt.first - alt.second)); double down
201 // = (null.first - null.second == 0) ? 0 : (null.first - null.second)/(alt.first + alt.second);
202 // old way ... now doing like in pCLs_asymp by calculating the two variations ... but this is pessimistic
203 // assumes p-values are anticorrelated!
204 // so reverting to old
205 return std::pair<double, double>(nom, (alt.first - alt.second <= 0)
206 ? std::numeric_limits<double>::infinity()
207 : (sqrt(pow(null.second, 2) + pow(alt.second * nom, 2)) / alt.first));
208 // return std::pair(nom,std::max(std::abs(up - nom), std::abs(down - nom)));
209 }
210 xValueWithError ts_toys(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
211
212 // Create a HypoTestResult representing the current state of this hypoPoint
214
215 xRooHypoPoint generateNull(int seed = 0);
216 xRooHypoPoint generateAlt(int seed = 0);
217
218 void
219 addNullToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
220 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
221 void
222 addAltToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
223 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
224 void
225 addCLsToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
226 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
227
228 RooArgList poi() const;
229 RooArgList alt_poi() const; // values of the poi in the alt hypothesis (will be nans if not defined)
230 RooRealVar &mu_hat(); // throws exception if ufit not available
231
232 std::shared_ptr<xRooHypoPoint>
233 asimov(bool readOnly =
234 false); // a two-sided hypoPoint with the alt hypothesis asimov dataset (used in sigma_mu() calculation)
235
236 // std::string fPOIName;
237 const char *fPOIName();
238 xRooFit::Asymptotics::PLLType fPllType = xRooFit::Asymptotics::Unknown;
239 // double fNullVal=1; double fAltVal=0;
240 double fNullVal();
241 double fAltVal();
242
243 std::shared_ptr<const RooAbsCollection> coords; // pars of the nll that will be held const alongside POI
244
245 std::shared_ptr<const RooFitResult> fUfit, fNull_cfit, fAlt_cfit, fLbound_cfit;
246 std::shared_ptr<const RooFitResult> fGenFit; // if the data was generated, this is the fit is was generated from
247 bool isExpected = false; // if genFit, flag says is asimov or not
248
249 std::shared_ptr<xRooHypoPoint>
250 fAsimov; // same as this point but pllType is twosided and data is expected post alt-fit
251
252 // first is seed, second is ts value, third is weight
253 std::vector<std::tuple<int, double, double>> nullToys; // would have to save these vectors for specific: null_cfit
254 // (genPoint), ufit, poiName, pllType, nullVal
255 std::vector<std::tuple<int, double, double>> altToys;
256
257 std::shared_ptr<xRooNLLVar> nllVar = nullptr; // hypopoints get a copy
258 std::shared_ptr<RooStats::HypoTestResult> hypoTestResult = nullptr;
259 std::shared_ptr<const RooFitResult> retrieveFit(int type);
260
261 TString tsTitle(bool inWords = false) const;
262
263 private:
264 xValueWithError pX_toys(bool alt, double nSigma = std::numeric_limits<double>::quiet_NaN());
265 size_t addToys(bool alt, int nToys, int initialSeed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
266 double target_nSigma = std::numeric_limits<double>::quiet_NaN(), bool targetCLs = false,
267 double relErrThreshold = 2., size_t maxToys = 10000);
268 };
269
270 // use alt_value = nan to skip the asimov calculations
271 xRooHypoPoint hypoPoint(const char *parName, double value,
272 double alt_value = std::numeric_limits<double>::quiet_NaN(),
273 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
274 // same as above but specify parNames and values in a string
276 // this next method requires poi to be flagged in the model already (with "poi" attribute) .. must be exactly one
277 xRooHypoPoint hypoPoint(double value, double alt_value = std::numeric_limits<double>::quiet_NaN(),
278 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
279
280 class xRooHypoSpace : public TNamed,
281 public TAttFill,
282 public TAttMarker,
283 public TAttLine,
284 public std::vector<xRooHypoPoint> {
285 public:
286 friend class xRooNLLVar;
287 xRooHypoSpace(const char *name = "", const char *title = "");
289
290 bool AddModel(const xRooNode &pdf, const char *validity = "");
291
292 void LoadFits(const char *apath);
293
294 // A points over given parameter, number of points between low and high
295 int AddPoints(const char *parName, size_t nPoints, double low, double high);
296
297 void Print(Option_t *opt = "") const override;
298
299 void Draw(Option_t *opt = "") override;
300
301 RooArgList poi();
302 std::shared_ptr<RooArgSet> pars() const { return fPars; };
303 RooArgList axes() const;
304
305 xRooHypoPoint &AddPoint(double value); // adds by using the first axis var
306 xRooHypoPoint &AddPoint(const char *coords = ""); // adds a new point at given coords or returns existing
307
308 xRooHypoPoint &point(size_t i) { return at(i); }
309
310 // build a TGraphErrors of pValues over the existing points
311 // opt should include any of the following:
312 // cls: do pCLs, otherwise do pNull
313 // expX: do expected, X sigma (use +X or -X for contour, otherwise will return band unless X=0)
314 // toys: pvalues from available toys
315 // readonly: don't compute anything, just return available values
316 std::shared_ptr<TGraphErrors> graph(const char *opt) const;
317
318 // return a TMultiGraph containing the set of graphs for a particular visualization
319 std::shared_ptr<TMultiGraph> graphs(const char *opt);
320
321 // will evaluate more points until limit is below given relative uncert
322 xValueWithError findlimit(const char *opt, double relUncert = std::numeric_limits<double>::infinity(),
323 unsigned int maxTries = 20);
324
325 // get currently available limit, with error. Use nSigma = nan for observed limit
326 xValueWithError limit(const char *type = "cls", double nSigma = std::numeric_limits<double>::quiet_NaN()) const;
327 int scan(const char *type, size_t nPoints, double low = std::numeric_limits<double>::quiet_NaN(),
328 double high = std::numeric_limits<double>::quiet_NaN(),
329 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
330 double relUncert = 0.1);
331 int scan(const char *type = "cls",
332 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
333 double relUncert = 0.1)
334 {
335 return scan(type, 0, std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(),
337 }
338 int scan(const char *type, double nSigma, double relUncert = 0.1)
339 {
340 return scan(type, std::vector<double>{nSigma}, relUncert);
341 }
342
343 // key is nSigma or "obs" for observed
344 // will only do obs if "obs" dataset is not a generated dataset
345 std::map<std::string, xValueWithError>
346 limits(const char *opt = "cls",
347 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
348 double relUncert = std::numeric_limits<double>::infinity());
349
350 std::shared_ptr<xRooNode> pdf(const RooAbsCollection &parValues) const;
351 std::shared_ptr<xRooNode> pdf(const char *parValues = "") const;
352
353 // caller needs to take ownership of the returned object
355
356 private:
357 // estimates where corresponding pValues graph becomes equal to 0.05
358 // linearly interpolates log(pVal) when obtaining limits.
359 // returns value and error
360 static xValueWithError GetLimit(const TGraph &pValues, double target = std::numeric_limits<double>::quiet_NaN());
361
362 static RooArgList toArgs(const char *str);
363
364 xRooFit::Asymptotics::PLLType fTestStatType = xRooFit::Asymptotics::Unknown;
365 std::shared_ptr<RooArgSet> fPars;
366
367 std::map<std::shared_ptr<xRooNode>, std::shared_ptr<xRooNLLVar>> fNlls; // existing NLL functions of added pdfs;
368
369 std::set<std::pair<std::shared_ptr<RooArgList>, std::shared_ptr<xRooNode>>> fPdfs;
370
371 std::shared_ptr<TFile> fFitDb;
372 };
373
374 xRooHypoSpace hypoSpace(const char *parName, int nPoints, double low, double high,
375 double alt_value = std::numeric_limits<double>::quiet_NaN(),
376 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
377 xRooHypoSpace hypoSpace(const char *parName = "",
378 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown,
379 double alt_value = std::numeric_limits<double>::quiet_NaN());
380 xRooHypoSpace hypoSpace(int nPoints, double low, double high,
381 double alt_value = std::numeric_limits<double>::quiet_NaN(),
382 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
384 {
385 return hypoSpace(parName, int(tsType), nPoints, -std::numeric_limits<double>::infinity(),
386 std::numeric_limits<double>::infinity());
387 }
388
389 std::shared_ptr<RooArgSet> pars(bool stripGlobalObs = true) const;
390
391 void Draw(Option_t *opt = "");
392
393 TObject *Scan(const RooArgList &scanPars, const std::vector<std::vector<double>> &coords,
395 TObject *Scan(const char *scanPars, const std::vector<std::vector<double>> &coords,
397 TObject *Scan(const char *scanPars, size_t nPoints, double low, double high, size_t nPointsY, double ylow,
398 double yhigh, const RooArgList &profilePars = RooArgList())
399 {
400 std::vector<std::vector<double>> coords;
401 if (nPoints) {
402 double step = (high - low) / (nPoints);
403 for (size_t i = 0; i < nPoints; i++) {
404 std::vector<double> coord({low + step * i});
405 if (nPointsY) {
406 double stepy = (yhigh - ylow) / (nPointsY);
407 for (size_t j = 0; j < nPointsY; j++) {
408 coord.push_back({ylow + stepy * j});
409 coords.push_back(coord);
410 coord.resize(1);
411 }
412 } else {
413 coords.push_back(coord);
414 }
415 }
416 }
417 return Scan(scanPars, coords, profilePars);
418 }
419 TObject *
420 Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars = RooArgList())
421 {
422 return Scan(scanPars, nPoints, low, high, 0, 0, 0, profilePars);
423 }
424
425 std::shared_ptr<RooAbsReal> func() const; // will assign globs when called
426 std::shared_ptr<RooAbsPdf> pdf() const { return fPdf; }
427 RooAbsData *data() const; // returns the data hidden inside the NLLVar if there is some
428 const RooAbsCollection *globs() const { return fGlobs.get(); }
429
430 // NLL = mainTerm + constraintTerm
431 // mainTerm = sum( entryVals ) + extendedTerm + simTerm [+ binnedDataTerm if activated binnedL option]
432 // this is what it should be, at least
433
434 // total nll should be all these values + constraint term + extended term + simTerm [+binnedDataTerm if activated
435 // binnedL option]
436 /*RooAbsReal *mainTerm() const;*/
437 RooConstraintSum *constraintTerm() const;
438
439 double mainTermVal() const;
440 double constraintTermVal() const;
441
442 double getEntryVal(size_t entry) const; // get the Nll value for a specific entry
443 double extendedTermVal() const;
444 double simTermVal() const;
445 double binnedDataTermVal() const;
446 double getEntryBinWidth(size_t entry) const;
447
448 double ndof() const;
449 double saturatedVal() const;
450 [[deprecated("Use saturatedConstraintTermVal()")]] double saturatedConstraintTerm() const
451 {
452 return saturatedConstraintTermVal();
453 }
454 double saturatedConstraintTermVal() const;
455 [[deprecated("Use saturatedMainTermVal()")]] double saturatedMainTerm() const { return saturatedMainTermVal(); }
456 double saturatedMainTermVal() const;
457 double pgof() const; // a goodness-of-fit pvalue based on profile likelihood of a saturated model
458 double mainTermPgof() const;
459 double mainTermNdof() const;
460
461 std::set<std::string> binnedChannels() const;
462
463 // change the dataset - will check globs are the same
464 bool setData(const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &_data);
465 bool setData(const std::shared_ptr<RooAbsData> &data, const std::shared_ptr<const RooAbsCollection> &globs)
466 {
467 return setData(std::make_pair(data, globs));
468 }
469 bool setData(const xRooNode &data);
470
471 // using shared ptrs everywhere, even for RooLinkedList which needs custom deleter to clear itself
472 // but still work ok for assignment operations
473 std::shared_ptr<RooAbsPdf> fPdf;
474 std::shared_ptr<RooAbsData> fData;
475 std::shared_ptr<const RooAbsCollection> fGlobs;
476
477 std::shared_ptr<RooLinkedList> fOpts;
478 std::shared_ptr<ROOT::Fit::FitConfig> fFitConfig;
479
480 std::shared_ptr<RooAbsCollection> fFuncVars;
481 std::shared_ptr<RooAbsCollection> fConstVars;
482 std::shared_ptr<RooAbsCollection> fFuncGlobs;
483 std::string fFuncCreationLog; // messaging from when function was last created -- to save from printing to screen
484
485 bool kReuseNLL = true;
486};
487
488namespace cling {
489std::string printValue(const xRooNLLVar::xValueWithError *val);
490std::string printValue(const std::map<std::string, xRooNLLVar::xValueWithError> *m);
491} // namespace cling
492
494
495#endif // include guard
const char Option_t
Definition RtypesCore.h:66
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 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 target
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 np
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 value
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
char name[80]
Definition TGX11.cxx:110
void Print(GNN_Data &d, std::string txt="")
double impact(const char *poi, const char *np, bool up=true, bool prefit=false, bool approx=false)
RooArgList ranknp(bool up=true, bool prefit=false, double approxThreshold=std::numeric_limits< double >::infinity())
Definition xRooNLLVar.h:140
std::shared_ptr< xRooNLLVar > nll() const
Definition xRooNLLVar.h:104
double impact(const char *np, bool up=true, bool prefit=false, bool approx=false)
Definition xRooNLLVar.h:120
std::shared_ptr< std::map< std::string, xRooFitResult > > fCfits
Definition xRooNLLVar.h:151
std::pair< std::shared_ptr< RooAbsData >, std::shared_ptr< const RooAbsCollection > > fData
Definition xRooNLLVar.h:179
std::vector< std::tuple< int, double, double > > altToys
Definition xRooNLLVar.h:255
std::shared_ptr< const RooAbsCollection > coords
Definition xRooNLLVar.h:243
std::vector< std::tuple< int, double, double > > nullToys
Definition xRooNLLVar.h:253
std::shared_ptr< const RooFitResult > fAlt_cfit
Definition xRooNLLVar.h:245
std::shared_ptr< const RooFitResult > fGenFit
Definition xRooNLLVar.h:246
xValueWithError pCLs_toys(double nSigma=std::numeric_limits< double >::quiet_NaN())
Definition xRooNLLVar.h:192
std::shared_ptr< const RooFitResult > gfit()
Definition xRooNLLVar.h:177
std::shared_ptr< RooArgSet > pars() const
Definition xRooNLLVar.h:302
int scan(const char *type="cls", const std::vector< double > &nSigmas={0, 1, 2, -1, -2, std::numeric_limits< double >::quiet_NaN()}, double relUncert=0.1)
Definition xRooNLLVar.h:331
std::map< std::shared_ptr< xRooNode >, std::shared_ptr< xRooNLLVar > > fNlls
Definition xRooNLLVar.h:367
int scan(const char *type, double nSigma, double relUncert=0.1)
Definition xRooNLLVar.h:338
std::set< std::pair< std::shared_ptr< RooArgList >, std::shared_ptr< xRooNode > > > fPdfs
Definition xRooNLLVar.h:369
This xRooNLLVar object has several special methods, e.g.
Definition xRooNLLVar.h:59
std::shared_ptr< RooAbsCollection > fFuncGlobs
Definition xRooNLLVar.h:482
std::shared_ptr< const RooAbsCollection > fGlobs
Definition xRooNLLVar.h:475
bool setData(const std::shared_ptr< RooAbsData > &data, const std::shared_ptr< const RooAbsCollection > &globs)
Definition xRooNLLVar.h:465
xRooHypoPoint hypoPoint(const char *parValues, double alt_value, const xRooFit::Asymptotics::PLLType &pllType)
std::shared_ptr< RooLinkedList > fOpts
Definition xRooNLLVar.h:477
std::shared_ptr< ROOT::Fit::FitConfig > fFitConfig
Definition xRooNLLVar.h:478
void SetFitConfig(const std::shared_ptr< ROOT::Fit::FitConfig > &in)
Definition xRooNLLVar.h:156
xRooHypoSpace hypoSpace(const char *parName, xRooFit::TestStatistic::Type tsType, int nPoints=0)
Definition xRooNLLVar.h:383
std::shared_ptr< RooAbsCollection > fConstVars
Definition xRooNLLVar.h:481
std::shared_ptr< RooAbsPdf > pdf() const
Definition xRooNLLVar.h:426
TObject * Scan(const char *scanPars, size_t nPoints, double low, double high, size_t nPointsY, double ylow, double yhigh, const RooArgList &profilePars=RooArgList())
Definition xRooNLLVar.h:397
const RooAbsCollection * globs() const
Definition xRooNLLVar.h:428
std::shared_ptr< RooAbsCollection > fFuncVars
Definition xRooNLLVar.h:480
std::shared_ptr< RooAbsData > fData
Definition xRooNLLVar.h:474
std::shared_ptr< RooAbsPdf > fPdf
Definition xRooNLLVar.h:473
TObject * Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars=RooArgList())
Definition xRooNLLVar.h:420
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
Definition xRooNode.h:52
Generic interface for defining configuration options of a numerical algorithm.
Definition IOptions.h:28
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
Named container for two doubles, two integers two object points and three string pointers that can be...
Definition RooCmdArg.h:26
Calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent constraint function...
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Variable that can be changed from the outside.
Definition RooRealVar.h:37
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
HypoTestResult is a base class for results from hypothesis tests.
Fill Area Attributes class.
Definition TAttFill.h:20
Line Attributes class.
Definition TAttLine.h:20
Marker Attributes class.
Definition TAttMarker.h:20
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:131
A TGraphErrors is a TGraph with error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
A TMultiGraph is a collection of TGraph (or derived) objects.
Definition TMultiGraph.h:34
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
Namespace for the RooStats classes.
Definition CodegenImpl.h:58
#define BEGIN_XROOFIT_NAMESPACE
Definition Config.h:24
#define END_XROOFIT_NAMESPACE
Definition Config.h:25
static const char * what
Definition stlLoader.cc:5
xValueWithError(const std::pair< double, double > &in={0, 0})
Definition xRooNLLVar.h:63
th1 Draw()
TMarker m
Definition textangle.C:8