Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooUnitTest.cxx
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * @(#)root/roofitcore:$Id$
7 * Authors: *
8 * WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl *
9 * *
10 * Copyright (c) 2000-2011, Regents of the University of California *
11 * and Stanford University. All rights reserved. *
12 * *
13 * Redistribution and use in source and binary forms, *
14 * with or without modification, are permitted according to the terms *
15 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
16 *****************************************************************************/
17
18/**
19\file RooUnitTest.cxx
20\class RooUnitTest
21\ingroup Roofitcore
22
23RooUnit test is an abstract base class for unit regression tests for
24RooFit and RooStats tests performed in stressRooFit and stressRooStats
25Implementations of this class must implement abstract method testCode()
26which defines the regression test to be performed. Inside testCode()
27the regression test can define objects on which the regression is performed.
28These are:
29Object | function
30----------------|------------
31 RooPlot | regPlot()
32 RooFitResult | regResult()
33 double | regValue()
34 RooTable | regTable()
35 TH1/2/3 | regTH()
36 RooWorkspace | regWS()
37**/
38
39#include "RooUnitTest.h"
40
41#include "RooCurve.h"
42#include "RooHist.h"
43#include "RooMsgService.h"
44#include "RooDouble.h"
45#include "RooTrace.h"
46#include "RooRandom.h"
47
48#include <TClass.h>
49#include <TDirectory.h>
50#include <TFile.h>
51
52#include <cmath>
53
54TDirectory* RooUnitTest::gMemDir = nullptr;
55
56
57////////////////////////////////////////////////////////////////////////////////
58
59RooUnitTest::RooUnitTest(const char* name, TFile* refFile, bool writeRef, Int_t verbose) : TNamed(name,name),
60 _refFile(refFile), _debug(false), _write(writeRef), _verb(verbose)
61{
62}
63
64
65////////////////////////////////////////////////////////////////////////////////
66
67void RooUnitTest::regPlot(RooPlot* frame, const char* refName)
68{
69 if (_refFile) {
70 std::string refNameStr(refName) ;
71 frame->SetName(refName) ;
72 // Since ROOT 6.28, the RooPlot doesn't clone the plot variable by default
73 // anymore. This is a problem for registering the RooPlots, because they
74 // need to survive without dangling pointers even after the RooUnitTest is
75 // done. For that reason, we ask the RooPlot to create an internal plot
76 // variable clone for itself.
78 _regPlots.emplace_back(frame,refNameStr);
79 } else {
80 delete frame ;
81 }
82}
83
84
85////////////////////////////////////////////////////////////////////////////////
86
87void RooUnitTest::regResult(std::unique_ptr<RooFitResult> r, const char* refName)
88{
89 if (_refFile) {
90 _regResults.emplace_back(r.release(),refName);
91 }
92}
93
94
95////////////////////////////////////////////////////////////////////////////////
96
97void RooUnitTest::regValue(double d, const char* refName)
98{
99 if (_refFile) {
100 _regValues.emplace_back(d,refName);
101 }
102}
103
104
105////////////////////////////////////////////////////////////////////////////////
106
107void RooUnitTest::regTable(RooTable* t, const char* refName)
108{
109 if (_refFile) {
110 _regTables.emplace_back(t,refName) ;
111 } else {
112 delete t ;
113 }
114}
115
116
117////////////////////////////////////////////////////////////////////////////////
118
119void RooUnitTest::regWS(RooWorkspace* ws, const char* refName)
120{
121 if (_refFile) {
122 _regWS.emplace_back(ws,refName) ;
123 } else {
124 delete ws ;
125 }
126}
127
128
129////////////////////////////////////////////////////////////////////////////////
130
131void RooUnitTest::regTH(TH1* th, const char* refName)
132{
133 if (_refFile) {
134 _regTH.emplace_back(th,refName) ;
135 } else {
136 delete th ;
137 }
138}
139
140
141////////////////////////////////////////////////////////////////////////////////
142
143RooWorkspace* RooUnitTest::getWS(const char* refName)
144{
145 RooWorkspace* ws = dynamic_cast<RooWorkspace*>(_refFile->Get(refName)) ;
146 if (!ws) {
147 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooWorkspace " << refName
148 << " from reference file, skipping " << std::endl ;
149 return nullptr ;
150 }
151
152 return ws ;
153}
154
155
156////////////////////////////////////////////////////////////////////////////////
157
158bool RooUnitTest::areTHidentical(TH1* htest, TH1* href)
159{
160 if (htest->GetDimension() != href->GetDimension()) {
161 return false ;
162 }
163
164 // Use Kolmogorov distance as metric rather than probability
165 // because we expect histograms to be identical rather
166 // than drawn from the same parent distribution
167 double kmax = htest->KolmogorovTest(href,"M") ;
168
169 if (kmax>htol()) {
170
171 if(_verb >= 0) std::cout << "KS distances = " << kmax << std::endl;
172
173 Int_t ntest = htest->GetNbinsX() +2 ;
174 Int_t nref = href->GetNbinsX() +2 ;
175 if (htest->GetDimension()>1) {
176 ntest *= htest->GetNbinsY() + 2 ;
177 nref *= href->GetNbinsY() + 2 ;
178 }
179 if (htest->GetDimension()>2) {
180 ntest *= htest->GetNbinsZ() + 2 ;
181 nref *= href->GetNbinsZ() + 2 ;
182 }
183
184 if (ntest != nref) {
185 return false ;
186 }
187
188 for (Int_t i=0 ; i<ntest ; i++) {
189 if (std::abs(htest->GetBinContent(i)-href->GetBinContent(i))>htol()) {
190 if(_verb >= 0) std::cout << "htest[" << i << "] = " << htest->GetBinContent(i) << " href[" << i << "] = " << href->GetBinContent(i) << std::endl;
191 }
192 }
193
194 return false ;
195 }
196
197 return true ;
198}
199
200
201
202////////////////////////////////////////////////////////////////////////////////
203
204bool RooUnitTest::runCompTests()
205{
206 bool ret = true ;
207
208 auto iter = _regPlots.begin() ;
209 while (iter!=_regPlots.end()) {
210
211 if (!_write) {
212
213 // Comparison mode
214
215 // Retrieve benchmark
216 RooPlot* bmark = dynamic_cast<RooPlot*>(_refFile->Get(iter->second.c_str())) ;
217 if (!bmark) {
218 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second
219 << " from reference file, skipping " << std::endl;
220 ret = false ;
221 ++iter ;
222 continue ;
223 }
224
225 if (_verb > 0) {
226 std::cout << "comparing RooPlot " << iter->first << " to benchmark " << iter->second << " = " << bmark << std::endl ;
227 std::cout << "reference: " ; iter->first->Print() ;
228 std::cout << "benchmark: " ; bmark->Print() ;
229 }
230
231 RooPlot* compPlot = _debug ? iter->first->emptyClone(Form("%s_comparison",iter->first->GetName())) : nullptr ;
232 bool anyFail=false ;
233
234 Stat_t nItems = iter->first->numItems() ;
235 for (Stat_t i=0 ; i<nItems ; i++) {
236 // coverity[NULL_RETURNS]
237 TObject* obj = iter->first->getObject((Int_t)i) ;
238
239 // Retrieve corresponding object from reference frame
240 TObject* objRef = bmark->findObject(obj->GetName()) ;
241
242 if (!objRef) {
243 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve reference object " << obj->GetName()
244 << " from benchmark RooPlot " << iter->second << ", skipping" << std::endl;
245 ret = false ;
246 break ;
247 }
248
249 // Histogram comparisons
250 if (obj->IsA()==RooHist::Class()) {
251 RooHist* testHist = static_cast<RooHist*>(obj) ;
252 RooHist* refHist = static_cast<RooHist*>(objRef) ;
253 if (!testHist->isIdentical(*refHist,htol(),_verb >= 0)) {
254 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
255 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
256
257 if (compPlot) {
258 compPlot->addPlotable(static_cast<RooHist*>(testHist->Clone()),"P") ;
259 compPlot->getAttLine()->SetLineColor(kRed) ;
260 compPlot->getAttMarker()->SetMarkerColor(kRed) ;
261 compPlot->getAttLine()->SetLineWidth(1) ;
262
263 compPlot->addPlotable(static_cast<RooHist*>(refHist->Clone()),"P") ;
264 compPlot->getAttLine()->SetLineColor(kBlue) ;
265 compPlot->getAttMarker()->SetMarkerColor(kBlue) ;
266 compPlot->getAttLine()->SetLineWidth(1) ;
267 }
268
269 anyFail=true ;
270 ret = false ;
271 }
272 } else if (obj->IsA()==RooCurve::Class()) {
273 RooCurve* testCurve = static_cast<RooCurve*>(obj) ;
274 RooCurve* refCurve = static_cast<RooCurve*>(objRef) ;
275 if (!testCurve->isIdentical(*refCurve,ctol(),_verb >= 0)) {
276 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
277 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
278
279 if (compPlot) {
280 compPlot->addPlotable(static_cast<RooCurve*>(testCurve->Clone())) ;
281 compPlot->getAttLine()->SetLineColor(kRed) ;
282 compPlot->getAttLine()->SetLineWidth(1) ;
283 compPlot->getAttLine()->SetLineStyle(kSolid) ;
284
285 compPlot->addPlotable(static_cast<RooCurve*>(refCurve->Clone())) ;
286 compPlot->getAttLine()->SetLineColor(kBlue) ;
287 compPlot->getAttLine()->SetLineWidth(1) ;
288 compPlot->getAttLine()->SetLineStyle(kDashed) ;
289 }
290
291 anyFail=true ;
292 ret = false ;
293 }
294
295 }
296
297 }
298
299 if (anyFail && compPlot) {
300 std::cout << "RooUnitTest INFO: writing comparison plot " << compPlot->GetName() << " of failed test to RooUnitTest_DEBUG.root" << std::endl ;
301 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
302 compPlot->Write() ;
303 fdbg.Close() ;
304 } else {
305 delete compPlot ;
306 }
307
308 // Delete RooPlot when comparison is finished to avoid noise in leak checking
309 delete iter->first ;
310
311 } else {
312
313 // Writing mode
314
315 std::cout <<"RooUnitTest: Writing reference RooPlot " << iter->first << " as benchmark " << iter->second << std::endl ;
316 _refFile->cd() ;
317 iter->first->Write(iter->second.c_str()) ;
318 gMemDir->cd() ;
319 }
320
321 ++iter ;
322 }
323
324
325 auto iter2 = _regResults.begin() ;
326 while (iter2!=_regResults.end()) {
327
328 if (!_write) {
329
330 // Comparison mode
331
332 // Retrieve benchmark
333 RooFitResult* bmark = dynamic_cast<RooFitResult*>(_refFile->Get(iter2->second.c_str())) ;
334 if (!bmark) {
335 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooFitResult "
336 << iter2->second << " from reference file, skipping " << std::endl ;
337 ++iter2 ;
338 ret = false ;
339 continue ;
340 }
341
342 if (_verb > 0) {
343 std::cout << "comparing RooFitResult " << iter2->first << " to benchmark " << iter2->second << " = " << bmark << std::endl ;
344 }
345
346 if (!iter2->first->isIdentical(*bmark,fptol(),fctol(),_verb >= 0)) {
347 if (_verb >= 0) {
348 std::cout << "RooUnitTest ERROR: comparison of object " << iter2->first->ClassName()
349 << "::" << iter2->first->GetName() << " from result " << iter2->second
350 << " fails comparison with counterpart in reference RooFitResult " << bmark->GetName() << std::endl;
351 }
352 ret = false ;
353 }
354
355 // Delete RooFitResult when comparison is finished to avoid noise in leak checking
356 delete iter2->first ;
357
358
359 } else {
360
361 // Writing mode
362
363 std::cout <<"RooUnitTest: Writing reference RooFitResult " << iter2->first << " as benchmark " << iter2->second << std::endl ;
364 _refFile->cd() ;
365 iter2->first->Write(iter2->second.c_str()) ;
366 gMemDir->cd() ;
367 }
368
369 ++iter2 ;
370 }
371
372 auto iter3 = _regValues.begin() ;
373 while (iter3!=_regValues.end()) {
374
375 if (!_write) {
376
377 // Comparison mode
378
379 // Retrieve benchmark
380 RooDouble* ref = dynamic_cast<RooDouble*>(_refFile->Get(iter3->second.c_str())) ;
381 if (!ref) {
382 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooDouble " << iter3->second << " from reference file, skipping " << std::endl;
383 ++iter3 ;
384 ret = false ;
385 continue ;
386 }
387
388 if (_verb > 0) {
389 std::cout << "comparing value " << iter3->first << " to benchmark " << iter3->second << " = " << (double)(*ref) << std::endl ;
390 }
391
392 if (std::abs(iter3->first - (double)(*ref))>vtol() ) {
393 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of value " << iter3->first << " fails comparison with reference " << ref->GetName() << std::endl ;
394 ret = false ;
395 }
396
397
398 } else {
399
400 // Writing mode
401
402 std::cout <<"RooUnitTest: Writing reference double " << iter3->first << " as benchmark " << iter3->second << std::endl ;
403 _refFile->cd() ;
404 RooDouble* rd = new RooDouble(iter3->first) ;
405 rd->Write(iter3->second.c_str()) ;
406 gMemDir->cd() ;
407 }
408
409 ++iter3 ;
410 }
411
412
413 auto iter4 = _regTables.begin() ;
414 while (iter4!=_regTables.end()) {
415
416 if (!_write) {
417
418 // Comparison mode
419
420 // Retrieve benchmark
421 RooTable* bmark = dynamic_cast<RooTable*>(_refFile->Get(iter4->second.c_str())) ;
422 if (!bmark) {
423 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooTable " << iter4->second << " from reference file, skipping " << std::endl ;
424 ++iter4 ;
425 ret = false ;
426 continue ;
427 }
428
429 if (_verb > 0) {
430 std::cout << "comparing RooTable " << iter4->first << " to benchmark " << iter4->second << " = " << bmark << std::endl ;
431 }
432
433 if (!iter4->first->isIdentical(*bmark, _verb >= 0)) {
434 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << iter4->first->ClassName() << "::" << iter4->first->GetName()
435 << " fails comparison with counterpart in reference RooTable " << bmark->GetName() << std::endl ;
436 if (_verb > 0) {
437 iter4->first->Print("V");
438 bmark->Print("V");
439 }
440 ret = false;
441 }
442
443 // Delete RooTable when comparison is finished to avoid noise in leak checking
444 delete iter4->first ;
445
446
447 } else {
448
449 // Writing mode
450
451 std::cout <<"RooUnitTest: Writing reference RooTable " << iter4->first << " as benchmark " << iter4->second << std::endl ;
452 _refFile->cd() ;
453 iter4->first->Write(iter4->second.c_str()) ;
454 gMemDir->cd() ;
455 }
456
457 ++iter4 ;
458 }
459
460
461 auto iter5 = _regWS.begin() ;
462 while (iter5!=_regWS.end()) {
463
464 if (_write) {
465
466 // Writing mode
467
468 std::cout <<"RooUnitTest: Writing reference RooWorkspace " << iter5->first << " as benchmark " << iter5->second << std::endl ;
469 _refFile->cd() ;
470 iter5->first->Write(iter5->second.c_str()) ;
471 gMemDir->cd() ;
472 }
473
474 ++iter5 ;
475 }
476
477 /////////////////
478 auto iter6 = _regTH.begin() ;
479 while (iter6!=_regTH.end()) {
480
481 if (!_write) {
482
483 // Comparison mode
484
485 // Retrieve benchmark
486 TH1* bmark = dynamic_cast<TH1*>(_refFile->Get(iter6->second.c_str())) ;
487 if (!bmark) {
488 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve TH1 " << iter6->second << " from reference file, skipping " << std::endl ;
489 ++iter6 ;
490 ret = false ;
491 continue ;
492 }
493
494 if (_verb > 0) {
495 std::cout << "comparing TH1 " << iter6->first << " to benchmark " << iter6->second << " = " << bmark << std::endl ;
496 }
497
498 if (!areTHidentical(iter6->first,bmark)) {
499 // coverity[NULL_RETURNS]
500 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << iter6->first->ClassName() << "::" << iter6->first->GetName()
501 << " fails comparison with counterpart in reference TH1 " << bmark->GetName() << std::endl ;
502
503
504 if (_debug) {
505 std::cout << "RooUnitTest INFO: writing THx " << iter6->first->GetName() << " and " << bmark->GetName()
506 << " of failed test to RooUnitTest_DEBUG.root" << std::endl ;
507 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
508 iter6->first->SetName(Form("%s_test",iter6->first->GetName())) ;
509 iter6->first->Write() ;
510 bmark->SetName(Form("%s_ref",bmark->GetName())) ;
511 bmark->Write() ;
512 fdbg.Close() ;
513 }
514
515 ret = false ;
516 }
517
518 // Delete TH1 when comparison is finished to avoid noise in leak checking
519 delete iter6->first ;
520
521
522 } else {
523
524 // Writing mode
525
526 std::cout <<"RooUnitTest: Writing reference TH1 " << iter6->first << " as benchmark " << iter6->second << std::endl ;
527 _refFile->cd() ;
528 iter6->first->Write(iter6->second.c_str()) ;
529 gMemDir->cd() ;
530 }
531
532 ++iter6 ;
533 }
534
535
536 /////////////////
537
538 return ret ;
539}
540
541
542////////////////////////////////////////////////////////////////////////////////
543
544void RooUnitTest::setSilentMode()
545{
547 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
550 }
551 }
552}
553
554
555////////////////////////////////////////////////////////////////////////////////
556
557void RooUnitTest::clearSilentMode()
558{
560 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
562 }
563}
564
565
566
567////////////////////////////////////////////////////////////////////////////////
568
569bool RooUnitTest::runTest()
570{
571 gMemDir->cd() ;
572
573 if (_verb<2) {
574 setSilentMode() ;
575 } else {
576 std::cout << "*** Begin of output of Unit Test at normal verbosity *************" << std::endl ;
577 }
578
580
581 // Reset random generator seed to make results independent of test ordering
582 gRandom->SetSeed(12345) ;
584
586 if (!testCode()) return false ;
588
589 if (_verb<2) {
590 clearSilentMode() ;
591 } else {
592 std::cout << "*** End of output of Unit Test at normal verbosity ***************" << std::endl ;
593 }
594
595 if (RooMsgService::instance().errorCount()>0) {
596 if(_verb >= 0) std::cout << "RooUnitTest: ERROR messages were logged, failing test" << std::endl ;
597 return false ;
598 }
599
600 return runCompTests() ;
601}
602
603
604////////////////////////////////////////////////////////////////////////////////
605/// Set gMemDir to memDir
606
607void RooUnitTest::setMemDir(TDirectory* memDir) {
608 gMemDir = memDir ;
609}
610
611/// \endcond
#define d(i)
Definition RSha256.hxx:102
int Int_t
Definition RtypesCore.h:45
@ kRed
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
@ kDashed
Definition TAttLine.h:48
@ kSolid
Definition TAttLine.h:48
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
char name[80]
Definition TGX11.cxx:110
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2489
One-dimensional graphical representation of a real-valued function.
Definition RooCurve.h:36
static TClass * Class()
bool isIdentical(const RooCurve &other, double tol=1e-6, bool verbose=true) const
Return true if curve is identical to other curve allowing for given absolute tolerance on each point ...
Definition RooCurve.cxx:879
Minimal implementation of a TObject holding a double value.
Definition RooDouble.h:22
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Graphical representation of binned data based on the TGraphAsymmErrors class.
Definition RooHist.h:29
static TClass * Class()
bool isIdentical(const RooHist &other, double tol=1e-6, bool verbose=true) const
Return true if contents of this RooHist is identical within given relative tolerance to that of 'othe...
Definition RooHist.cxx:632
static RooMsgService & instance()
Return reference to singleton instance.
void clearErrorCount()
StreamConfig & getStream(Int_t id)
Int_t numStreams() const
void setStreamStatus(Int_t id, bool active)
(De)Activate stream with given unique ID
void setSilentMode(bool flag)
Plot frame and a container for graphics objects within that frame.
Definition RooPlot.h:43
void SetName(const char *name) override
Set the name of the RooPlot to 'name'.
Definition RooPlot.cxx:1233
TObject * findObject(const char *name, const TClass *tClass=nullptr) const
Find the named object in our list of items and return a pointer to it.
Definition RooPlot.cxx:954
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Definition RooPlot.h:134
TAttLine * getAttLine(const char *name=nullptr) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
Definition RooPlot.cxx:819
TAttMarker * getAttMarker(const char *name=nullptr) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
Definition RooPlot.cxx:839
RooPlot * emptyClone(const char *name)
Return empty clone of current RooPlot.
Definition RooPlot.cxx:283
void createInternalPlotVarClone()
Replaces the pointer to the plot variable with a pointer to a clone of the plot variable that is owne...
Definition RooPlot.cxx:1449
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition RooPlot.cxx:528
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Definition RooRandom.cxx:48
Abstract interface for table objects.
Definition RooTable.h:32
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
Definition RooTrace.cxx:353
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition RooTrace.cxx:365
Persistable container for RooFit projects.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:42
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:38
Describe directory structure in memory.
Definition TDirectory.h:45
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
virtual Int_t GetNbinsY() const
Definition TH1.h:298
virtual Int_t GetNbinsZ() const
Definition TH1.h:299
virtual Int_t GetDimension() const
Definition TH1.h:283
virtual Int_t GetNbinsX() const
Definition TH1.h:297
void SetName(const char *name) override
Change the name of this histogram.
Definition TH1.cxx:8951
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5052
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test.
Definition TH1.cxx:8169
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
Definition TNamed.cxx:74
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
void Print(Option_t *option="") const override
Print TNamed name and title.
Definition TNamed.cxx:128
Mother of all ROOT objects.
Definition TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:438
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:207
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:880
virtual TClass * IsA() const
Definition TObject.h:243
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition TRandom.cxx:615