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