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