Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RooAbsRealLValue.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooAbsRealLValue.cxx
19\class RooAbsRealLValue
20\ingroup Roofitcore
21
22Abstract base class for objects that represent a
23real value that may appear on the left hand side of an equation ('lvalue').
24Each implementation must provide a setVal() member to allow direct modification
25of the value. RooAbsRealLValue may be derived, but its functional relation
26to other RooAbsArg must be invertible
27
28This class has methods that export the defined range of the lvalue,
29but doesn't hold its values because these limits may be derived
30from limits of client object. The range serve as integration
31range when interpreted as a observable and a boundaries when
32interpreted as a parameter.
33**/
34
35#include "RooAbsRealLValue.h"
36
37#include "RooStreamParser.h"
38#include "RooRandom.h"
39#include "RooPlot.h"
40#include "RooArgList.h"
41#include "RooAbsBinning.h"
42#include "RooBinning.h"
43#include "RooNumber.h"
44#include "RooUniformBinning.h"
45#include "RooCmdConfig.h"
46#include "RooAbsData.h"
47#include "RooRealVar.h"
48#include "RooMsgService.h"
49
50#include "ROOT/StringUtils.hxx"
51
52#include "TH1.h"
53#include "TH2.h"
54#include "TH3.h"
55
56#include <cmath>
57
58using std::endl, std::istream, std::ostream;
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Constructor
63
64RooAbsRealLValue::RooAbsRealLValue(const char *name, const char *title, const char *unit) :
65 RooAbsReal(name, title, 0, 0, unit)
66{
67}
68
69
70
71////////////////////////////////////////////////////////////////////////////////
72/// Copy constructor
73
78
79////////////////////////////////////////////////////////////////////////////////
80/// Return true if the input value is within our fit range. Otherwise, return
81/// false and write a clipped value into clippedValPtr if it is non-zero.
82///
83/// Implements the following check to see if the value x is in the range [a, b]:
84/// check if `[x - eps * x, x + eps * x]` overlaps with `[a, b]`, where the
85/// parameter `eps` is defined as:
86/// ```
87/// std::max(RooNumber::rangeEpsRel() * std::abs(x), RooNumber::rangeEpsAbs())
88/// ```
89/// By default, RooNumber::rangeEpsRel() and RooNumber::rangeEpsRel() are set to zero.
90/// You can change them with RooNumber::setRangeEpsRel(double) and RooNumber::setRangeEpsAbs(double),
91/// but this should be only done if there is no other solution.
92bool RooAbsRealLValue::inRange(double value, const char* rangeName, double* clippedValPtr) const
93{
94 // double range = getMax() - getMin() ; // ok for +/-INFINITY
95 double clippedValue(value);
96 bool isInRange(true) ;
97
98 const RooAbsBinning& binning = getBinning(rangeName) ;
99 double min = binning.lowBound() ;
100 double max = binning.highBound() ;
101
102 const double epsilon = std::max(RooNumber::rangeEpsRel() * std::abs(value), RooNumber::rangeEpsAbs());
103
104 // test this value against our upper fit limit
105 if(!RooNumber::isInfinite(max) && value > (max+epsilon)) {
106 clippedValue = max;
107 isInRange = false ;
108 }
109 // test this value against our lower fit limit
110 if(!RooNumber::isInfinite(min) && value < min-epsilon) {
111 clippedValue = min ;
112 isInRange = false ;
113 }
114
116
117 return isInRange ;
118}
119
120
121////////////////////////////////////////////////////////////////////////////////
122/// Vectorized version of RooAbsRealLValue::inRange(double, const char*, double*).
123void RooAbsRealLValue::inRange(std::span<const double> values, std::string const& rangeName, std::vector<bool>& out) const {
124 if(rangeName.empty()) {
125 return;
126 }
127
128 const RooAbsBinning& binning = getBinning(rangeName.c_str()) ;
129 const double min = binning.lowBound() ;
130 const double max = binning.highBound() ;
131
132 const bool infiniteMin = RooNumber::isInfinite(min);
133 const bool infiniteMax = RooNumber::isInfinite(max);
134
135 const double epsRel = RooNumber::rangeEpsRel();
136 const double epsAbs = RooNumber::rangeEpsAbs();
137
138 for(std::size_t i = 0; i < values.size(); ++i) {
139 const double eps = std::max(epsRel * std::abs(values[i]), epsAbs);
140 out[i] = out[i] && ((infiniteMax | (values[i] <= (max+eps))) && (infiniteMin | (values[i] >= (min-eps))));
141 }
142
143}
144
145
146////////////////////////////////////////////////////////////////////////////////
147/// Check if given value is valid
148
149bool RooAbsRealLValue::isValidReal(double value, bool verbose) const
150{
151 if (!inRange(value,nullptr)) {
152 if (verbose) {
153 coutI(InputArguments) << "RooRealVar::isValid(" << GetName() << "): value " << value << " out of range ("
154 << getMin() << " - " << getMax() << ")" << std::endl;
155 }
156 return false ;
157 }
158 return true ;
159}
160
161
162
163////////////////////////////////////////////////////////////////////////////////
164/// Read object contents from given stream
165
166bool RooAbsRealLValue::readFromStream(istream& /*is*/, bool /*compact*/, bool /*verbose*/)
167{
168 return true ;
169}
170
171
172
173////////////////////////////////////////////////////////////////////////////////
174/// Write object contents to given stream
175
176void RooAbsRealLValue::writeToStream(ostream& /*os*/, bool /*compact*/) const
177{
178}
179
180
181
182////////////////////////////////////////////////////////////////////////////////
183/// Assignment operator from a double
184
186{
187 double clipValue ;
188 // Clip
189 inRange(newValue,nullptr,&clipValue) ;
191
192 return *this ;
193}
194
195
196////////////////////////////////////////////////////////////////////////////////
197/// Create a new RooPlot on the heap with a drawing frame initialized for this
198/// object, but no plot contents. Use x.frame() as the first argument to a
199/// y.plotOn(...) method, for example. The caller is responsible for deleting
200/// the returned object.
201///
202/// <table>
203/// <tr><th> Optional arguments <th>
204/// <tr><td> Range(double lo, double hi) <td> Make plot frame for the specified range
205/// <tr><td> Range(const char* name) <td> Make plot frame for range with the specified name
206/// <tr><td> Bins(Int_t nbins) <td> Set default binning for datasets to specified number of bins
207/// <tr><td> AutoRange(const RooAbsData& data, double margin) <td> Specifies range so that all points in given data set fit
208/// inside the range with given margin.
209/// <tr><td> AutoSymRange(const RooAbsData& data, double margin) <td> Specifies range so that all points in given data set fit
210/// inside the range and center of range coincides with mean of distribution in given dataset.
211/// <tr><td> Name(const char* name) <td> Give specified name to RooPlot object
212/// <tr><td> Title(const char* title) <td> Give specified title to RooPlot object
213/// </table>
214///
216 const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
217{
219 cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
220 cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
221 cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
222 cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;
223
224 return frame(cmdList) ;
225}
226
227
228
229////////////////////////////////////////////////////////////////////////////////
230/// Back-end function for named argument frame() method
231
233{
234 // Define configuration for this method
235 RooCmdConfig pc("RooAbsRealLValue::frame(" + std::string(GetName()) + ")");
236 pc.defineDouble("min","Range",0,getMin()) ;
237 pc.defineDouble("max","Range",1,getMax()) ;
238 pc.defineInt("nbins","Bins",0,getBins()) ;
239 pc.defineString("rangeName","RangeWithName",0,"") ;
240 pc.defineString("name","Name",0,"") ;
241 pc.defineString("title","Title",0,"") ;
242 pc.defineMutex("Range","RangeWithName","AutoRange") ;
243 pc.defineObject("rangeData","AutoRange",0,nullptr) ;
244 pc.defineDouble("rangeMargin","AutoRange",0,0.1) ;
245 pc.defineInt("rangeSym","AutoRange",0,0) ;
246
247 // Process & check varargs
248 pc.process(cmdList) ;
249 if (!pc.ok(true)) {
250 return nullptr ;
251 }
252
253 // Extract values from named arguments
254 double xmin(getMin());
255 double xmax(getMax());
256 if (pc.hasProcessed("Range")) {
257 xmin = pc.getDouble("min") ;
258 xmax = pc.getDouble("max") ;
259 if (xmin==xmax) {
260 xmin = getMin() ;
261 xmax = getMax() ;
262 }
263 } else if (pc.hasProcessed("RangeWithName")) {
264 const char* rangeName=pc.getString("rangeName",nullptr,true) ;
267 } else if (pc.hasProcessed("AutoRange")) {
268 auto rangeData = static_cast<RooAbsData*>(pc.getObject("rangeData")) ;
269 const bool error = rangeData->getRange(*this,xmin,xmax);
270 if (error) {
271 xmin = getMin();
272 xmax = getMax();
273 }
274 if (pc.getInt("rangeSym")==0) {
275 // Regular mode: range is from xmin to xmax with given extra margin
276 double margin = pc.getDouble("rangeMargin")*(xmax-xmin) ;
277 xmin -= margin ;
278 xmax += margin ;
279 if (xmin<getMin()) xmin = getMin() ;
280 if (xmin>getMax()) xmax = getMax() ;
281 } else {
282 // Symmetric mode: range is centered at mean of distribution with enough width to include
283 // both lowest and highest point with margin
284 double dmean = rangeData->moment(const_cast<RooRealVar &>(static_cast<RooRealVar const&>(*this)),1) ;
285 double ddelta = ((xmax-dmean)>(dmean-xmin)?(xmax-dmean):(dmean-xmin))*(1+pc.getDouble("rangeMargin")) ;
286 xmin = dmean-ddelta ;
287 xmax = dmean+ddelta ;
288 if (xmin<getMin()) xmin = getMin() ;
289 if (xmin>getMax()) xmax = getMax() ;
290 }
291 } else {
292 xmin = getMin() ;
293 xmax = getMax() ;
294 }
295
296 Int_t nbins = pc.getInt("nbins") ;
297 const char* name = pc.getString("name",nullptr,true) ;
298 const char* title = pc.getString("title",nullptr,true) ;
299
300 RooPlot* theFrame = new RooPlot(*this,xmin,xmax,nbins) ;
301
302 if (name) {
303 theFrame->SetName(name) ;
304 }
305 if (title) {
306 theFrame->SetTitle(title) ;
307 }
308
309 return theFrame ;
310}
311
312
313
314////////////////////////////////////////////////////////////////////////////////
315/// Create a new RooPlot on the heap with a drawing frame initialized for this
316/// object, but no plot contents. Use x.frame() as the first argument to a
317/// y.plotOn(...) method, for example. The caller is responsible for deleting
318/// the returned object.
319
320RooPlot *RooAbsRealLValue::frame(double xlo, double xhi, Int_t nbins) const
321{
322 return new RooPlot(*this,xlo,xhi,nbins);
323}
324
325
326
327////////////////////////////////////////////////////////////////////////////////
328/// Create a new RooPlot on the heap with a drawing frame initialized for this
329/// object, but no plot contents. Use x.frame() as the first argument to a
330/// y.plotOn(...) method, for example. The caller is responsible for deleting
331/// the returned object.
332
333RooPlot *RooAbsRealLValue::frame(double xlo, double xhi) const
334{
335 return new RooPlot(*this,xlo,xhi,getBins());
336}
337
338
339
340////////////////////////////////////////////////////////////////////////////////
341/// Create a new RooPlot on the heap with a drawing frame initialized for this
342/// object, but no plot contents. Use x.frame() as the first argument to a
343/// y.plotOn(...) method, for example. The caller is responsible for deleting
344/// the returned object.
345///
346/// The current fit range may not be open ended or empty.
347
349{
350 // Plot range of variable may not be infinite or empty
351 if (getMin()==getMax()) {
352 coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << std::endl ;
353 return nullptr ;
354 }
356 coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << std::endl ;
357 return nullptr ;
358 }
359
360 return new RooPlot(*this,getMin(),getMax(),nbins);
361}
362
363
364
365////////////////////////////////////////////////////////////////////////////////
366/// Create a new RooPlot on the heap with a drawing frame initialized for this
367/// object, but no plot contents. Use x.frame() as the first argument to a
368/// y.plotOn(...) method, for example. The caller is responsible for deleting
369/// the returned object.
370///
371/// The current fit range may not be open ended or empty.
372
374{
375 // Plot range of variable may not be infinite or empty
376 if (getMin()==getMax()) {
377 coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << std::endl ;
378 return nullptr ;
379 }
381 coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << std::endl ;
382 return nullptr ;
383 }
384
385 return new RooPlot(*this,getMin(),getMax(),getBins());
386}
387
388
389
390////////////////////////////////////////////////////////////////////////////////
391/// Copy cache of another RooAbsArg to our cache
392
394{
396 setVal(_value) ; // force back-propagation
397}
398
399
400////////////////////////////////////////////////////////////////////////////////
401/// Structure printing
402
403void RooAbsRealLValue::printMultiline(ostream& os, Int_t contents, bool verbose, TString indent) const
404{
405 RooAbsReal::printMultiline(os,contents,verbose,indent);
406 os << indent << "--- RooAbsRealLValue ---" << std::endl;
407 TString unit(_unit);
408 if(!unit.IsNull()) unit.Prepend(' ');
409 os << indent << " Fit range is [ ";
410 if(hasMin()) {
411 os << getMin() << unit << " , ";
412 }
413 else {
414 os << "-INF , ";
415 }
416 if(hasMax()) {
417 os << getMax() << unit << " ]" << std::endl;
418 }
419 else {
420 os << "+INF ]" << std::endl;
421 }
422}
423
424
425
426////////////////////////////////////////////////////////////////////////////////
427/// Set a new value sampled from a uniform distribution over the fit range.
428/// Prints a warning and does nothing if the fit range is not finite.
429
431{
433 double min = binning.lowBound() ;
434 double max = binning.highBound() ;
435
437 setValFast(min + RooRandom::uniform()*(max-min));
438 }
439 else {
440 coutE(Generation) << fName << "::" << ClassName() << ":randomize: fails with unbounded fit range" << std::endl;
441 }
442}
443
444
445
446////////////////////////////////////////////////////////////////////////////////
447/// Set value to center of bin 'ibin' of binning 'rangeName' (or of
448/// default binning if no range is specified)
449
451{
452 // Check range of plot bin index
454 coutE(InputArguments) << "RooAbsRealLValue::setBin(" << GetName() << ") ERROR: bin index " << ibin
455 << " is out of range (0," << getBins(rangeName)-1 << ")" << std::endl ;
456 return ;
457 }
458
459 // Set value to center of requested bin
460 setValFast(getBinning(rangeName).binCenter(ibin)) ;
461}
462
463
464
465////////////////////////////////////////////////////////////////////////////////
466/// Set value to center of bin 'ibin' of binning 'binning'
467
469{
470 // Set value to center of requested bin
471 setValFast(binning.binCenter(ibin)) ;
472}
473
474
475
476////////////////////////////////////////////////////////////////////////////////
477/// Set a new value sampled from a uniform distribution over the fit range.
478/// Prints a warning and does nothing if the fit range is not finite.
479
481{
482 double range= binning.highBound() - binning.lowBound() ;
484}
485
486
487
488////////////////////////////////////////////////////////////////////////////////
489/// Check if fit range is usable as plot range, i.e. it is neither
490/// open ended, nor empty
491
493{
494 return (hasMin() && hasMax() && (getMin()!=getMax())) ;
495}
496
497
498
499////////////////////////////////////////////////////////////////////////////////
500/// Check if current value is inside range with given name. Multiple comma-separated
501/// ranges can be passed. In this case, it will be checked if the value is in any of
502/// these ranges.
503///
504/// Implements the following check to see if the value x is in the range [a, b]:
505/// check if `[x - eps * x, x + eps * x]` overlaps with `[a, b]`, where the
506/// parameter `eps` is defined as:
507/// ```
508/// std::max(RooNumber::rangeEpsRel() * std::abs(x), RooNumber::rangeEpsAbs())
509/// ```
510/// By default, RooNumber::rangeEpsRel() and RooNumber::rangeEpsRel() are set to zero.
511/// You can change them with RooNumber::setRangeEpsRel(double) and RooNumber::setRangeEpsAbs(double),
512/// but this should be only done if there is no other solution.
513bool RooAbsRealLValue::inRange(const char* name) const
514{
515 const double val = getVal() ;
516 const double epsilon = std::max(RooNumber::rangeEpsRel() * std::abs(val), RooNumber::rangeEpsAbs());
517 if (!name || name[0] == '\0') {
518 const auto minMax = getRange(nullptr);
519 return minMax.first - epsilon <= val && val <= minMax.second + epsilon;
520 }
521
522 const auto& ranges = ROOT::Split(name, ",");
523 return std::any_of(ranges.begin(), ranges.end(), [val,epsilon,this](const std::string& range){
524 const auto minMax = this->getRange(range.c_str());
525 return minMax.first - epsilon <= val && val <= minMax.second + epsilon;
526 });
527}
528
529
530
531////////////////////////////////////////////////////////////////////////////////
532
534 const RooCmdArg& arg3, const RooCmdArg& arg4, const RooCmdArg& arg5,
535 const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
536
537 // Create an empty ROOT histogram TH1,TH2 or TH3 suitabe to store information represent by the RooAbsRealLValue
538 //
539 // This function accepts the following arguments
540 //
541 // name -- Name of the ROOT histogram
542 //
543 // Binning(const char* name) -- Apply binning with given name to x axis of histogram
544 // Binning(RooAbsBinning& binning) -- Apply specified binning to x axis of histogram
545 // Binning(int_t nbins) -- Apply specified binning to x axis of histogram
546 // Binning(int_t nbins, double lo, double hi) -- Apply specified binning to x axis of histogram
547 // ConditionalObservables(const RooArgSet& set) -- Do not normalized PDF over following observables when projecting PDF into histogram
548 //
549 // YVar(const RooAbsRealLValue& var,...) -- Observable to be mapped on y axis of ROOT histogram
550 // ZVar(const RooAbsRealLValue& var,...) -- Observable to be mapped on z axis of ROOT histogram
551 //
552 // The YVar() and ZVar() arguments can be supplied with optional Binning() arguments to control the binning of the Y and Z axes, e.g.
553 // createHistogram("histo",x,Binning(-1,1,20), YVar(y,Binning(-1,1,30)), ZVar(z,Binning("zbinning")))
554 //
555 // The caller takes ownership of the returned histogram
556{
558 l.Add((TObject*)&arg1) ; l.Add((TObject*)&arg2) ;
559 l.Add((TObject*)&arg3) ; l.Add((TObject*)&arg4) ;
560 l.Add((TObject*)&arg5) ; l.Add((TObject*)&arg6) ;
561 l.Add((TObject*)&arg7) ; l.Add((TObject*)&arg8) ;
562
563 return createHistogram(name,l) ;
564}
565
566
567
568////////////////////////////////////////////////////////////////////////////////
569/// Create empty 1,2 or 3D histogram
570/// Arguments recognized
571///
572/// YVar() -- RooRealVar defining Y dimension with optional range/binning
573/// ZVar() -- RooRealVar defining Z dimension with optional range/binning
574/// AxisLabel() -- Vertical axis label
575/// Binning() -- Range/Binning specification of X axis
576
578{
579 // Define configuration for this method
580 RooCmdConfig pc("RooAbsRealLValue::createHistogram(" + std::string(GetName()) + ")");
581
582 pc.defineObject("xbinning","Binning",0,nullptr) ;
583 pc.defineString("xbinningName","BinningName",0,"") ;
584 pc.defineInt("nxbins","BinningSpec",0) ;
585 pc.defineDouble("xlo","BinningSpec",0,0) ;
586 pc.defineDouble("xhi","BinningSpec",1,0) ;
587
588 pc.defineObject("yvar","YVar",0,nullptr) ;
589 pc.defineObject("ybinning","YVar::Binning",0,nullptr) ;
590 pc.defineString("ybinningName","YVar::BinningName",0,"") ;
591 pc.defineInt("nybins","YVar::BinningSpec",0) ;
592 pc.defineDouble("ylo","YVar::BinningSpec",0,0) ;
593 pc.defineDouble("yhi","YVar::BinningSpec",1,0) ;
594
595 pc.defineObject("zvar","ZVar",0,nullptr) ;
596 pc.defineObject("zbinning","ZVar::Binning",0,nullptr) ;
597 pc.defineString("zbinningName","ZVar::BinningName",0,"") ;
598 pc.defineInt("nzbins","ZVar::BinningSpec",0) ;
599 pc.defineDouble("zlo","ZVar::BinningSpec",0,0) ;
600 pc.defineDouble("zhi","ZVar::BinningSpec",1,0) ;
601
602 pc.defineString("axisLabel","AxisLabel",0,"Events") ;
603
604 pc.defineDependency("ZVar","YVar") ;
605
606 // Process & check varargs
607 pc.process(cmdList) ;
608 if (!pc.ok(true)) {
609 return nullptr ;
610 }
611
612 // Initialize arrays for call to implementation version of createHistogram
613 const char* axisLabel = pc.getString("axisLabel") ;
614 const RooAbsBinning* binning[3] ;
615 bool ownBinning[3] = { false, false, false } ;
616 RooArgList vars ;
617
618 // Prepare X dimension
619 vars.add(*this) ;
620 if (pc.hasProcessed("Binning")) {
621 binning[0] = static_cast<RooAbsBinning*>(pc.getObject("xbinning")) ;
622 } else if (pc.hasProcessed("BinningName")) {
623 binning[0] = &getBinning(pc.getString("xbinningName",nullptr,true)) ;
624 } else if (pc.hasProcessed("BinningSpec")) {
625 double xlo = pc.getDouble("xlo") ;
626 double xhi = pc.getDouble("xhi") ;
627 binning[0] = new RooUniformBinning((xlo==xhi)?getMin():xlo,(xlo==xhi)?getMax():xhi,pc.getInt("nxbins")) ;
628 ownBinning[0] = true ;
629 } else {
630 binning[0] = &getBinning() ;
631 }
632
633 if (pc.hasProcessed("YVar")) {
634 RooAbsRealLValue& yvar = *static_cast<RooAbsRealLValue*>(pc.getObject("yvar")) ;
635 vars.add(yvar) ;
636 if (pc.hasProcessed("YVar::Binning")) {
637 binning[1] = static_cast<RooAbsBinning*>(pc.getObject("ybinning")) ;
638 } else if (pc.hasProcessed("YVar::BinningName")) {
639 binning[1] = &yvar.getBinning(pc.getString("ybinningName",nullptr,true)) ;
640 } else if (pc.hasProcessed("YVar::BinningSpec")) {
641 double ylo = pc.getDouble("ylo") ;
642 double yhi = pc.getDouble("yhi") ;
643 binning[1] = new RooUniformBinning((ylo==yhi)?yvar.getMin():ylo,(ylo==yhi)?yvar.getMax():yhi,pc.getInt("nybins")) ;
644 ownBinning[1] = true ;
645 } else {
646 binning[1] = &yvar.getBinning() ;
647 }
648 }
649
650 if (pc.hasProcessed("ZVar")) {
651 RooAbsRealLValue& zvar = *static_cast<RooAbsRealLValue*>(pc.getObject("zvar")) ;
652 vars.add(zvar) ;
653 if (pc.hasProcessed("ZVar::Binning")) {
654 binning[2] = static_cast<RooAbsBinning*>(pc.getObject("zbinning")) ;
655 } else if (pc.hasProcessed("ZVar::BinningName")) {
656 binning[2] = &zvar.getBinning(pc.getString("zbinningName",nullptr,true)) ;
657 } else if (pc.hasProcessed("ZVar::BinningSpec")) {
658 double zlo = pc.getDouble("zlo") ;
659 double zhi = pc.getDouble("zhi") ;
660 binning[2] = new RooUniformBinning((zlo==zhi)?zvar.getMin():zlo,(zlo==zhi)?zvar.getMax():zhi,pc.getInt("nzbins")) ;
661 ownBinning[2] = true ;
662 } else {
663 binning[2] = &zvar.getBinning() ;
664 }
665 }
666
667
668 TH1* ret = createHistogram(name, vars, axisLabel, binning) ;
669
670 if (ownBinning[0]) delete binning[0] ;
671 if (ownBinning[1]) delete binning[1] ;
672 if (ownBinning[2]) delete binning[2] ;
673
674 return ret ;
675}
676
677
678
679////////////////////////////////////////////////////////////////////////////////
680/// Create an empty 1D-histogram with appropriate scale and labels for this variable.
681/// This method uses the default plot range which can be changed using the
682/// setPlotMin(),setPlotMax() methods, and the default binning which can be
683/// changed with setPlotBins(). The caller takes ownership of the returned
684/// object and is responsible for deleting it.
685
687{
688 // Check if the fit range is usable as plot range
689 if (!fitRangeOKForPlotting()) {
690 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
691 << ") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
692 return nullptr ;
693 }
694
695 RooArgList list(*this) ;
696 double xlo = getMin() ;
697 double xhi = getMax() ;
698 Int_t nbins = getBins() ;
699
700 // coverity[ARRAY_VS_SINGLETON]
701 return static_cast<TH1F*>(createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nbins));
702}
703
704
705
706////////////////////////////////////////////////////////////////////////////////
707/// Create an empty 1D-histogram with appropriate scale and labels for this variable.
708/// This method uses the default plot range which can be changed using the
709/// setPlotMin(),setPlotMax() methods, and the default binning which can be
710/// changed with setPlotBins(). The caller takes ownership of the returned
711/// object and is responsible for deleting it.
712
713TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, double xlo, double xhi, Int_t nBins) const
714{
715 RooArgList list(*this) ;
716
717 // coverity[ARRAY_VS_SINGLETON]
718 return static_cast<TH1F*>(createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nBins));
719}
720
721
722
723////////////////////////////////////////////////////////////////////////////////
724/// Create an empty 1D-histogram with appropriate scale and labels for this variable.
725
726TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, const RooAbsBinning& bins) const
727{
728 RooArgList list(*this) ;
729 const RooAbsBinning* pbins = &bins ;
730
731 // coverity[ARRAY_VS_SINGLETON]
732 return static_cast<TH1F*>(createHistogram(name, list, yAxisLabel, &pbins));
733}
734
735
736
737////////////////////////////////////////////////////////////////////////////////
738/// Create an empty 2D-histogram with appropriate scale and labels for this variable (x)
739/// and the specified y variable. This method uses the default plot ranges for x and y which
740/// can be changed using the setPlotMin(),setPlotMax() methods, and the default binning which
741/// can be changed with setPlotBins(). The caller takes ownership of the returned object
742/// and is responsible for deleting it.
743
745 double* xlo, double* xhi, Int_t* nBins) const
746{
747 if ((!xlo && xhi) || (xlo && !xhi)) {
748 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
749 << ") ERROR must specify either no range, or both limits" << std::endl ;
750 return nullptr ;
751 }
752
753 double xlo_fit[2] ;
754 double xhi_fit[2] ;
755 Int_t nbins_fit[2] ;
756
757 double *xlo2 = xlo;
758 double *xhi2 = xhi;
759 Int_t *nBins2 = nBins;
760
761 if (!xlo2) {
762
763 if (!fitRangeOKForPlotting()) {
764 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
765 << ") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
766 return nullptr ;
767 }
768 if (!yvar.fitRangeOKForPlotting()) {
769 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
770 << ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << std::endl ;
771 return nullptr ;
772 }
773
774 xlo_fit[0] = getMin() ;
775 xhi_fit[0] = getMax() ;
776
777 xlo_fit[1] = yvar.getMin() ;
778 xhi_fit[1] = yvar.getMax() ;
779
780 xlo2 = xlo_fit ;
781 xhi2 = xhi_fit ;
782 }
783
784 if (!nBins2) {
785 nbins_fit[0] = getBins() ;
786 nbins_fit[1] = yvar.getBins() ;
787 nBins2 = nbins_fit ;
788 }
789
790
791 RooArgList list(*this,yvar) ;
792 // coverity[OVERRUN_STATIC]
793 return static_cast<TH2F*>(createHistogram(name, list, zAxisLabel, xlo2, xhi2, nBins2));
794}
795
796
797
798////////////////////////////////////////////////////////////////////////////////
799/// Create an empty 2D-histogram with appropriate scale and labels for this variable (x)
800/// and the specified y variable.
801
803 const char *zAxisLabel, const RooAbsBinning** bins) const
804{
805 RooArgList list(*this,yvar) ;
806 return static_cast<TH2F*>(createHistogram(name, list, zAxisLabel, bins));
807}
808
809
810
811////////////////////////////////////////////////////////////////////////////////
812/// Create an empty 3D-histogram with appropriate scale and labels for this variable (x)
813/// and the specified y,z variables. This method uses the default plot ranges for x,y,z which
814/// can be changed using the setPlotMin(),setPlotMax() methods, and the default binning which
815/// can be changed with setPlotBins(). The caller takes ownership of the returned object
816/// and is responsible for deleting it.
817
819 const char *tAxisLabel, double* xlo, double* xhi, Int_t* nBins) const
820{
821 if ((!xlo && xhi) || (xlo && !xhi)) {
822 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
823 << ") ERROR must specify either no range, or both limits" << std::endl ;
824 return nullptr ;
825 }
826
827 double xlo_fit[3] ;
828 double xhi_fit[3] ;
829 Int_t nbins_fit[3] ;
830
831 double *xlo2 = xlo;
832 double *xhi2 = xhi;
833 Int_t* nBins2 = nBins;
834 if (!xlo2) {
835
836 if (!fitRangeOKForPlotting()) {
837 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
838 << ") ERROR: fit range empty or open ended, must explicitly specify range" << std::endl ;
839 return nullptr ;
840 }
841 if (!yvar.fitRangeOKForPlotting()) {
842 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
843 << ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << std::endl ;
844 return nullptr ;
845 }
846 if (!zvar.fitRangeOKForPlotting()) {
847 coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
848 << ") ERROR: fit range of " << zvar.GetName() << " empty or open ended, must explicitly specify range" << std::endl ;
849 return nullptr ;
850 }
851
852 xlo_fit[0] = getMin() ;
853 xhi_fit[0] = getMax() ;
854
855 xlo_fit[1] = yvar.getMin() ;
856 xhi_fit[1] = yvar.getMax() ;
857
858 xlo_fit[2] = zvar.getMin() ;
859 xhi_fit[2] = zvar.getMax() ;
860
861 xlo2 = xlo_fit ;
862 xhi2 = xhi_fit ;
863 }
864
865 if (!nBins2) {
866 nbins_fit[0] = getBins() ;
867 nbins_fit[1] = yvar.getBins() ;
868 nbins_fit[2] = zvar.getBins() ;
869 nBins2 = nbins_fit ;
870 }
871
872 RooArgList list(*this,yvar,zvar) ;
873 return static_cast<TH3F*>(createHistogram(name, list, tAxisLabel, xlo2, xhi2, nBins2));
874}
875
876
878 const char* tAxisLabel, const RooAbsBinning** bins) const
879{
880 // Create an empty 3D-histogram with appropriate scale and labels for this variable (x)
881 // and the specified y,z variables.
882
883 RooArgList list(*this,yvar,zvar) ;
884 return static_cast<TH3F*>(createHistogram(name, list, tAxisLabel, bins));
885}
886
887
888
889
890////////////////////////////////////////////////////////////////////////////////
891/// Create 1-, 2- or 3-d ROOT histogram with labels taken
892/// from the variables in 'vars' and the with range and binning
893/// specified in xlo,xhi and nBins. The dimensions of the arrays xlo,xhi,
894/// nBins should match the number of objects in vars.
895
897 double* xlo, double* xhi, Int_t* nBins)
898{
899 const RooAbsBinning* bin[3] ;
900 Int_t ndim = vars.size() ;
901 bin[0] = new RooUniformBinning(xlo[0],xhi[0],nBins[0]) ;
902 bin[1] = (ndim>1) ? new RooUniformBinning(xlo[1],xhi[1],nBins[1]) : nullptr ;
903 bin[2] = (ndim>2) ? new RooUniformBinning(xlo[2],xhi[2],nBins[2]) : nullptr ;
904
905 TH1* ret = createHistogram(name,vars,tAxisLabel,bin) ;
906
907 if (bin[0]) delete bin[0] ;
908 if (bin[1]) delete bin[1] ;
909 if (bin[2]) delete bin[2] ;
910 return ret ;
911}
912
913
914
915////////////////////////////////////////////////////////////////////////////////
916/// Create a 1,2, or 3D-histogram with appropriate scale and labels.
917/// Binning and ranges are taken from the variables themselves and can be changed by
918/// calling their setPlotMin/Max() and setPlotBins() methods. A histogram can be filled
919/// using RooAbsReal::fillHistogram() or RooTreeData::fillHistogram().
920/// The caller takes ownership of the returned object and is responsible for deleting it.
921
922TH1 *RooAbsRealLValue::createHistogram(const char *name, RooArgList &vars, const char *tAxisLabel, const RooAbsBinning** bins)
923{
924 // Check that we have 1-3 vars
925 Int_t dim= vars.size();
926 if(dim < 1 || dim > 3) {
927 oocoutE(nullptr,InputArguments) << "RooAbsReal::createHistogram: dimension not supported: " << dim << std::endl;
928 return nullptr;
929 }
930
931 // Check that all variables are AbsReals and prepare a name of the form <name>_<var1>_...
932 TString histName(name);
933 histName.Append("_");
934 const RooAbsRealLValue *xyz[3];
935
936 Int_t index;
937 for(index= 0; index < dim; index++) {
938 const RooAbsArg *arg= vars.at(index);
939 xyz[index]= dynamic_cast<const RooAbsRealLValue*>(arg);
940 if(!xyz[index]) {
941 oocoutE(nullptr,InputArguments) << "RooAbsRealLValue::createHistogram: variable is not real lvalue: " << arg->GetName() << std::endl;
942 return nullptr;
943 }
944 histName.Append("_");
945 histName.Append(arg->GetName());
946 }
947 TString histTitle(histName);
948 histTitle.Prepend("Histogram of ");
949
950 // Create the histogram
951 TH1 *histogram = nullptr;
952 switch(dim) {
953 case 1:
954 if (bins[0]->isUniform()) {
955 histogram= new TH1F(histName.Data(), histTitle.Data(),
956 bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound());
957 } else {
958 histogram= new TH1F(histName.Data(), histTitle.Data(),
959 bins[0]->numBins(),bins[0]->array());
960 }
961 break;
962 case 2:
963 if (bins[0]->isUniform() && bins[1]->isUniform()) {
964 histogram= new TH2F(histName.Data(), histTitle.Data(),
965 bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
966 bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound());
967 } else {
968 histogram= new TH2F(histName.Data(), histTitle.Data(),
969 bins[0]->numBins(),bins[0]->array(),
970 bins[1]->numBins(),bins[1]->array());
971 }
972 break;
973 case 3:
974 if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
975 histogram= new TH3F(histName.Data(), histTitle.Data(),
976 bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
977 bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound(),
978 bins[2]->numBins(),bins[2]->lowBound(),bins[2]->highBound()) ;
979 } else {
980 histogram= new TH3F(histName.Data(), histTitle.Data(),
981 bins[0]->numBins(),bins[0]->array(),
982 bins[1]->numBins(),bins[1]->array(),
983 bins[2]->numBins(),bins[2]->array()) ;
984 }
985 break;
986 }
987 if(!histogram) {
988 oocoutE(nullptr,InputArguments) << "RooAbsReal::createHistogram: unable to create a new histogram" << std::endl;
989 return nullptr;
990 }
991
992 // Set the histogram coordinate axis labels from the titles of each variable, adding units if necessary.
993 for(index= 0; index < dim; index++) {
994 TString axisTitle(xyz[index]->getTitle(true));
995 switch(index) {
996 case 0:
997 histogram->SetXTitle(axisTitle.Data());
998 break;
999 case 1:
1000 histogram->SetYTitle(axisTitle.Data());
1001 break;
1002 case 2:
1003 histogram->SetZTitle(axisTitle.Data());
1004 break;
1005 default:
1006 assert(0);
1007 break;
1008 }
1009 }
1010
1011 // Set the t-axis title if given one
1012 if((nullptr != tAxisLabel) && (0 != strlen(tAxisLabel))) {
1014 axisTitle.Append(" / ( ");
1015 for(Int_t index2= 0; index2 < dim; index2++) {
1016 double delta= bins[index2]->averageBinWidth() ; // xyz[index2]->getBins();
1017 if(index2 > 0) axisTitle.Append(" x ");
1018 axisTitle.Append(Form("%g",delta));
1019 if(strlen(xyz[index2]->getUnit())) {
1020 axisTitle.Append(" ");
1021 axisTitle.Append(xyz[index2]->getUnit());
1022 }
1023 }
1024 axisTitle.Append(" )");
1025 switch(dim) {
1026 case 1:
1027 histogram->SetYTitle(axisTitle.Data());
1028 break;
1029 case 2:
1030 histogram->SetZTitle(axisTitle.Data());
1031 break;
1032 case 3:
1033 // not supported in TH1
1034 break;
1035 default:
1036 assert(0);
1037 break;
1038 }
1039 }
1040
1041 return histogram;
1042}
1043
1044
1046{
1047 // Interface function to indicate that this lvalue
1048 // has a unit or constant jacobian terms with respect to
1049 // the observable passed as argument. This default implementation
1050 // always returns true (i.e. jacobian is constant)
1051 return true ;
1052}
1053
1054
1056{
1057 std::stringstream errStream;
1058 errStream << "Attempting to integrate the " << ClassName() << " \"" << GetName()
1059 << "\", but integrating a RooAbsRealLValue is not allowed!";
1060 const std::string errString = errStream.str();
1061 coutE(InputArguments) << errString << std::endl;
1062 throw std::runtime_error(errString);
1063}
#define coutI(a)
#define oocoutE(o, a)
#define coutE(a)
static void indent(ostringstream &buf, int indent_level)
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 char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
Abstract base class for RooRealVar binning definitions.
virtual double binCenter(Int_t bin) const =0
Int_t numBins() const
Return number of bins.
virtual double averageBinWidth() const =0
virtual double highBound() const =0
virtual double lowBound() const =0
virtual double * array() const =0
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract base class for objects that are lvalues, i.e.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Int_t numBins(const char *rangeName=nullptr) const override
virtual Int_t getBins(const char *name=nullptr) const
Get number of bins of currently defined range.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooArgSet *nset=nullptr, const RooNumIntConfig *cfg=nullptr, const char *rangeName=nullptr) const override
Create an object that represents the integral of the function over one or more observables listed in ...
virtual void setValFast(double value)
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
bool isValidReal(double value, bool printError=false) const override
Check if given value is valid.
virtual const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const =0
Retrieve binning configuration with given name or default binning.
TH1 * createHistogram(const char *name, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
virtual bool isJacobianOK(const RooArgSet &depList) const
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
RooPlot * frame() const
Create a new RooPlot on the heap with a drawing frame initialized for this object,...
bool hasMax(const char *name=nullptr) const
Check if variable has an upper bound.
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy cache of another RooAbsArg to our cache.
bool fitRangeOKForPlotting() const
Check if fit range is usable as plot range, i.e.
void setBin(Int_t ibin, const char *rangeName=nullptr) override
Set value to center of bin 'ibin' of binning 'rangeName' (or of default binning if no range is specif...
void writeToStream(std::ostream &os, bool compact) const override
Write object contents to given stream.
void randomize(const char *rangeName=nullptr) override
Set a new value sampled from a uniform distribution over the fit range.
virtual void setVal(double value)=0
Set the current value of the object. Needs to be overridden by implementations.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
bool readFromStream(std::istream &is, bool compact, bool verbose=false) override
Read object contents from given stream.
bool inRange(const char *name) const override
Check if current value is inside range with given name.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
std::pair< double, double > getRange(const char *name=nullptr) const
Get low and high bound of the variable.
virtual RooAbsArg & operator=(double newValue)
Assignment operator from a double.
bool hasMin(const char *name=nullptr) const
Check if variable has a lower bound.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:103
TString _unit
Unit for objects value.
Definition RooAbsReal.h:536
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Structure printing.
void copyCache(const RooAbsArg *source, bool valueOnly=false, bool setValDirty=true) override
Copy the cached value of another RooAbsArg to our cache.
double _value
Cache for current value of object.
Definition RooAbsReal.h:535
TString getTitle(bool appendUnit=false) const
Return this variable's title string.
const Text_t * getUnit() const
Definition RooAbsReal.h:145
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
Definition RooArgList.h:110
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Named container for two doubles, two integers two object points and three string pointers that can be...
Definition RooCmdArg.h:26
Configurable parser for RooCmdArg named arguments.
void defineMutex(const char *head, Args_t &&... tail)
Define arguments where any pair is mutually exclusive.
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
bool hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
double getDouble(const char *name, double defaultValue=0.0) const
Return double property registered with name 'name'.
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
bool defineDouble(const char *name, const char *argName, int doubleNum, double defValue=0.0)
Define double property name 'name' mapped to double in slot 'doubleNum' in RooCmdArg with name argNam...
bool ok(bool verbose) const
Return true of parsing was successful.
bool defineObject(const char *name, const char *argName, int setNum, const TObject *obj=nullptr, bool isArray=false)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
const char * getString(const char *name, const char *defaultValue="", bool convEmptyToNull=false) const
Return string property registered with name 'name'.
bool defineString(const char *name, const char *argName, int stringNum, const char *defValue="", bool appendMode=false)
Define double property name 'name' mapped to double in slot 'stringNum' in RooCmdArg with name argNam...
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
TObject * getObject(const char *name, TObject *obj=nullptr) const
Return TObject property registered with name 'name'.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
static double rangeEpsRel()
Get the relative epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:34
static double rangeEpsAbs()
Get the absolute epsilon that is used by range checks in RooFit, e.g., in RooAbsRealLValue::inRange()...
Definition RooNumber.h:41
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Definition RooNumber.h:27
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
static double uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Definition RooRandom.cxx:77
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Implementation of RooAbsBinning that provides a uniform binning in 'n' bins between the range end poi...
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:645
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:307
3-D histogram with a float per channel (see TH1 documentation)
Definition TH3.h:317
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
TString fName
Definition TNamed.h:32
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:225
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
TString & Prepend(const char *cs)
Definition TString.h:673
Bool_t IsNull() const
Definition TString.h:414
TString & Append(const char *cs)
Definition TString.h:572
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35
TLine l
Definition textangle.C:4