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 std::string __repr__() const { return Form("%g +/- %g", value(), error()); }
67 };
68
69 void Print(Option_t *opt = "");
70
71 xRooNLLVar(RooAbsPdf &pdf, const std::pair<RooAbsData *, const RooAbsCollection *> &data,
73 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf, const std::shared_ptr<RooAbsData> &data,
75 xRooNLLVar(const std::shared_ptr<RooAbsPdf> &pdf,
76 const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &data,
78
80
81 // whenever implicitly converted to a RooAbsReal we will make sure our globs are set
82 RooAbsReal *get() const { return func().get(); }
83 RooAbsReal *operator->() const { return get(); }
84
85 void reinitialize();
86
87 void SetOption(const RooCmdArg &opt);
88 [[deprecated("Use SetOption()")]] void AddOption(const RooCmdArg &opt) { SetOption(opt); }
89
90 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
91 getData() const; // returns pointer to data and snapshot of globs
92 std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>>
93 generate(bool expected = false, int seed = 0);
94 // std::shared_ptr<const RooFitResult> snapshot();
95
96 class xRooFitResult : public std::shared_ptr<const RooFitResult> {
97 public:
98 xRooFitResult(const RooFitResult &fr);
99 xRooFitResult(const std::shared_ptr<xRooNode> &in,
100 const std::shared_ptr<xRooNLLVar> &nll = nullptr); // : fNode(in) { }
101 const RooFitResult *operator->() const;
102 // operator std::shared_ptr<const RooFitResult>() const;
103 operator const RooFitResult *() const;
104 void Draw(Option_t *opt = "");
105
106 std::shared_ptr<xRooNLLVar> nll() const { return fNll; }
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 xValueWithError pll(bool readOnly = false); // observed test statistic value
174 xValueWithError 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 xValueWithError getVal(const char *what);
185
186 // leave nSigma=NaN for observed p-value
187 xValueWithError pNull_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
188 xValueWithError pAlt_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
189 xValueWithError pCLs_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN());
190 xValueWithError ts_asymp(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
191
192 xValueWithError pNull_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
193 xValueWithError pAlt_toys(double nSigma = std::numeric_limits<double>::quiet_NaN());
194 xValueWithError pCLs_toys(double nSigma = std::numeric_limits<double>::quiet_NaN())
195 {
196 if (fNullVal() == fAltVal())
197 return std::pair<double, double>(1, 0); // by construction
198 auto null = pNull_toys(nSigma);
199 auto alt = pAlt_toys(nSigma);
200 double nom = (null.first == 0) ? 0 : null.first / alt.first;
201 // double up = (null.first + null.second == 0) ? 0 : ((alt.first-alt.second<=0) ?
202 // std::numeric_limits<double>::infinity() : (null.first + null.second)/(alt.first - alt.second)); double down
203 // = (null.first - null.second == 0) ? 0 : (null.first - null.second)/(alt.first + alt.second);
204 // old way ... now doing like in pCLs_asymp by calculating the two variations ... but this is pessimistic
205 // assumes p-values are anticorrelated!
206 // so reverting to old
207 return std::pair<double, double>(nom, (alt.first - alt.second <= 0)
208 ? std::numeric_limits<double>::infinity()
209 : (sqrt(pow(null.second, 2) + pow(alt.second * nom, 2)) / alt.first));
210 // return std::pair(nom,std::max(std::abs(up - nom), std::abs(down - nom)));
211 }
212 xValueWithError ts_toys(double nSigma = std::numeric_limits<double>::quiet_NaN()); // test statistic value
213
214 // Create a HypoTestResult representing the current state of this hypoPoint
216
217 xRooHypoPoint generateNull(int seed = 0);
218 xRooHypoPoint generateAlt(int seed = 0);
219
220 void
221 addNullToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
222 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
223 void
224 addAltToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
225 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
226 void
227 addCLsToys(int nToys = 1, int seed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
228 double target_nSigma = std::numeric_limits<double>::quiet_NaN()); // if seed=0 will use a random seed
229
230 RooArgList poi() const;
231 RooArgList alt_poi() const; // values of the poi in the alt hypothesis (will be nans if not defined)
232 RooRealVar &mu_hat(); // throws exception if ufit not available
233
234 std::shared_ptr<xRooHypoPoint>
235 asimov(bool readOnly =
236 false); // a two-sided hypoPoint with the alt hypothesis asimov dataset (used in sigma_mu() calculation)
237
238 // std::string fPOIName;
239 const char *fPOIName();
240 xRooFit::Asymptotics::PLLType fPllType = xRooFit::Asymptotics::Unknown;
241 // double fNullVal=1; double fAltVal=0;
242 double fNullVal();
243 double fAltVal();
244
245 void setNullVal(double val);
246 void setAltVal(double val);
247 void setObsTS(double val, double err)
248 {
249 obs_ts = val;
250 obs_ts_err = err;
251 fPllType = xRooFit::Asymptotics::Unknown;
252 }
253 void addNullToy(double value, double weight = 1., int seed = 0)
254 {
255 fPllType = xRooFit::Asymptotics::Unknown;
256 nullToys.emplace_back(std::make_tuple(seed, value, weight));
257 }
258 void addAltToy(double value, double weight = 1., int seed = 0)
259 {
260 fPllType = xRooFit::Asymptotics::Unknown;
261 altToys.emplace_back(std::make_tuple(seed, value, weight));
262 }
263
264 std::shared_ptr<const RooAbsCollection> coords; // pars of the nll that will be held const alongside POI
265
266 std::shared_ptr<const RooFitResult> fUfit, fNull_cfit, fAlt_cfit, fLbound_cfit;
267 std::shared_ptr<const RooFitResult> fGenFit; // if the data was generated, this is the fit is was generated from
268 bool isExpected = false; // if genFit, flag says is asimov or not
269 double obs_ts = std::numeric_limits<double>::quiet_NaN(); // only specified for unknown pll types
270 double obs_ts_err = std::numeric_limits<double>::quiet_NaN();
271
272 std::shared_ptr<xRooHypoPoint>
273 fAsimov; // same as this point but pllType is twosided and data is expected post alt-fit
274
275 // first is seed, second is ts value, third is weight
276 std::vector<std::tuple<int, double, double>> nullToys; // would have to save these vectors for specific: null_cfit
277 // (genPoint), ufit, poiName, pllType, nullVal
278 std::vector<std::tuple<int, double, double>> altToys;
279
280 std::shared_ptr<xRooNLLVar> nllVar = nullptr; // hypopoints get a copy
281 std::shared_ptr<RooStats::HypoTestResult> hypoTestResult = nullptr;
282 std::shared_ptr<const RooFitResult> retrieveFit(int type);
283
284 TString tsTitle(bool inWords = false) const;
285
286 private:
287 xValueWithError pX_toys(bool alt, double nSigma = std::numeric_limits<double>::quiet_NaN());
288 size_t addToys(bool alt, int nToys, int initialSeed = 0, double target = std::numeric_limits<double>::quiet_NaN(),
289 double target_nSigma = std::numeric_limits<double>::quiet_NaN(), bool targetCLs = false,
290 double relErrThreshold = 2., size_t maxToys = 10000);
291 };
292
293 // use alt_value = nan to skip the asimov calculations
294 xRooHypoPoint hypoPoint(const char *parName, double value,
295 double alt_value = std::numeric_limits<double>::quiet_NaN(),
296 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
297 // same as above but specify parNames and values in a string
299 // this next method requires poi to be flagged in the model already (with "poi" attribute) .. must be exactly one
300 xRooHypoPoint hypoPoint(double value, double alt_value = std::numeric_limits<double>::quiet_NaN(),
301 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
302
303 class xRooHypoSpace : public TNamed,
304 public TAttFill,
305 public TAttMarker,
306 public TAttLine,
307 public std::vector<xRooHypoPoint> {
308 public:
309 friend class xRooNLLVar;
310 xRooHypoSpace(const char *name = "", const char *title = "");
312
313 bool AddModel(const xRooNode &pdf, const char *validity = "");
314
315 // the directory where fits are cached from scans
316 TDirectory *fitCache() const { return fFitDb.get(); }
317
318 // A points over given parameter, number of points between low and high
319 int AddPoints(const char *parName, size_t nPoints, double low, double high);
320
321 void Print(Option_t *opt = "") const override;
322
323 void Draw(Option_t *opt = "") override;
324
325 RooArgList poi();
326 std::shared_ptr<RooArgSet> pars() const { return fPars; };
327 RooArgList axes() const;
328
329 xRooHypoPoint &AddPoint(double value); // adds by using the first axis var
330 xRooHypoPoint &AddPoint(const char *coords = ""); // adds a new point at given coords or returns existing
331
332 xRooHypoPoint &point(size_t i) { return at(i); }
333
334 // build a TGraphErrors of pValues over the existing points
335 // opt should include any of the following:
336 // cls: do pCLs, otherwise do pNull
337 // expX: do expected, X sigma (use +X or -X for contour, otherwise will return band unless X=0)
338 // toys: pvalues from available toys
339 // readonly: don't compute anything, just return available values
340 std::shared_ptr<TGraphErrors> graph(const char *opt) const;
341
342 // return a TMultiGraph containing the set of graphs for a particular visualization
343 std::shared_ptr<TMultiGraph> graphs(const char *opt);
344
345 // will evaluate more points until limit is below given relative uncert
346 xValueWithError findlimit(const char *opt, double relUncert = std::numeric_limits<double>::infinity(),
347 unsigned int maxTries = 20);
348
349 // get currently available limit, with error. Use nSigma = nan for observed limit
350 xValueWithError limit(const char *type = "cls", double nSigma = std::numeric_limits<double>::quiet_NaN()) const;
351 int scan(const char *type, size_t nPoints, double low = std::numeric_limits<double>::quiet_NaN(),
352 double high = std::numeric_limits<double>::quiet_NaN(),
353 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
354 double relUncert = 0.1);
355 int scan(const char *type = "cls",
356 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
357 double relUncert = 0.1)
358 {
359 return scan(type, 0, std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(),
361 }
362 int scan(const char *type, double nSigma, double relUncert = 0.1)
363 {
364 return scan(type, std::vector<double>{nSigma}, relUncert);
365 }
366
367 // key is nSigma or "obs" for observed
368 // will only do obs if "obs" dataset is not a generated dataset
369 std::map<std::string, xValueWithError>
370 limits(const char *opt = "cls",
371 const std::vector<double> &nSigmas = {0, 1, 2, -1, -2, std::numeric_limits<double>::quiet_NaN()},
372 double relUncert = std::numeric_limits<double>::infinity());
373
374 std::shared_ptr<xRooNode> pdf(const RooAbsCollection &parValues) const;
375 std::shared_ptr<xRooNode> pdf(const char *parValues = "") const;
376
377 // caller needs to take ownership of the returned object
379
380 private:
381 // estimates where corresponding pValues graph becomes equal to 0.05
382 // linearly interpolates log(pVal) when obtaining limits.
383 // returns value and error
384 static xValueWithError GetLimit(const TGraph &pValues, double target = std::numeric_limits<double>::quiet_NaN());
385
386 static RooArgList toArgs(const char *str);
387
388 xRooFit::Asymptotics::PLLType fTestStatType = xRooFit::Asymptotics::Unknown;
389 std::shared_ptr<RooArgSet> fPars;
390
391 std::map<std::shared_ptr<xRooNode>, std::shared_ptr<xRooNLLVar>> fNlls; // existing NLL functions of added pdfs;
392
393 std::set<std::pair<std::shared_ptr<RooArgList>, std::shared_ptr<xRooNode>>> fPdfs;
394
395 std::shared_ptr<TDirectory> fFitDb;
396 };
397
398 xRooHypoSpace hypoSpace(const char *parName, int nPoints, double low, double high,
399 double alt_value = std::numeric_limits<double>::quiet_NaN(),
400 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown,
401 int tsType = 0);
402 xRooHypoSpace hypoSpace(const char *parName = "",
403 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown,
404 double alt_value = std::numeric_limits<double>::quiet_NaN());
405 xRooHypoSpace hypoSpace(int nPoints, double low, double high,
406 double alt_value = std::numeric_limits<double>::quiet_NaN(),
407 const xRooFit::Asymptotics::PLLType &pllType = xRooFit::Asymptotics::Unknown);
409 double low = std::numeric_limits<double>::quiet_NaN(),
410 double high = std::numeric_limits<double>::quiet_NaN(),
411 double alt_value = std::numeric_limits<double>::quiet_NaN())
412 {
413 return hypoSpace(parName, nPoints, low, high, alt_value, xRooFit::Asymptotics::Unknown, tsType);
414 }
415
416 std::shared_ptr<RooArgSet> pars(bool stripGlobalObs = true) const;
417
418 void Draw(Option_t *opt = "");
419
420 TObject *Scan(const RooArgList &scanPars, const std::vector<std::vector<double>> &coords,
422 TObject *Scan(const char *scanPars, const std::vector<std::vector<double>> &coords,
424 TObject *Scan(const char *scanPars, size_t nPoints, double low, double high, size_t nPointsY, double ylow,
425 double yhigh, const RooArgList &profilePars = RooArgList())
426 {
427 std::vector<std::vector<double>> coords;
428 if (nPoints) {
429 double step = (high - low) / (nPoints);
430 for (size_t i = 0; i < nPoints; i++) {
431 std::vector<double> coord({low + step * i});
432 if (nPointsY) {
433 double stepy = (yhigh - ylow) / (nPointsY);
434 for (size_t j = 0; j < nPointsY; j++) {
435 coord.push_back({ylow + stepy * j});
436 coords.push_back(coord);
437 coord.resize(1);
438 }
439 } else {
440 coords.push_back(coord);
441 }
442 }
443 }
444 return Scan(scanPars, coords, profilePars);
445 }
446 TObject *
447 Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars = RooArgList())
448 {
449 return Scan(scanPars, nPoints, low, high, 0, 0, 0, profilePars);
450 }
451
452 std::shared_ptr<RooAbsReal> func() const; // will assign globs when called
453 std::shared_ptr<RooAbsPdf> pdf() const { return fPdf; }
454 RooAbsData *data() const; // returns the data hidden inside the NLLVar if there is some
455 const RooAbsCollection *globs() const { return fGlobs.get(); }
456
457 // NLL = mainTerm + constraintTerm
458 // mainTerm = sum( entryVals ) + extendedTerm + simTerm [+ binnedDataTerm if activated binnedL option]
459 // this is what it should be, at least
460
461 // total nll should be all these values + constraint term + extended term + simTerm [+binnedDataTerm if activated
462 // binnedL option]
463 /*RooAbsReal *mainTerm() const;*/
464 RooConstraintSum *constraintTerm() const;
465
466 double mainTermVal() const;
467 double constraintTermVal() const;
468
469 double getEntryVal(size_t entry) const; // get the Nll value for a specific entry
470 double extendedTermVal() const;
471 double simTermVal() const;
472 double binnedDataTermVal() const;
473 double getEntryBinWidth(size_t entry) const;
474
475 double ndof() const;
476 double saturatedVal() const;
477 [[deprecated("Use saturatedConstraintTermVal()")]] double saturatedConstraintTerm() const
478 {
479 return saturatedConstraintTermVal();
480 }
481 double saturatedConstraintTermVal() const;
482 [[deprecated("Use saturatedMainTermVal()")]] double saturatedMainTerm() const { return saturatedMainTermVal(); }
483 double saturatedMainTermVal() const;
484 double pgof() const; // a goodness-of-fit pvalue based on profile likelihood of a saturated model
485 double mainTermPgof() const;
486 double mainTermNdof() const;
487
488 std::set<std::string> binnedChannels() const;
489
490 // change the dataset - will check globs are the same
491 bool setData(const std::pair<std::shared_ptr<RooAbsData>, std::shared_ptr<const RooAbsCollection>> &_data);
492 bool setData(const std::shared_ptr<RooAbsData> &data, const std::shared_ptr<const RooAbsCollection> &globs)
493 {
494 return setData(std::make_pair(data, globs));
495 }
496 bool setData(const xRooNode &data);
497
498 // using shared ptrs everywhere, even for RooLinkedList which needs custom deleter to clear itself
499 // but still work ok for assignment operations
500 std::shared_ptr<RooAbsPdf> fPdf;
501 std::shared_ptr<RooAbsData> fData;
502 std::shared_ptr<const RooAbsCollection> fGlobs;
503
504 std::shared_ptr<RooLinkedList> fOpts;
505 std::shared_ptr<ROOT::Fit::FitConfig> fFitConfig;
506
507 std::shared_ptr<RooAbsCollection> fFuncVars;
508 std::shared_ptr<RooAbsCollection> fConstVars;
509 std::shared_ptr<RooAbsCollection> fFuncGlobs;
510 std::string fFuncCreationLog; // messaging from when function was last created -- to save from printing to screen
511
512 bool kReuseNLL = true;
513};
514
516
517#ifndef XROOFIT_NAMESPACE_NAME
518#ifdef XROOFIT_NAMESPACE
519#define XROOFIT_NAMESPACE_NAME XROOFIT_NAMESPACE
520#else
521#define XROOFIT_NAMESPACE_NAME
522#endif
523#endif
524namespace cling {
525std::string printValue(const XROOFIT_NAMESPACE_NAME::xRooNLLVar::xValueWithError *val);
526std::string printValue(const std::map<std::string, XROOFIT_NAMESPACE_NAME::xRooNLLVar::xValueWithError> *m);
527} // namespace cling
528
529#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:145
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2496
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:106
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:278
std::shared_ptr< const RooAbsCollection > coords
Definition xRooNLLVar.h:264
void addNullToy(double value, double weight=1., int seed=0)
Definition xRooNLLVar.h:253
std::vector< std::tuple< int, double, double > > nullToys
Definition xRooNLLVar.h:276
std::shared_ptr< const RooFitResult > fAlt_cfit
Definition xRooNLLVar.h:266
std::shared_ptr< const RooFitResult > fGenFit
Definition xRooNLLVar.h:267
void addAltToy(double value, double weight=1., int seed=0)
Definition xRooNLLVar.h:258
xValueWithError pCLs_toys(double nSigma=std::numeric_limits< double >::quiet_NaN())
Definition xRooNLLVar.h:194
std::shared_ptr< const RooFitResult > gfit()
Definition xRooNLLVar.h:179
std::shared_ptr< RooArgSet > pars() const
Definition xRooNLLVar.h:326
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:355
std::map< std::shared_ptr< xRooNode >, std::shared_ptr< xRooNLLVar > > fNlls
Definition xRooNLLVar.h:391
int scan(const char *type, double nSigma, double relUncert=0.1)
Definition xRooNLLVar.h:362
std::set< std::pair< std::shared_ptr< RooArgList >, std::shared_ptr< xRooNode > > > fPdfs
Definition xRooNLLVar.h:393
This xRooNLLVar object has several special methods, e.g.
Definition xRooNLLVar.h:59
std::shared_ptr< RooAbsCollection > fFuncGlobs
Definition xRooNLLVar.h:509
std::shared_ptr< const RooAbsCollection > fGlobs
Definition xRooNLLVar.h:502
bool setData(const std::shared_ptr< RooAbsData > &data, const std::shared_ptr< const RooAbsCollection > &globs)
Definition xRooNLLVar.h:492
xRooHypoPoint hypoPoint(const char *parValues, double alt_value, const xRooFit::Asymptotics::PLLType &pllType)
std::shared_ptr< RooLinkedList > fOpts
Definition xRooNLLVar.h:504
std::shared_ptr< ROOT::Fit::FitConfig > fFitConfig
Definition xRooNLLVar.h:505
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, double low=std::numeric_limits< double >::quiet_NaN(), double high=std::numeric_limits< double >::quiet_NaN(), double alt_value=std::numeric_limits< double >::quiet_NaN())
Definition xRooNLLVar.h:408
std::shared_ptr< RooAbsCollection > fConstVars
Definition xRooNLLVar.h:508
std::shared_ptr< RooAbsPdf > pdf() const
Definition xRooNLLVar.h:453
void AddOption(const RooCmdArg &opt)
Definition xRooNLLVar.h:88
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:424
const RooAbsCollection * globs() const
Definition xRooNLLVar.h:455
std::shared_ptr< RooAbsCollection > fFuncVars
Definition xRooNLLVar.h:507
std::shared_ptr< RooAbsData > fData
Definition xRooNLLVar.h:501
std::shared_ptr< RooAbsPdf > fPdf
Definition xRooNLLVar.h:500
TObject * Scan(const char *scanPars, size_t nPoints, double low, double high, const RooArgList &profilePars=RooArgList())
Definition xRooNLLVar.h:447
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:56
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:21
Line Attributes class.
Definition TAttLine.h:21
Marker Attributes class.
Definition TAttMarker.h:21
Describe directory structure in memory.
Definition TDirectory.h:45
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition TFile.h:130
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:42
Basic string class.
Definition TString.h:138
Namespace for the RooStats classes.
Definition CodegenImpl.h:66
#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