Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
xRooNode.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_XROONODE_H) || defined(XROOFIT_USE_PRAGMA_ONCE)
19#ifndef XROOFIT_USE_PRAGMA_ONCE
20#define XROOFIT_XROONODE_H
21#endif
22
23#include "TNamed.h"
24#include <vector>
25#include <functional>
26
27class RooWorkspace;
28class RooAbsReal;
29class TH1;
30class RooAbsLValue;
31class RooArgList;
32class RooAbsBinning;
33class RooFitResult;
34class TGraph;
35class TAxis;
36class TGListTreeItem;
37class TGListTree;
38class TVirtualPad;
39class TStyle;
40
41#include "xRooFit.h"
42#include "RooLinkedList.h"
43#include "RooCmdArg.h"
44#include "TQObject.h"
45#include "TMatrixDSym.h"
46
48
49class xRooNode;
50class xRooNLLVar;
51
52class xRooNode : public TNamed, public std::vector<std::shared_ptr<xRooNode>> {
53
54public:
55 // functions of form value = f(orig,nom,nom_err)
56 // e.g. f = ratio would be simply orig/nom
57 // bool indicates if should be symmetrized
58 static std::map<std::string, std::tuple<std::function<double(double, double, double)>, bool>> auxFunctions;
59 /** @private */
60 static void SetAuxFunction(const char *title, const std::function<double(double, double, double)> &func,
61 bool symmetrize = false);
62
63 // this function is here because couldn't figure out how to check a null shared_ptr in pyroot
64 /** @private */
65 static inline bool isNull(const std::shared_ptr<xRooNode> &x) { return x == nullptr; }
66
67 // name of the node needn't match the name of the component that it points to
68 // the name of the node is how it is identified inside its parent
69 // In c++17 for constructors with a Node2& parent, could look at using shared_from_this and if it throws except then
70 // construct make_shared<Node2>(parent)
71 xRooNode(const char *type, const char *name, const char *title = "");
72
73 /** @private */
74 template <typename T>
75 xRooNode(const char *name, const char *title) : TNamed(name, title), fComp(std::make_shared<T>())
76 {
77 if (auto x = get<TNamed>(); x) {
78 x->SetNameTitle(name, title);
79 }
80 }
81 xRooNode(const char *name = "", const std::shared_ptr<TObject> &comp = nullptr,
82 const std::shared_ptr<xRooNode> &parent = nullptr);
83
84 /** @private */
85 xRooNode(const char *name, const std::shared_ptr<TObject> &comp, const xRooNode &parent)
86 : xRooNode(name, comp, std::make_shared<xRooNode>(parent))
87 {
88 }
89
90 /** @private */
91 xRooNode(const char *name, const TObject &comp, const std::shared_ptr<xRooNode> &parent)
92 : xRooNode(name, std::shared_ptr<TObject>(const_cast<TObject *>(&comp), [](TObject *) {}), parent)
93 {
94 } // needed to ensure passing a shared_ptr<Node2> for the parent doesnt become Node2(shared_ptr<Node2>) as parent
95 // because of Node2(shared_ptr<TObject>) constructor
96 /** @private */
97 xRooNode(const char *name, const TObject &comp, const xRooNode &parent)
98 : xRooNode(name, std::shared_ptr<TObject>(const_cast<TObject *>(&comp), [](TObject *) {}), parent)
99 {
100 }
101 /** @private */
102 xRooNode(const TObject &comp, const std::shared_ptr<xRooNode> &parent = nullptr);
103 /** @private */
104 xRooNode(const TObject &comp, const xRooNode &parent) : xRooNode(comp, std::make_shared<xRooNode>(parent)) {}
105 /** @private */
106 xRooNode(const std::shared_ptr<TObject> &comp, const std::shared_ptr<xRooNode> &parent = nullptr);
107 template <typename T>
108 /** @private */
109 xRooNode(const std::shared_ptr<T> &comp, const std::shared_ptr<xRooNode> &parent = nullptr)
110 : xRooNode(std::dynamic_pointer_cast<TObject>(comp), parent)
111 {
112 }
113 /** @private */
114 template <typename T>
115 xRooNode(const std::shared_ptr<T> &comp, const xRooNode &parent)
116 : xRooNode(std::dynamic_pointer_cast<TObject>(comp), std::make_shared<xRooNode>(parent))
117 {
118 }
119 /** @private */
120 template <typename T>
121 xRooNode(const std::shared_ptr<const T> &comp, const std::shared_ptr<xRooNode> &parent = nullptr)
122 : xRooNode(std::dynamic_pointer_cast<TObject>(std::const_pointer_cast<T>(comp)), parent)
123 {
124 }
125 /** @private */
126 template <typename T>
127 xRooNode(const std::shared_ptr<const T> &comp, const xRooNode &parent)
128 : xRooNode(std::dynamic_pointer_cast<TObject>(std::const_pointer_cast<T>(comp)),
129 std::make_shared<xRooNode>(parent))
130 {
131 }
132 /** @private */
133 xRooNode(double value);
134
135 ~xRooNode() override;
136
137 void SetName(const char *name) override; // *MENU*
138 void SetTitle(const char *title) override; // *MENU*
139
140 /** @private */
141 const char *GetNodeType() const;
142
143 /** @private */
144 explicit operator bool() const { return strlen(GetName()) || get(); } // the 'null' Component is the empty string
145
146 // at doesn't do an initial browse of the object, unlike [] operator
147 const std::shared_ptr<xRooNode> &at(size_t idx, bool browseResult = true) const
148 {
149 IsFolder();
150 auto &out = std::vector<std::shared_ptr<xRooNode>>::at(idx);
151 if (browseResult && out)
152 out->browse();
153 return out;
154 }
155 std::shared_ptr<xRooNode> at(const std::string &name, bool browseResult = true) const;
156
157 RooArgList argList() const;
158
159 std::shared_ptr<xRooNode>
160 find(const std::string &name, bool browseResult = true) const; // same as at but return nullptr if not found
161 bool contains(const std::string &name) const; // doesn't trigger a browse of the found object, unlike find
162
163 // most users should use these methods: will do an initial browse and will browse the returned object too
164 std::shared_ptr<xRooNode> operator[](size_t idx) { return at(idx); }
165 std::shared_ptr<xRooNode> operator[](const std::string &name); // will create a new node if not existing, unlike 'at'
166
167 // custom iterator to ensure children are auto-browsed as we iterate through
168 class xRooNodeIterator : public std::vector<std::shared_ptr<xRooNode>>::const_iterator {
169 public:
170 xRooNodeIterator(std::vector<std::shared_ptr<xRooNode>>::const_iterator itr)
171 : std::vector<std::shared_ptr<xRooNode>>::const_iterator(itr)
172 {
173 }
174 std::iterator_traits<const std::shared_ptr<xRooNode> *>::reference operator*() const
175 {
176 const std::shared_ptr<xRooNode> &out = std::vector<std::shared_ptr<xRooNode>>::const_iterator::operator*();
177 if (out->get() && out->empty()) {
178 out->browse();
179 }
180 return std::vector<std::shared_ptr<xRooNode>>::const_iterator::operator*();
181 }
182 bool operator!=(xRooNodeIterator const &b) const
183 {
184 const std::vector<std::shared_ptr<xRooNode>>::const_iterator &aa = (*this);
185 const std::vector<std::shared_ptr<xRooNode>>::const_iterator &bb = b;
186 return aa != bb;
187 };
189 {
190 std::vector<std::shared_ptr<xRooNode>>::const_iterator::operator++();
191 return *this;
192 }
193 bool operator==(xRooNodeIterator const &b) const
194 {
195 const std::vector<std::shared_ptr<xRooNode>>::const_iterator &aa = (*this);
196 const std::vector<std::shared_ptr<xRooNode>>::const_iterator &bb = b;
197 return aa == bb;
198 };
199 };
200 auto begin() const -> xRooNodeIterator { return xRooNodeIterator(std::vector<std::shared_ptr<xRooNode>>::begin()); }
201 auto end() const -> xRooNodeIterator { return xRooNodeIterator(std::vector<std::shared_ptr<xRooNode>>::end()); }
202
203 // needed in pyROOT to avoid it creating iterators that follow the 'get' to death
204 // auto begin() const -> decltype(std::vector<std::shared_ptr<xRooNode>>::begin())
205 // {
206 // return std::vector<std::shared_ptr<xRooNode>>::begin();
207 // }
208 // auto end() const -> decltype(std::vector<std::shared_ptr<xRooNode>>::end())
209 // {
210 // return std::vector<std::shared_ptr<xRooNode>>::end();
211 // }
212
213 void Browse(TBrowser *b = nullptr) override; // will browse the children that aren't "null" nodes
214 /** @private */
215 bool IsFolder() const override;
216 /** @private */
217 const char *GetIconName() const override;
218 void Inspect() const override; // *MENU*
219
220 /** @private */
221 xRooNode &browse(); // refreshes child nodes
222
223 /** @private */
224 std::string GetPath() const;
225 void Print(Option_t *opt = "") const override; // *MENU*
226 // void Reverse() {
227 // std::reverse(std::vector<std::shared_ptr<Node2>>::begin(),std::vector<std::shared_ptr<Node2>>::end()); } // *MENU*
228
229 xRooNode &operator=(const TObject &o);
230
231 TObject *get() const { return fComp.get(); }
232 template <typename T>
233 T *get() const
234 {
235 return dynamic_cast<T *>(get());
236 }
237 /** @private */
238 TObject *xget() const { return xget<TObject>(); }
239 template <typename T>
240 T *xget() const
241 {
242 for (auto &c : fBrowsables) {
243 if (strcmp(c->GetName(), ".memory") == 0) {
244 return c->get<T>();
245 }
246 }
247 return nullptr;
248 }
249
250 TObject *operator->() const { return get(); }
251
252 RooWorkspace *ws() const;
253
254 /** @private */
255 std::shared_ptr<TObject>
256 acquire(const std::shared_ptr<TObject> &arg, bool checkFactory = false, bool mustBeNew = false);
257 // common pattern for 'creating' an acquired object
258 /** @private */
259 template <typename T, typename... Args>
260 std::shared_ptr<T> acquire(Args &&...args)
261 {
262 return std::dynamic_pointer_cast<T>(acquire(std::make_shared<T>(std::forward<Args>(args)...)));
263 }
264 /** @private */
265 template <typename T, typename T2, typename... Args>
266 // looser version of above ... first template type says what type to return
267 // allows returning different type to the one requested in T2 (e.g. ok to get RooConstVar when acquire a RooRealVar)
268 std::shared_ptr<T> acquire2(Args &&...args)
269 {
270 return std::dynamic_pointer_cast<T>(acquire(std::make_shared<T2>(std::forward<Args>(args)...)));
271 }
272 /** @private */
273 template <typename T, typename... Args>
274 std::shared_ptr<T> acquireNew(Args &&...args)
275 {
276 return std::dynamic_pointer_cast<T>(acquire(std::make_shared<T>(std::forward<Args>(args)...), false, true));
277 }
278 /** @private */
279 std::shared_ptr<TObject> getObject(const std::string &name, const std::string &type = "") const;
280 /** @private */
281 template <typename T>
282 std::shared_ptr<T> getObject(const std::string &name) const
283 {
284 return std::dynamic_pointer_cast<T>(getObject(name, T::Class_Name()));
285 }
286
287 /** @private */
288 xRooNode shallowCopy(const std::string &name, std::shared_ptr<xRooNode> parent = nullptr);
289 /** @private */
290 std::shared_ptr<TObject> convertForAcquisition(xRooNode &acquirer, const char *opt = "") const;
291
292 xRooNode vars() const; // obs,pars
293 xRooNode obs() const; // robs and globs
294 xRooNode robs() const; // just the regular obs
295 xRooNode globs() const; // just the global obs
296 xRooNode pars() const; // poi, np, and pp (prespecified pars)
297 xRooNode floats() const; // float poi or np
298 xRooNode consts() const; // just const poi or np
299
300 xRooNode poi() const; // parameters of interest
301 xRooNode np() const; // nuisance parameters (non-poi floatables)
302 xRooNode pp() const; // preset/prespecified parameters
303
304 xRooNode components() const; // additive children
305 xRooNode factors() const; // multiplicative children
306 xRooNode variations() const; // interpolated children (are bins a form of variation?)
307 xRooNode coefs() const;
308 xRooNode coords(bool setVals = true) const; // will move to the coords in the process if setVals=true
309 xRooNode bins() const;
310
311 xRooNode constraints() const; // pdfs other than the node's parent pdf where the deps of this node appear
312 xRooNode datasets()
313 const; // datasets corresponding to this pdf (parent nodes that do observable selections automatically applied)
314
315 xRooNode Replace(const xRooNode &node); // use to replace a node in the tree at the location of this node
316 xRooNode Remove(const xRooNode &child);
318 Add(const xRooNode &child,
319 Option_t *opt =
320 ""); // = components()[child.GetName()]=child; although need to handle case of adding same term multiple times
321 xRooNode Multiply(const xRooNode &child, Option_t *opt = ""); // = factors()[child.GetName()]=child;
322 xRooNode Vary(const xRooNode &child);
323 xRooNode Constrain(const xRooNode &child);
324
325 xRooNode Combine(const xRooNode &rhs); // combine rhs with this node
326
327 xRooNode reduced(const std::string &range = "", bool invert = false)
328 const; // return a node representing reduced version of this node, will use the SetRange to reduce if blank
329
330 // following versions are for the menu in the GUI
331 /** @private */
332 void _Add_(const char *name, const char *opt); // *MENU*
333 /** @private */
334 xRooNode _Multiply_(const char *what) { return Multiply(what); } // *MENU*
335 /** @private */
336 void _Vary_(const char *what); // *MENU*
337 /** @private */
338 xRooNode _Constrain_(const char *what) { return Constrain(what); } // *MENU*
339 /** @private */
340 void _ShowVars_(bool set = true); // *TOGGLE* *GETTER=_IsShowVars_
341 /** @private */
342 bool _IsShowVars_() const;
343
344 void SetHidden(bool set = true); // *TOGGLE* *GETTER=IsHidden
345 bool IsHidden() const;
346
347 bool SetContents(const TObject &obj)
348 {
349 operator=(obj);
350 return true;
351 } // populates the node's comp (creating if necessary) from given object
352 bool SetData(const TObject &obj, const xRooNode &data = "obsData");
353
354 bool SetContent(double value); // uses a RooConst
355 bool SetContent(double value, const char *par, double parVal = 1); // shortcut to setting a variation content
356 bool SetContents(const TObject &obj, const char *par, double parVal)
357 {
358 variations()[TString::Format("%s=%g", par, parVal).Data()]->operator=(obj);
359 return true;
360 }
361 bool SetBinError(int bin, double value);
362 bool SetBinContent(int bin, double value, const char *par = nullptr, double parVal = 1);
363 bool SetBinData(int bin, double value, const xRooNode &data = "obsData"); // only valid for pdf nodes
364
365 /** @private */
366 void _SetContent_(double value); // *MENU*
367 /** @private */
368 void _SetBinContent_(int bin, double value, const char *par = "", double parVal = 1); // *MENU*
369
370 bool SetXaxis(const RooAbsBinning &binning);
371 bool SetXaxis(TAxis *ax);
372 bool SetXaxis(const char *name, const char *title, int nbins, double low, double high);
373 bool SetXaxis(const char *name, const char *title, int nbins, const double *bins);
374 bool SetXaxis(const char *title, int nbins, double low, double high)
375 {
376 return SetXaxis("xaxis", title, nbins, low, high);
377 }
378 bool SetXaxis(const char *title, int nbins, const double *bins) { return SetXaxis("xaxis", title, nbins, bins); }
379 bool SetXaxis(int nbins, double low, double high) { return SetXaxis("xaxis", "", nbins, low, high); }
380 bool SetXaxis(int nbins, const double *bins) { return SetXaxis("xaxis", "", nbins, bins); }
381
382 std::shared_ptr<TStyle> style(TObject *initObject = nullptr, bool autoCreate = true) const;
383
384 TAxis *GetXaxis() const;
385
386 double GetBinData(int bin, const xRooNode &data = "obsData");
387 double GetBinContent(int bin) const { return GetBinContents(bin, bin).at(0); }
388 std::vector<double> GetBinContents(int binStart = 1, int binEnd = 0) const; // default will get all bins
389 double GetBinError(int bin, const xRooNode &fr = "") const;
390 std::vector<double> GetBinErrors(int binStart = 1, int binEnd = 0, const xRooNode &fr = "") const;
391 std::pair<double, double> IntegralAndError(const xRooNode &fr = "", const char *rangeName = nullptr) const;
392
393 // methods to access default content and error
394 double GetContent() const { return GetBinContent(fBinNumber); }
395 double GetError(const xRooNode &fr = "") const
396 {
397 return (fBinNumber == -1) ? IntegralAndError(fr).second : GetBinError(fBinNumber, fr);
398 }
399 double GetData(const xRooNode &data = "obsData") { return GetBinData(fBinNumber, data); }
400
401 // methods to access content and covariances of the CHILDREN of a node
402 std::vector<double> contents() const;
403 TMatrixDSym covariances(const xRooNode &fr = "") const;
404
405 xRooNLLVar nll(const xRooNode &_data, std::initializer_list<RooCmdArg> nllOpts) const;
406 xRooNLLVar nll(const xRooNode &_data, const RooLinkedList &nllOpts) const;
407 xRooNLLVar nll(const xRooNode &_data = "") const; // uses xRooFit::createNLLOption for nllOpts
408
409 xRooNode fitResult(const char *opt = "") const; // todo: make this 'fitResults'
410 void SetFitResult(const RooFitResult *fr = nullptr); // null means will load prefit
411 void SetFitResult(const std::shared_ptr<const RooFitResult> &fr) { SetFitResult(fr.get()); }
412 void SetFitResult(const xRooNode &fr);
413
415 generate(const xRooNode &fr = "", bool expected = false,
416 int seed = 0); // generate a dataset from a pdf node using given fr - if none given will use current fit
417
418 /** @private */
419 void _fit_(const char *constParValues = ""); // *MENU*
420 /** @private */
421 void _generate_(const char *name = "", bool expected = false); // *MENU*
422 /** @private */
423 void _scan_(const char *what = "plr", double nToys = 0, const char *xvar = "", int nPointsX = 0, double lowX = 0,
424 double highX = 0 /*, const char* yvar="", int nBinsY=0, double lowY=0, double highY=0*/,
425 const char *constParValues = ""); // *MENU*
426 // xRooNode fitTo(const char* datasetName) const;
427 // xRooNode fitTo(const xRooNode& _data) const;
428 // xRooNode generate(bool expected=false) const;
429 // void minosScan(const char* parName); // *MENU*
430 // void pllScan(const char* parName, int npoints=100); // *MENU*
431 // void breakdown(const char* parNames, const char* groupNames); // *MENU*
432
433 /*
434 double pll(Node2& data, const char* parName, double value, const Asymptotics::PLLType& pllType =
435 Asymptotics::TwoSided) const;
436 // pair is obs p_sb and p_b, vector is expected -2->+2 sigma p_sb (p_b are known by construction)
437 std::pair<std::pair<double,double>,std::vector<double>> pValue(Node2& data, const char* parName, double value,
438 double alt_value, const Asymptotics::PLLType& pllType); double sigma_mu(Node2& data, const char* parName, double
439 value, double alt_value) const;
440*/
441
442 void Checked(TObject *obj, bool val);
443 void SetChecked(bool val = true) { Checked(this, val); }
444
445 /** @private */
446 xRooNode histo(const xRooNode &vars = "x", const xRooNode &fr = "", bool content = true, bool errors = true) const;
447 /** @private */
448 xRooNode filter(const xRooNode &range) const;
449
450 TGraph *BuildGraph(RooAbsLValue *v = nullptr, bool includeZeros = false, TVirtualPad *fromPad = nullptr) const;
451 TH1 *BuildHistogram(RooAbsLValue *v = nullptr, bool empty = false, bool errors = false, int binStart = 1,
452 int binEnd = 0, const xRooNode &fr = "") const;
453 xRooNode mainChild() const;
454 void Draw(Option_t *opt = "") override; // *MENU*
455
456 void SaveAs(const char *filename = "", Option_t *option = "") const override; // *MENU*
457
458 /** @private */
459 TGListTreeItem *GetTreeItem(TBrowser *b) const;
460 /** @private */
461 TGListTree *GetListTree(TBrowser *b) const;
462
463 static void Interactive_PLLPlot();
464 static void Interactive_Pull();
466 public:
467 void Interactive_PLLPlot(TVirtualPad *pad, TObject *obj, Int_t x, Int_t y);
469 };
471
472 mutable std::shared_ptr<TObject> fComp; //!
473 int fTimes = 1; // when the same comp appears multiple times in a parent node, this is increased to reflect that
474 int fBinNumber = -1; // used by 'bin' nodes (a node that refers to a specific bin of a parent)
475 std::shared_ptr<xRooNode> fParent; //!
476 std::string fFolder; // folder to put this node in when 'organising' the parent
477
478 void SetRange(const char *range, double low = std::numeric_limits<double>::quiet_NaN(),
479 double high = std::numeric_limits<double>::quiet_NaN()); // *MENU*
480 const char *GetRange() const;
481 mutable std::string fRange; //! only here so can have char* GetRange return so can return nullptr for no range set
482 //! (required for RooCategory)
483
484 mutable std::shared_ptr<TAxis>
485 fXAxis; //! appears that if was fXaxis then dialog box for SetXaxis will take as current value
486
487 mutable bool fInterrupted = false;
488
489 bool fAcquirer = false; // if true, when acquiring will go into objects memory rather than pass onto parent
490 std::shared_ptr<xRooNode> fProvider; //! like a parent but only for use by getObject
491
492 std::shared_ptr<xRooNode> parentPdf() const; // find first parent that is a pdf
493
494 /** @private */
495 void sterilize() const;
496
497 std::vector<std::shared_ptr<xRooNode>> fBrowsables; // will appear in the browser tree but are not actual children
498 std::function<xRooNode(xRooNode *)> fBrowseOperation; // a way to specify a custom browsing operation
499
500 /** @private */
501 std::shared_ptr<xRooNode> getBrowsable(const char *name) const;
502
504};
505
506namespace cling {
507std::string printValue(const xRooNode *val);
508}
509
511
512#endif // include guard
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
RooAbsData * _data
Pointer to original input dataset.
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
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 filename
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 Int_t Int_t Window_t child
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
Option_t Option_t style
char name[80]
Definition TGX11.cxx:110
void Print(GNN_Data &d, std::string txt="")
Binding & operator=(OUT(*fun)(void))
static void GetRange(const char *comments, Double_t &xmin, Double_t &xmax, Double_t &factor)
Parse comments to search for a range specifier of the style: [xmin,xmax] or [xmin,...
This xRooNLLVar object has several special methods, e.g.
Definition xRooNLLVar.h:59
std::iterator_traits< conststd::shared_ptr< xRooNode > * >::reference operator*() const
Definition xRooNode.h:174
xRooNodeIterator(std::vector< std::shared_ptr< xRooNode > >::const_iterator itr)
Definition xRooNode.h:170
bool operator==(xRooNodeIterator const &b) const
Definition xRooNode.h:193
bool operator!=(xRooNodeIterator const &b) const
Definition xRooNode.h:182
The xRooNode class is designed to wrap over a TObject and provide functionality to aid with interacti...
Definition xRooNode.h:52
xRooNode(const std::shared_ptr< T > &comp, const xRooNode &parent)
Definition xRooNode.h:115
xRooNode _Multiply_(const char *what)
Definition xRooNode.h:334
std::vector< std::shared_ptr< xRooNode > > fBrowsables
Definition xRooNode.h:497
std::shared_ptr< T > acquire(Args &&...args)
Definition xRooNode.h:260
bool SetXaxis(int nbins, double low, double high)
Definition xRooNode.h:379
xRooNode(const std::shared_ptr< const T > &comp, const std::shared_ptr< xRooNode > &parent=nullptr)
Definition xRooNode.h:121
static InteractiveObject * gIntObj
Definition xRooNode.h:470
xRooNode(const std::shared_ptr< T > &comp, const std::shared_ptr< xRooNode > &parent=nullptr)
Definition xRooNode.h:109
xRooNode(const TObject &comp, const xRooNode &parent)
Definition xRooNode.h:104
xRooNode(const char *type, const char *name, const char *title="")
const std::shared_ptr< xRooNode > & at(size_t idx, bool browseResult=true) const
Definition xRooNode.h:147
xRooNLLVar nll(const xRooNode &_data, const RooLinkedList &nllOpts) const
bool SetXaxis(int nbins, const double *bins)
Definition xRooNode.h:380
std::shared_ptr< xRooNode > operator[](size_t idx)
Definition xRooNode.h:164
std::shared_ptr< T > acquireNew(Args &&...args)
Definition xRooNode.h:274
std::shared_ptr< T > acquire2(Args &&...args)
Definition xRooNode.h:268
std::shared_ptr< T > getObject(const std::string &name) const
Definition xRooNode.h:282
bool SetXaxis(const char *title, int nbins, double low, double high)
Definition xRooNode.h:374
xRooNode(const std::shared_ptr< const T > &comp, const xRooNode &parent)
Definition xRooNode.h:127
std::function< xRooNode(xRooNode *)> fBrowseOperation
Definition xRooNode.h:498
std::shared_ptr< xRooNode > fProvider
Definition xRooNode.h:490
std::shared_ptr< TAxis > fXAxis
only here so can have char* GetRange return so can return nullptr for no range set (required for RooC...
Definition xRooNode.h:485
static std::map< std::string, std::tuple< std::function< double(double, double, double)>, bool > > auxFunctions
Definition xRooNode.h:58
xRooNode(const char *name, const std::shared_ptr< TObject > &comp, const xRooNode &parent)
Definition xRooNode.h:85
xRooNode(const char *name, const TObject &comp, const xRooNode &parent)
Definition xRooNode.h:97
bool SetContents(const TObject &obj)
Definition xRooNode.h:347
std::shared_ptr< TObject > fComp
Definition xRooNode.h:472
void SetFitResult(const std::shared_ptr< const RooFitResult > &fr)
Definition xRooNode.h:411
double GetData(const xRooNode &data="obsData")
Definition xRooNode.h:399
static bool isNull(const std::shared_ptr< xRooNode > &x)
Definition xRooNode.h:65
xRooNode(const char *name, const TObject &comp, const std::shared_ptr< xRooNode > &parent)
Definition xRooNode.h:91
bool SetContent(double value, const char *par, double parVal=1)
xRooNode(const char *name, const char *title)
Definition xRooNode.h:75
double GetBinContent(int bin) const
Definition xRooNode.h:387
auto begin() const -> xRooNodeIterator
Definition xRooNode.h:200
std::shared_ptr< xRooNode > fParent
Definition xRooNode.h:475
auto end() const -> xRooNodeIterator
Definition xRooNode.h:201
xRooNode _Constrain_(const char *what)
Definition xRooNode.h:338
double GetError(const xRooNode &fr="") const
Definition xRooNode.h:395
bool SetXaxis(const char *title, int nbins, const double *bins)
Definition xRooNode.h:378
bool SetContents(const TObject &obj, const char *par, double parVal)
Definition xRooNode.h:356
Abstract base class for RooRealVar binning definitions.
Abstract base class for objects that are lvalues, i.e.
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
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...
Persistable container for RooFit projects.
Class to manage histogram axis.
Definition TAxis.h:31
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:195
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition TNamed.cxx:154
Mother of all ROOT objects.
Definition TObject.h:41
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
const char * Data() const
Definition TString.h:376
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2378
TStyle objects may be created to define special styles.
Definition TStyle.h:29
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
gr SetName("gr")
#define T2
Definition md5.inl:147
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
#define BEGIN_XROOFIT_NAMESPACE
Definition Config.h:24
#define END_XROOFIT_NAMESPACE
Definition Config.h:25
static const char * what
Definition stlLoader.cc:5
th1 Draw()