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