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;
41class RooNLLVar;
43class RooRealVar;
44class RooCmdArg;
45
46class TGraph;
47class TGraphErrors;
48class TMultiGraph;
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) : 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,
71 const RooLinkedList &nllOpts = RooLinkedList());
72 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf, const std::shared_ptr<RooAbsData> &data,
73 const RooLinkedList &opts = RooLinkedList());
74 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf,
75 const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &data,
76 const RooLinkedList &opts = RooLinkedList());
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 std::shared_ptr<xRooNode> &in,
97 const std::shared_ptr<xRooNLLVar> &nll = nullptr); // : fNode(in) { }
98 const RooFitResult *operator->() const;
99 // operator std::shared_ptr<const RooFitResult>() const;
100 operator const RooFitResult *() const;
101 void Draw(Option_t *opt = "");
102
103 std::shared_ptr<xRooNLLVar> nll() const
104 {
105 return fNll;
106 }
107
109 {
110 return get()
111 ? RooArgList(*std::unique_ptr<RooAbsCollection>(get()->floatParsFinal().selectByAttrib("poi", true)))
112 : RooArgList();
113 }
114
115 // generate a conditional fit using the given poi set to the given values
116 // alias is used to store the fit result in the map under a different name
117 xRooFitResult cfit(const char *poiValues, const char *alias = nullptr);
118 // generate the conditional fit required for an impact calculation
119 xRooFitResult ifit(const char *np, bool up, bool prefit = false);
120 // calculate the impact on poi due to np. if approx is true, will use the covariance approximation instead
121 double impact(const char *poi, const char *np, bool up = true, bool prefit = false, bool approx = false);
122 double impact(const char *np, bool up = true, bool prefit = false, bool approx = false)
123 {
124 auto _poi = poi();
125 if (_poi.size() != 1)
126 throw std::runtime_error("xRooFitResult::impact: not one POI");
127 return impact(poi().contentsString().c_str(), np, up, prefit, approx);
128 }
129
130 // calculate error on poi conditional on the given NPs being held constant at their post-fit values
131 // The conditional error is often presented as the difference in quadrature to the total error i.e.
132 // error contribution due to conditional NPs = sqrt( pow(totError,2) - pow(condError,2) )
133 double conditionalError(const char *poi, const char *nps, bool up = true, bool approx = false);
134
135 // rank all the np based on impact ... will use the covariance approximation if full impact not available
136 // the approxThreshold sets the level below which the approximation will be returned
137 // e.g. set it to 0 to not do approximation
138 RooArgList ranknp(const char *poi, bool up = true, bool prefit = false,
139 double approxThreshold = std::numeric_limits<double>::infinity());
140 // version that assumes only one parameter is poi
142 ranknp(bool up = true, bool prefit = false, double approxThreshold = std::numeric_limits<double>::infinity())
143 {
144 auto _poi = poi();
145 if (_poi.size() != 1)
146 throw std::runtime_error("xRooFitResult::ranknp: not one POI");
147 return ranknp(poi().contentsString().c_str(), up, prefit, approxThreshold);
148 }
149
150 std::shared_ptr<xRooNode> fNode;
151 std::shared_ptr<xRooNLLVar> fNll;
152
153 std::shared_ptr<std::map<std::string, xRooFitResult>> fCfits;
154 };
155
156 xRooFitResult minimize(const std::shared_ptr<ROOT::Fit::FitConfig> & = nullptr);
157
158 void SetFitConfig(const std::shared_ptr<ROOT::Fit::FitConfig> &in) { fFitConfig = in; }
159 std::shared_ptr<ROOT::Fit::FitConfig> fitConfig(); // returns fit config, or creates a default one if not existing
160 ROOT::Math::IOptions *fitConfigOptions(); // return pointer to non-const version of the options inside the fit config
161
162 class xRooHypoPoint : public TNamed {
163 public:
164 xRooHypoPoint(std::shared_ptr<RooStats::HypoTestResult> htr = nullptr, const RooAbsCollection *_coords = nullptr);
165 static std::set<int> allowedStatusCodes;
166 void Print(Option_t *opt = "") const override;
167 void Draw(Option_t *opt = "") override;
168
169 // status bitmask of the available fit results
170 // 0 = all ok
171 int status() const;
172
173 std::pair<double, double> pll(bool readOnly = false); // observed test statistic value
174 std::pair<double, double> sigma_mu(bool readOnly = false); // estimate of sigma_mu parameter
175 std::shared_ptr<const RooFitResult> ufit(bool readOnly = false);
176 std::shared_ptr<const RooFitResult> cfit_null(bool readOnly = false);
177 std::shared_ptr<const RooFitResult> cfit_alt(bool readOnly = false);
178 std::shared_ptr<const RooFitResult> cfit_lbound(bool readOnly = false); // cfit @ the lower bound of mu
179 std::shared_ptr<const RooFitResult> gfit() { return fGenFit; } // non-zero if data was generated
180
181 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> fData;
182 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> data();
183
184 std::pair<double, double> getVal(const char *what);
185
186 // leave nSigma=NaN for observed p-value
187 std::pair<double, double> pNull_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
188 std::pair<double, double> pAlt_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
189 std::pair<double, double> pCLs_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
190 std::pair<double, double>
191 ts_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
192
193 std::pair<double, double> pNull_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
194 std::pair<double, double> pAlt_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
195 std::pair<double, double> pCLs_toys(double nSigma = std::numeric_limits<double>::quiet_NaN())
196 {
197 if (fNullVal() == fAltVal())
198 return std::pair(1, 0); // by construction
199 auto null = pNull_toys(nSigma);
200 auto alt = pAlt_toys(nSigma);
201 double nom = (null.first == 0) ? 0 : null.first / alt.first;
202 // double up = (null.first + null.second == 0) ? 0 : ((alt.first-alt.second<=0) ?
203 // std::numeric_limits<double>::infinity() : (null.first + null.second)/(alt.first - alt.second)); double down
204 // = (null.first - null.second == 0) ? 0 : (null.first - null.second)/(alt.first + alt.second);
205 // old way ... now doing like in pCLs_asymp by calculating the two variations ... but this is pessimistic
206 // assumes p-values are anticorrelated!
207 // so reverting to old
208 return std::make_pair(nom, (alt.first - alt.second <= 0)
209 ? std::numeric_limits<double>::infinity()
210 : (sqrt(pow(null.second, 2) + pow(alt.second * nom, 2)) / alt.first));
211 // return std::pair(nom,std::max(std::abs(up - nom), std::abs(down - nom)));
212 }
213 std::pair<double, double>
214 ts_toys(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
215
216 // Create a HypoTestResult representing the current state of this hypoPoint
218
219 xRooHypoPoint generateNull(int seed = 0);
220 xRooHypoPoint generateAlt(int seed = 0);
221
222 void
223 addNullToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
224 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
225 void
226 addAltToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
227 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
228 void
229 addCLsToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
230 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
231
232 RooArgList poi() const;
233 RooArgList alt_poi() const; // values of the poi in the alt hypothesis (will be nans if not defined)
234 RooRealVar &mu_hat(); // throws exception if ufit not available
235
236 std::shared_ptr<xRooHypoPoint>
237 asimov(bool readOnly =
238 false); // a two-sided hypoPoint with the alt hypothesis asimov dataset (used in sigma_mu() calculation)
239
240 // std::string fPOIName;
241 const char *fPOIName();
242 xRooFit::Asymptotics::PLLType fPllType = xRooFit::Asymptotics::Unknown;
243 // double fNullVal=1; double fAltVal=0;
244 double fNullVal();
245 double fAltVal();
246
247 std::shared_ptr<const RooAbsCollection> coords; // pars of the nll that will be held const alongside POI
248
249 std::shared_ptr<const RooFitResult> fUfit, fNull_cfit, fAlt_cfit, fLbound_cfit;
250 std::shared_ptr<const RooFitResult> fGenFit; // if the data was generated, this is the fit is was generated from
251 bool isExpected = false; // if genFit, flag says is asimov or not
252
253 std::shared_ptr<xRooHypoPoint>
254 fAsimov; // same as this point but pllType is twosided and data is expected post alt-fit
255
256 // first is seed, second is ts value, third is weight
257 std::vector<std::tuple<int, double, double>> nullToys; // would have to save these vectors for specific: null_cfit
258 // (genPoint), ufit, poiName, pllType, nullVal
259 std::vector<std::tuple<int, double, double>> altToys;
260
261 std::shared_ptr<xRooNLLVar> nllVar = nullptr; // hypopoints get a copy
262 std::shared_ptr<RooStats::HypoTestResult> hypoTestResult = nullptr;
263 std::shared_ptr<const RooFitResult> retrieveFit(int type);
264
265 TString tsTitle(bool inWords = false) const;
266
267 private:
268 std::pair<double, double> pX_toys(bool alt, double nSigma = std::numeric_limits<double>::quiet_NaN());
269 size_t addToys(bool alt, int nToys, int initialSeed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
270 double target_nSigma = std::numeric_limits<double>::quiet_NaN(), bool targetCLs = false,
271 double relErrThreshold = 2., size_t maxToys = 10000);
272 };
273
274 // use alt_value = nan to skip the asimov calculations
275 xRooHypoPoint hypoPoint(const char *parName, double value,
276 double alt_value = std::numeric_limits<double>::quiet_NaN(),
277 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
278 // same as above but specify parNames and values in a string
279 xRooHypoPoint hypoPoint(const char *parValues, double alt_value, const xRooFit::Asymptotics::PLLType &pllType);
280 // this next method requires poi to be flagged in the model already (with "poi" attribute) .. must be exactly one
281 xRooHypoPoint hypoPoint(double value, double alt_value = std::numeric_limits<double>::quiet_NaN(),
282 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
283
284 class xRooHypoSpace : public TNamed,
285 public TAttFill,
286 public TAttMarker,
287 public TAttLine,
288 public std::vector<xRooHypoPoint> {
289 public:
290 friend class xRooNLLVar;
291 xRooHypoSpace(const char *name = "", const char *title = "");
293
294 bool AddModel(const xRooNode &pdf, const char *validity = "");
295
296 void LoadFits(const char *apath);
297
298 // A points over given parameter, number of points between low and high
299 int AddPoints(const char *parName, size_t nPoints, double low, double high);
300
301 void Print(Option_t *opt = "") const override;
302
303 void Draw(Option_t *opt = "") override;
304
305 RooArgList poi();
306 std::shared_ptr<RooArgSet> pars() const { return fPars; };
307 RooArgList axes() const;
308
309 xRooHypoPoint &AddPoint(double value); // adds by using the first axis var
310 xRooHypoPoint &AddPoint(const char *coords = ""); // adds a new point at given coords or returns existing
311
312 xRooHypoPoint &point(size_t i) { return at(i); }
313
314 // build a TGraphErrors of pValues over the existing points
315 // opt should include any of the following:
316 // cls: do pCLs, otherwise do pNull
317 // expX: do expected, X sigma (use +X or -X for contour, otherwise will return band unless X=0)
318 // toys: pvalues from available toys
319 // readonly: don't compute anything, just return available values
320 std::shared_ptr<TGraphErrors> graph(const char *opt) const;
321
322 // return a TMultiGraph containing the set of graphs for a particular visualization
323 std::shared_ptr<TMultiGraph> graphs(const char *opt);
324
325 // will evaluate more points until limit is below given relative uncert
326 xValueWithError findlimit(const char *opt, double relUncert = std::numeric_limits<double>::infinity(),
327 unsigned int maxTries = 20);
328
329 // get currently available limit, with error. Use nSigma = nan for observed limit
330 xValueWithError limit(const char *type = "cls", double nSigma = std::numeric_limits<double>::quiet_NaN()) const;
331 int scan(const char *type, size_t nPoints, double low = std::numeric_limits<double>::quiet_NaN(),
332 double high = std::numeric_limits<double>::quiet_NaN(),
333 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
334 double relUncert = 0.1);
335 int scan(const char *type = "cls",
336 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
337 double relUncert = 0.1)
338 {
339 return scan(type, 0, std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(),
340 nSigmas, relUncert);
341 }
342 int scan(const char *type, double nSigma, double relUncert = 0.1)
343 {
344 return scan(type, std::vector<double>{nSigma}, relUncert);
345 }
346
347 // key is nSigma or "obs" for observed
348 // will only do obs if "obs" dataset is not a generated dataset
349 std::map<std::string, std::pair<double, double>>
350 limits(const char *opt = "cls",
351 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
352 double relUncert = std::numeric_limits<double>::infinity());
353
354 std::shared_ptr<xRooNode> pdf(const RooAbsCollection &parValues) const;
355 std::shared_ptr<xRooNode> pdf(const char *parValues = "") const;
356
357 // caller needs to take ownership of the returned object
359
360 private:
361 // estimates where corresponding pValues graph becomes equal to 0.05
362 // linearly interpolates log(pVal) when obtaining limits.
363 // returns value and error
364 static std::pair<double, double>
365 GetLimit(const TGraph &pValues, double target = std::numeric_limits<double>::quiet_NaN());
366
367 static RooArgList toArgs(const char *str);
368
369 xRooFit::Asymptotics::PLLType fTestStatType = xRooFit::Asymptotics::Unknown;
370 std::shared_ptr<RooArgSet> fPars;
371
372 std::map<std::shared_ptr<xRooNode>, std::shared_ptr<xRooNLLVar>> fNlls; // existing NLL functions of added pdfs;
373
374 std::set<std::pair<std::shared_ptr<RooArgList>, std::shared_ptr<xRooNode>>> fPdfs;
375 };
376
377 xRooHypoSpace hypoSpace(const char *parName, int nPoints, double low, double high,
378 double alt_value = std::numeric_limits<double>::quiet_NaN(),
379 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
380 xRooHypoSpace hypoSpace(const char *parName = "",
381 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown,
382 double alt_value = std::numeric_limits<double>::quiet_NaN());
383 xRooHypoSpace hypoSpace(int nPoints, double low, double high,
384 double alt_value = std::numeric_limits<double>::quiet_NaN(),
385 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
386 xRooHypoSpace hypoSpace(const char *parName, xRooFit::TestStatistic::Type tsType, int nPoints = 0)
387 {
388 return hypoSpace(parName, int(tsType), nPoints, -std::numeric_limits<double>::infinity(),
389 std::numeric_limits<double>::infinity());
390 }
391
392 std::shared_ptr<RooArgSet> pars(bool stripGlobalObs = true) const;
393
394 void Draw(Option_t *opt = "");
395
396 TObject *Scan(const RooArgList &scanPars, const std::vector<std::vector<double>> &coords,
397 const RooArgList &profilePars = RooArgList());
398 TObject *Scan(const char *scanPars, const std::vector<std::vector<double>> &coords,
399 const RooArgList &profilePars = RooArgList());
400 TObject *Scan(const char *scanPars, size_t nPoints, double low, double high, size_t nPointsY, double ylow,
401 double yhigh, const RooArgList &profilePars = RooArgList())
402 {
403 std::vector<std::vector<double>> coords;
404 if (nPoints) {
405 double step = (high - low) / (nPoints);
406 for (size_t i = 0; i < nPoints; i++) {
407 std::vector<double> coord({low + step * i});
408 if (nPointsY) {
409 double stepy = (yhigh - ylow) / (nPointsY);
410 for (size_t j = 0; j < nPointsY; j++) {
411 coord.push_back({ylow + stepy * j});
412 coords.push_back(coord);
413 coord.resize(1);
414 }
415 } else {
416 coords.push_back(coord);
417 }
418 }
419 }
420 return Scan(scanPars, coords, profilePars);
421 }
422 TObject *
423 Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars = RooArgList())
424 {
425 return Scan(scanPars, nPoints, low, high, 0, 0, 0, profilePars);
426 }
427
428 std::shared_ptr<RooAbsReal> func() const; // will assign globs when called
429 std::shared_ptr<RooAbsPdf> pdf() const { return fPdf; }
430 RooAbsData *data() const; // returns the data hidden inside the NLLVar if there is some
431 const RooAbsCollection *globs() const { return fGlobs.get(); }
432
433 // NLL = nllTerm + constraintTerm
434 // nllTerm = sum( entryVals ) + extendedTerm + simTerm [+ binnedDataTerm if activated binnedL option]
435 // this is what it should be, at least
436
437 // total nll should be all these values + constraint term + extended term + simTerm [+binnedDataTerm if activated
438 // binnedL option]
439 RooNLLVar *nllTerm() const;
440 RooConstraintSum *constraintTerm() const;
441
442 double getEntryVal(size_t entry) const; // get the Nll value for a specific entry
443 double extendedTerm() const;
444 double simTerm() const;
445 double binnedDataTerm() const;
446 double getEntryBinWidth(size_t entry) const;
447
448 double ndof() const;
449 double saturatedVal() const;
450 double saturatedConstraintTerm() const;
451 double saturatedNllTerm() const;
452 double pgof() const; // a goodness-of-fit pvalue based on profile likelihood of a saturated model
453
454 // change the dataset - will check globs are the same
455 bool setData(const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &_data);
456 bool setData(const std::shared_ptr<RooAbsData> &data, const std::shared_ptr<const RooAbsCollection> &globs)
457 {
458 return setData(std::make_pair(data, globs));
459 }
460 bool setData(const xRooNode &data);
461
462 // using shared ptrs everywhere, even for RooLinkedList which needs custom deleter to clear itself
463 // but still work ok for assignment operations
464 std::shared_ptr<RooAbsPdf> fPdf;
465 std::shared_ptr<RooAbsData> fData;
466 std::shared_ptr<const RooAbsCollection> fGlobs;
467
468 std::shared_ptr<RooLinkedList> fOpts;
469 std::shared_ptr<ROOT::Fit::FitConfig> fFitConfig;
470
471 std::shared_ptr<RooAbsCollection> fFuncVars;
472 std::shared_ptr<RooAbsCollection> fConstVars;
473 std::shared_ptr<RooAbsCollection> fFuncGlobs;
474 std::string fFuncCreationLog; // messaging from when function was last created -- to save from printing to screen
475
476 bool kReuseNLL = true;
477};
478
480
481#endif // include guard
RooAbsData * _data
Pointer to original input dataset.
bool setData(RooAbsData &data, bool cloneData=true) override
const char Option_t
Definition RtypesCore.h:66
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 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 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:142
std::shared_ptr< xRooNLLVar > nll() const
Definition xRooNLLVar.h:103
double impact(const char *np, bool up=true, bool prefit=false, bool approx=false)
Definition xRooNLLVar.h:122
std::shared_ptr< std::map< std::string, xRooFitResult > > fCfits
Definition xRooNLLVar.h:153
std::pair< std::shared_ptr< RooAbsData >, std::shared_ptr< const RooAbsCollection > > fData
Definition xRooNLLVar.h:181
std::vector< std::tuple< int, double, double > > altToys
Definition xRooNLLVar.h:259
std::shared_ptr< const RooAbsCollection > coords
Definition xRooNLLVar.h:247
std::vector< std::tuple< int, double, double > > nullToys
Definition xRooNLLVar.h:257
std::shared_ptr< const RooFitResult > fAlt_cfit
Definition xRooNLLVar.h:249
std::pair< double, double > pCLs_toys(double nSigma=std::numeric_limits< double >::quiet_NaN())
Definition xRooNLLVar.h:195
std::shared_ptr< const RooFitResult > fGenFit
Definition xRooNLLVar.h:250
std::shared_ptr< const RooFitResult > gfit()
Definition xRooNLLVar.h:179
std::shared_ptr< RooArgSet > pars() const
Definition xRooNLLVar.h:306
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:335
std::map< std::shared_ptr< xRooNode >, std::shared_ptr< xRooNLLVar > > fNlls
Definition xRooNLLVar.h:372
int scan(const char *type, double nSigma, double relUncert=0.1)
Definition xRooNLLVar.h:342
std::set< std::pair< std::shared_ptr< RooArgList >, std::shared_ptr< xRooNode > > > fPdfs
Definition xRooNLLVar.h:374
This xRooNLLVar object has several special methods, e.g.
Definition xRooNLLVar.h:59
std::shared_ptr< RooAbsCollection > fFuncGlobs
Definition xRooNLLVar.h:473
std::shared_ptr< const RooAbsCollection > fGlobs
Definition xRooNLLVar.h:466
bool setData(const std::shared_ptr< RooAbsData > &data, const std::shared_ptr< const RooAbsCollection > &globs)
Definition xRooNLLVar.h:456
xRooHypoPoint hypoPoint(const char *parValues, double alt_value, const xRooFit::Asymptotics::PLLType &pllType)
std::shared_ptr< RooLinkedList > fOpts
Definition xRooNLLVar.h:468
std::shared_ptr< ROOT::Fit::FitConfig > fFitConfig
Definition xRooNLLVar.h:469
void SetFitConfig(const std::shared_ptr< ROOT::Fit::FitConfig > &in)
Definition xRooNLLVar.h:158
xRooHypoSpace hypoSpace(const char *parName, xRooFit::TestStatistic::Type tsType, int nPoints=0)
Definition xRooNLLVar.h:386
std::shared_ptr< RooAbsCollection > fConstVars
Definition xRooNLLVar.h:472
std::shared_ptr< RooAbsPdf > pdf() const
Definition xRooNLLVar.h:429
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:400
const RooAbsCollection * globs() const
Definition xRooNLLVar.h:431
std::shared_ptr< RooAbsCollection > fFuncVars
Definition xRooNLLVar.h:471
std::shared_ptr< RooAbsData > fData
Definition xRooNLLVar.h:465
std::shared_ptr< RooAbsPdf > fPdf
Definition xRooNLLVar.h:464
TObject * Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars=RooArgList())
Definition xRooNLLVar.h:423
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
Definition xRooNode.h:51
Generic interface for defining configuration options of a numerical algorithm.
Definition IOptions.h:28
Abstract container object that can hold multiple RooAbsArg objects.
Storage_t const & get() const
Const access to the underlying stl container.
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...
Implements a -log(likelihood) calculation from a dataset and a PDF.
Definition RooNLLVar.h:50
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:19
Line Attributes class.
Definition TAttLine.h:18
Marker Attributes class.
Definition TAttMarker.h:19
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 Asimov.h:19
Definition graph.py:1
#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)
Definition xRooNLLVar.h:63
th1 Draw()