Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TTreePerfStats.cxx
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Rene Brun 29/10/09
3
4/*************************************************************************
5 * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TTreePerfStats
13
14TTree I/O performance measurement. see example of use below.
15
16The function FileReadEvent is called from TFile::ReadBuffer.
17For each call the following information is stored in fGraphIO
18 - x[i] = Tree entry number
19 - y[i] = 1e-6*(file position)
20 - ey[i] = 1e-9*number of bytes read
21For each call the following information is stored in fGraphTime
22 - x[i] = Tree entry number
23 - y[i] = Time now
24 - ey[i] = readtime, eg timenow - start
25The TTreePerfStats object can be saved in a ROOT file in such a way that
26its inspection can be done outside the job that generated it.
27
28Example of use:
29~~~{.cpp}
30{
31 TFile *f = TFile::Open("RelValMinBias-GEN-SIM-RECO.root");
32 T = (TTree*)f->Get("Events");
33 Long64_t nentries = T->GetEntries();
34 T->SetCacheSize(10000000);
35 T->SetCacheEntryRange(0,nentries);
36 T->AddBranchToCache("*");
37//
38 TTreePerfStats *ps= new TTreePerfStats("ioperf",T);
39//
40 for (Int_t i=0;i<nentries;i++) {
41 T->GetEntry(i);
42 }
43 ps->SaveAs("cmsperf.root");
44}
45~~~
46then, in a root interactive session, one can do:
47~~~{.cpp}
48 root > TFile f("cmsperf.root");
49 root > ioperf->Draw();
50 root > ioperf->Print();
51~~~
52The Draw or Print functions print the following information:
53 - TreeCache = TTree cache size in MBytes
54 - N leaves = Number of leaves in the TTree
55 - ReadTotal = Total number of zipped bytes read
56 - ReadUnZip = Total number of unzipped bytes read
57 - ReadCalls = Total number of disk reads
58 - ReadSize = Average read size in KBytes
59 - Readahead = Readahead size in KBytes
60 - Readextra = Readahead overhead in percent
61 - Real Time = Real Time in seconds
62 - CPU Time = CPU Time in seconds
63 - Disk Time = Real Time spent in pure raw disk IO
64 - Disk IO = Raw disk IO speed in MBytes/second
65 - ReadUZRT = Unzipped MBytes per RT second
66 - ReadUZCP = Unipped MBytes per CP second
67 - ReadRT = Zipped MBytes per RT second
68 - ReadCP = Zipped MBytes per CP second
69
70 ### NOTE 1 :
71The ReadTotal value indicates the effective number of zipped bytes
72returned to the application. The physical number of bytes read
73from the device (as measured for example with strace) is
74ReadTotal +ReadTotal*Readextra/100. Same for ReadSize.
75
76 ### NOTE 2 :
77A consequence of NOTE1, the Disk I/O speed corresponds to the effective
78number of bytes returned to the application per second.
79The Physical disk speed is DiskIO + DiskIO*ReadExtra/100.
80*/
81
82#include "TTreePerfStats.h"
83#include "TROOT.h"
84#include "TSystem.h"
85#include "TFile.h"
86#include "TTree.h"
87#include "TTreeCache.h"
88#include "TAxis.h"
89#include "TBranch.h"
90#include "TBrowser.h"
91#include "TVirtualPad.h"
92#include "TPaveText.h"
93#include "TGraphErrors.h"
94#include "TStopwatch.h"
95#include "TGaxis.h"
96#include "TTimeStamp.h"
97#include "TDatime.h"
98#include "TMath.h"
99
100#include <iostream>
101
102
103////////////////////////////////////////////////////////////////////////////////
104/// default constructor (used when reading an object only)
105
107{
108 fName = "";
109 fHostInfo = "";
110 fTree = nullptr;
111 fNleaves = 0;
112 fFile = nullptr;
113 fGraphIO = nullptr;
114 fGraphTime = nullptr;
115 fWatch = nullptr;
116 fPave = nullptr;
117 fTreeCacheSize = 0;
118 fReadCalls = 0;
119 fReadaheadSize = 0;
120 fBytesRead = 0;
122 fRealNorm = 0;
123 fRealTime = 0;
124 fCpuTime = 0;
125 fDiskTime = 0;
126 fUnzipTime = 0;
128 fUnzipObjSize = 0;
129 fCompress = 0;
130 fRealTimeAxis = nullptr;
131 fHostInfoText = nullptr;
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Create a TTree I/O perf stats object.
136
138{
140 Warning("TTreePerfStats","Results obtained with ImplicitMT enabled are not reliable.");
141 }
142
143 fName = name;
144 fTree = T;
145 T->SetPerfStats(this);
146 fNleaves= T->GetListOfLeaves()->GetEntries();
147 fFile = T->GetCurrentFile();
148 fGraphIO = new TGraphErrors(0);
149 fGraphIO->SetName("ioperf");
150 fGraphIO->SetTitle(Form("%s/%s",fFile->GetName(),T->GetName()));
151 fGraphIO->SetUniqueID(999999999);
152 fGraphTime = new TGraphErrors(0);
154 fGraphTime->SetName("iotime");
155 fGraphTime->SetTitle("Real time vs entries");
156 fWatch = new TStopwatch();
157 fWatch->Start();
158 fPave = nullptr;
159 fTreeCacheSize = 0;
160 fReadCalls = 0;
161 fReadaheadSize = 0;
162 fBytesRead = 0;
164 fRealNorm = 0;
165 fRealTime = 0;
166 fCpuTime = 0;
167 fDiskTime = 0;
168 fUnzipTime = 0;
170 fUnzipObjSize = 0;
171 fRealTimeAxis = nullptr;
172 fCompress = (T->GetTotBytes()+0.00001)/T->GetZipBytes();
173
174 bool isUNIX = strcmp(gSystem->GetName(), "Unix") == 0;
175 if (isUNIX)
176 fHostInfo = gSystem->GetFromPipe("uname -a");
177 else
178 fHostInfo = "Windows ";
179 fHostInfo.Resize(20);
180 fHostInfo += TString::Format("ROOT %s, Git: %s", gROOT->GetVersion(), gROOT->GetGitCommit());
181 TDatime dt;
182 fHostInfo += TString::Format(" %s",dt.AsString());
183 fHostInfoText = nullptr;
184
185 gPerfStats = this;
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Destructor
190
192{
193 fTree = nullptr;
194 fFile = nullptr;
195 delete fGraphIO;
196 delete fGraphTime;
197 delete fPave;
198 delete fWatch;
199 delete fRealTimeAxis;
200 delete fHostInfoText;
201
202 if (gPerfStats == this) {
203 gPerfStats = nullptr;
204 }
205}
206
207
208////////////////////////////////////////////////////////////////////////////////
209/// Browse
210
212{
213 Draw();
214 gPad->Update();
215}
216
217////////////////////////////////////////////////////////////////////////////////
218/// Return distance to one of the objects in the TTreePerfStats
219
221{
222 const Int_t kMaxDiff = 7;
223 Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
224 Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
225 Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
226 Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
227 if (py < puymax) return 9999;
228 //on the fGraphIO ?
230 if (distance <kMaxDiff) {if (px > puxmin && py < puymin) gPad->SetSelected(fGraphIO); return distance;}
231 // on the fGraphTime ?
233 if (distance <kMaxDiff) {if (px > puxmin && py < puymin) gPad->SetSelected(fGraphTime); return distance;}
234 // on the pave ?
236 if (distance <kMaxDiff) {gPad->SetSelected(fPave); return distance;}
237 // on the real time axis ?
239 if (distance <kMaxDiff) {gPad->SetSelected(fRealTimeAxis); return distance;}
240 // on the host info label ?
242 if (distance <kMaxDiff) {gPad->SetSelected(fHostInfoText); return distance;}
243 if (px > puxmax-300) return 2;
244 return 999;
245}
246
247////////////////////////////////////////////////////////////////////////////////
248/// Draw the TTree I/O perf graph.
249/// by default the graph is drawn with option "al"
250/// Specify option ="ap" to show only the read blocks and not the line
251/// connecting the blocks
252
254{
255 Finish();
256
257 TString opt = option;
258 if (strlen(option)==0) opt = "al";
259 opt.ToLower();
260 if (gPad) {
261 if (!gPad->IsEditable()) gROOT->MakeDefCanvas();
262 //the following statement is necessary in case one attempts to draw
263 //a temporary histogram already in the current pad
264 if (TestBit(kCanDelete)) gPad->Remove(this);
265 } else {
266 gROOT->MakeDefCanvas();
267 }
268 if (opt.Contains("a")) {
269 gPad->SetLeftMargin(0.35);
270 gPad->Clear();
271 gPad->SetGridx();
272 gPad->SetGridy();
273 }
274 AppendPad(opt.Data());
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// Return distance to one of the objects in the TTreePerfStats
279
280void TTreePerfStats::ExecuteEvent(Int_t /*event*/, Int_t /*px*/, Int_t /*py*/)
281{
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Record TTree file read event.
286/// - start is the TimeStamp before reading
287/// - len is the number of bytes read
288
290{
291 if (file == this->fFile) {
292 Long64_t offset = file->GetRelOffset();
293 Int_t np = fGraphIO->GetN();
296 fGraphIO->SetPointError(np,0.001,1e-9*len);
298 Double_t dtime = tnow-start;
299 fDiskTime += dtime;
302 fReadCalls++;
303 fBytesRead += len;
304 }
305}
306
307
308////////////////////////////////////////////////////////////////////////////////
309/// Record TTree unzip event.
310/// - start is the TimeStamp before unzip
311/// - pos is where in the file the compressed buffer came from
312/// - complen is the length of the compressed buffer
313/// - objlen is the length of the de-compressed buffer
314
316{
317 if (tree == this->fTree || tree == this->fTree->GetTree()){
319 Double_t dtime = tnow-start;
320 fUnzipTime += dtime;
323 }
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// When the run is finished this function must be called
328/// to save the current parameters in the file and Tree in this object
329/// the function is automatically called by Draw and Print
330
332{
333 if (fRealNorm) return; //has already been called
334 if (!fFile) return;
335 if (!fTree) return;
336
339 if (fTree->IsA()->InheritsFrom("TChain"))
340 fBytesReadExtra = fTree->GetDirectory()->GetFile()->GetBytesReadExtra();
341 else if (fFile)
345 if (fUnzipInputSize)
348 if (!npoints) return;
352 // we normalize the fGraphTime such that it can be drawn on top of fGraphIO
353 for (Int_t i=1;i<npoints;i++) {
354 fGraphTime->GetY()[i] = fGraphTime->GetY()[i-1] +fRealNorm*fGraphTime->GetEY()[i];
355 fGraphTime->GetEY()[i] = 0;
356 }
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Update the fBranchIndexCache collection to match the current TTree given
361/// the ordered list of branch names.
362
364{
365 fBranchIndexCache.clear();
366
367 for (int i = 0; i < branches->GetEntries(); ++i) {
368 fBranchIndexCache.emplace((TBranch*)(branches->UncheckedAt(i)), i);
369 }
370}
371
372////////////////////////////////////////////////////////////////////////////////
373/// Return the BasketInfo corresponding to the given branch and basket.
374
376{
377 static BasketInfo fallback;
378
379 // First find the branch index.
380 TFile *file = fTree->GetCurrentFile();
381 if (!file)
382 return fallback;
383
384 TTreeCache *cache = dynamic_cast<TTreeCache *>(file->GetCacheRead(fTree));
385 if (!cache)
386 return fallback;
387
388 Int_t index = -1;
389 auto iter = fBranchIndexCache.find(br);
390 if (iter == fBranchIndexCache.end()) {
391 auto branches = cache->GetCachedBranches();
392 for (Int_t i = 0; i < branches->GetEntries(); ++i) {
393 if (br == branches->UncheckedAt(i)) {
394 index = i;
395 break;
396 }
397 }
398 if (index < 0)
399 return fallback;
400 fBranchIndexCache.emplace(br, index);
401 } else {
402 index = iter->second;
403 }
404
406}
407
408////////////////////////////////////////////////////////////////////////////////
409/// Return the BasketInfo corresponding to the given branch and basket.
410
412{
413 if (fBasketsInfo.size() <= (size_t)index)
414 fBasketsInfo.resize(index + 1);
415
416 auto &brvec(fBasketsInfo[index]);
417 if (brvec.size() <= basketNumber)
418 brvec.resize(basketNumber + 1);
419
420 return brvec[basketNumber];
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Return the collection of baskets which have been read by the TTreeCache more
425/// than once
426
428{
430
431 TFile *file = fTree->GetCurrentFile();
432 if (!file)
433 return result;
434
435 TTreeCache *cache = dynamic_cast<TTreeCache *>(file->GetCacheRead(fTree));
436 if (!cache)
437 return result;
438
439 auto branches = cache->GetCachedBranches();
440 for (size_t i = 0; i < fBasketsInfo.size(); ++i) {
441 bool first = true;
442 for (size_t j = 0; j < fBasketsInfo[i].size(); ++j) {
443 auto &info(fBasketsInfo[i][j]);
444 if ((info.fLoaded + info.fLoadedMiss) > 1) {
445 if (first) {
446 result.emplace_back(BasketList_t::value_type((TBranch*)branches->At(i), std::vector<size_t>(1)));
447 first = false;
448 }
449 auto &ref( result.back() );
450 ref.second.push_back(j);
451 }
452 }
453 }
454
455 return result;
456}
457
458////////////////////////////////////////////////////////////////////////////////
459/// Draw the TTree I/O perf graph.
460
462{
464 if (!npoints) return;
467 if (iomax >= 1e9) toffset = 1.2;
468 fGraphIO->GetXaxis()->SetTitle("Tree entry number");
469 fGraphIO->GetYaxis()->SetTitle("file position (MBytes) ");
474
476 opts.ToLower();
477 bool unzip = opts.Contains("unzip");
478
479 //superimpose the time info (max 10 points)
480 if (fGraphTime) {
481 fGraphTime->Paint("l");
482 TText tdisk(fGraphTime->GetX()[npoints-1],1.1*fGraphTime->GetY()[npoints-1],"RAW IO");
483 tdisk.SetTextAlign(31);
484 tdisk.SetTextSize(0.03);
485 tdisk.SetTextColor(kRed);
486 tdisk.Paint();
487 if (!fRealTimeAxis) {
488 Double_t uxmax = gPad->GetUxmax();
489 Double_t uymax = gPad->GetUymax();
491 fRealTimeAxis = new TGaxis(uxmax,0,uxmax,uymax,0.,rtmax,510,"+L");
492 fRealTimeAxis->SetName("RealTimeAxis");
494 fRealTimeAxis->SetTitle("RealTime (s) ");
496 toffset = 1;
497 if (fRealTime >= 100) toffset = 1.2;
498 if (fRealTime >= 1000) toffset = 1.4;
502 }
504 }
505
507 if (!fPave) {
508 fPave = new TPaveText(.01,.10,.24,.90,"brNDC");
509 fPave->SetTextAlign(12);
510 fPave->AddText(Form("TreeCache = %d MB",fTreeCacheSize/1000000));
511 fPave->AddText(Form("N leaves = %d",fNleaves));
512 fPave->AddText(Form("ReadTotal = %g MB",1e-6*fBytesRead));
513 fPave->AddText(Form("ReadUnZip = %g MB",1e-6*fBytesRead*fCompress));
514 fPave->AddText(Form("ReadCalls = %d",fReadCalls));
515 fPave->AddText(Form("ReadSize = %7.3f KB",0.001*fBytesRead/fReadCalls));
516 fPave->AddText(Form("Readahead = %d KB",fReadaheadSize/1000));
517 fPave->AddText(Form("Readextra = %5.2f per cent",extra));
518 fPave->AddText(Form("Real Time = %7.3f s",fRealTime));
519 fPave->AddText(Form("CPU Time = %7.3f s",fCpuTime));
520 fPave->AddText(Form("Disk Time = %7.3f s",fDiskTime));
521 if (unzip) {
522 fPave->AddText(Form("UnzipTime = %7.3f s",fUnzipTime));
523 }
524 fPave->AddText(Form("Disk IO = %7.3f MB/s",1e-6*fBytesRead/fDiskTime));
525 fPave->AddText(Form("ReadUZRT = %7.3f MB/s",1e-6*fCompress*fBytesRead/fRealTime));
526 fPave->AddText(Form("ReadUZCP = %7.3f MB/s",1e-6*fCompress*fBytesRead/fCpuTime));
527 fPave->AddText(Form("ReadRT = %7.3f MB/s",1e-6*fBytesRead/fRealTime));
528 fPave->AddText(Form("ReadCP = %7.3f MB/s",1e-6*fBytesRead/fCpuTime));
529 }
530 fPave->Paint();
531
532 if (!fHostInfoText) {
533 fHostInfoText = new TText(0.01,0.01,fHostInfo.Data());
536 }
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Print the TTree I/O perf stats.
542
544{
546 opts.ToLower();
547 bool unzip = opts.Contains("unzip");
548 bool basket = opts.Contains("basket");
549 TTreePerfStats *ps = (TTreePerfStats*)this;
550 ps->Finish();
551
553 printf("TreeCache = %d MBytes\n",Int_t(fTreeCacheSize/1000000));
554 printf("N leaves = %d\n",fNleaves);
555 printf("ReadTotal = %g MBytes\n",1e-6*fBytesRead);
556 printf("ReadUnZip = %g MBytes\n",1e-6*fBytesRead*fCompress);
557 printf("ReadCalls = %d\n",fReadCalls);
558 printf("ReadSize = %7.3f KBytes/read\n",0.001*fBytesRead/fReadCalls);
559 printf("Readahead = %d KBytes\n",fReadaheadSize/1000);
560 printf("Readextra = %5.2f per cent\n",extra);
561 printf("Real Time = %7.3f seconds\n",fRealTime);
562 printf("CPU Time = %7.3f seconds\n",fCpuTime);
563 printf("Disk Time = %7.3f seconds\n",fDiskTime);
564 if (unzip) {
565 printf("Strm Time = %7.3f seconds\n",fCpuTime-fUnzipTime);
566 printf("UnzipTime = %7.3f seconds\n",fUnzipTime);
567 }
568 printf("Disk IO = %7.3f MBytes/s\n",1e-6*fBytesRead/fDiskTime);
569 printf("ReadUZRT = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fRealTime);
570 printf("ReadUZCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fCpuTime);
571 printf("ReadRT = %7.3f MBytes/s\n",1e-6*fBytesRead/fRealTime);
572 printf("ReadCP = %7.3f MBytes/s\n",1e-6*fBytesRead/fCpuTime);
573 if (unzip) {
574 printf("ReadStrCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/(fCpuTime-fUnzipTime));
575 printf("ReadZipCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fUnzipTime);
576 }
577 if (basket)
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Print the TTree basket information
583
585{
586
588 opts.ToLower();
589 bool all = opts.Contains("allbasketinfo");
590
591 TFile *file = fTree->GetCurrentFile();
592 if (!file)
593 return;
594
595 TTreeCache *cache = dynamic_cast<TTreeCache *>(file->GetCacheRead(fTree));
596 if (!cache)
597 return;
598
599 auto branches = cache->GetCachedBranches();
600 for (size_t i = 0; i < fBasketsInfo.size(); ++i) {
601 const char *branchname = branches->At(i)->GetName();
602
603 printf(" br=%zu %s read not cached: ", i, branchname);
604 if (fBasketsInfo[i].empty()) {
605 printf("none");
606 } else
607 for (size_t j = 0; j < fBasketsInfo[i].size(); ++j) {
608 if (fBasketsInfo[i][j].fMissed)
609 printf("%zu ", j);
610 }
611 printf("\n");
612
613 printf(" br=%zu %s cached more than once: ", i, branchname);
614 for (size_t j = 0; j < fBasketsInfo[i].size(); ++j) {
615 auto &info(fBasketsInfo[i][j]);
616 if ((info.fLoaded + info.fLoadedMiss) > 1)
617 printf("%zu[%d,%d] ", j, info.fLoaded, info.fLoadedMiss);
618 }
619 printf("\n");
620
621 printf(" br=%zu %s cached but not used: ", i, branchname);
622 for (size_t j = 0; j < fBasketsInfo[i].size(); ++j) {
623 auto &info(fBasketsInfo[i][j]);
624 if ((info.fLoaded + info.fLoadedMiss) && !info.fUsed) {
625 if (info.fLoadedMiss)
626 printf("%zu[%d,%d] ", j, info.fLoaded, info.fLoadedMiss);
627 else
628 printf("%zu ", j);
629 }
630 }
631 printf("\n");
632
633 if (all) {
634 printf(" br=%zu %s: ", i, branchname);
635 for (size_t j = 0; j < fBasketsInfo[i].size(); ++j) {
636 auto &info(fBasketsInfo[i][j]);
637 printf("%zu[%d,%d,%d,%d] ", j, info.fUsed, info.fLoaded, info.fLoadedMiss, info.fMissed);
638 }
639 printf("\n");
640 }
641 }
642 for (Int_t i = fBasketsInfo.size(); i < branches->GetEntries(); ++i) {
643 printf(" br=%d %s: no basket information\n", i, branches->At(i)->GetName());
644 }
645}
646
647////////////////////////////////////////////////////////////////////////////////
648/// Save this object to filename
649
650void TTreePerfStats::SaveAs(const char *filename, Option_t * /*option*/) const
651{
652 TTreePerfStats *ps = (TTreePerfStats*)this;
653 ps->Finish();
654 ps->TObject::SaveAs(filename);
655}
656
657////////////////////////////////////////////////////////////////////////////////
658/// Save primitive as a C++ statement(s) on output stream out
659
661{
662 SavePrimitiveConstructor(out, Class(), "perfstats");
663 out << " perfstats->SetName(\"" << TString(GetName()).ReplaceSpecialCppChars() << "\");\n";
664 out << " perfstats->SetHostInfo(\"" << TString(GetHostInfo()).ReplaceSpecialCppChars() << "\");\n";
665 out << " perfstats->SetTreeCacheSize(" << fTreeCacheSize << ");\n";
666 out << " perfstats->SetNleaves(" << fNleaves << ");\n";
667 out << " perfstats->SetReadCalls(" << fReadCalls << ");\n";
668 out << " perfstats->SetReadaheadSize(" << fReadaheadSize << ");\n";
669 out << " perfstats->SetBytesRead(" << fBytesRead << ");\n";
670 out << " perfstats->SetBytesReadExtra(" << fBytesReadExtra << ");\n";
671 out << " perfstats->SetRealNorm(" << fRealNorm << ");\n";
672 out << " perfstats->SetRealTime(" << fRealTime << ");\n";
673 out << " perfstats->SetCpuTime(" << fCpuTime << ");\n";
674 out << " perfstats->SetDiskTime(" << fDiskTime << ");\n";
675 out << " perfstats->SetUnzipTime(" << fUnzipTime << ");\n";
676 out << " perfstats->SetCompress(" << fCompress << ");\n";
677
678 fGraphIO->SavePrimitive(out, "nodraw");
679 out << " perfstats->SetGraphIO(gre);\n";
680
681 fGraphTime->SavePrimitive(out, "nodraw");
682 out << " perfstats->SetGraphTime(gre);\n";
683
684 SavePrimitiveDraw(out, "perfstats", option);
685}
#define e(i)
Definition RSha256.hxx:103
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
@ kRed
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
char name[80]
Definition TGX11.cxx:110
#define gROOT
Definition TROOT.h:414
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TSystem * gSystem
Definition TSystem.h:582
#define gPad
#define gPerfStats
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
Definition TAttAxis.cxx:279
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:184
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:42
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:44
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:49
A TTree is a list of TBranches.
Definition TBranch.h:93
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4901
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition TDatime.h:37
virtual TFile * GetFile() const
Definition TDirectory.h:221
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:130
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
Definition TFile.cxx:4283
Long64_t GetRelOffset() const
Definition TFile.h:339
virtual Long64_t GetBytesReadExtra() const
Definition TFile.h:330
TFileCacheRead * GetCacheRead(const TObject *tree=nullptr) const
Return a pointer to the current read cache.
Definition TFile.cxx:1251
The axis painter class.
Definition TGaxis.h:26
void SetTitleOffset(Float_t titleoffset=1)
Definition TGaxis.h:130
virtual void SetTitle(const char *title="")
Change the title of the axis.
Definition TGaxis.cxx:2918
void SetLabelColor(Int_t labelcolor)
Definition TGaxis.h:106
void SetTitleColor(Int_t titlecolor)
Definition TGaxis.h:133
void Paint(Option_t *chopt="") override
Draw this axis with its current attributes.
Definition TGaxis.cxx:985
void SetLabelSize(Float_t labelsize)
Definition TGaxis.h:109
virtual void SetName(const char *name)
Change the name of the axis.
Definition TGaxis.cxx:2880
A TGraphErrors is a TGraph with error bars.
virtual void SetPointError(Double_t ex, Double_t ey)
Set ex and ey values for point pointed by the mouse.
Double_t * GetEY() const override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition TGraph.cxx:2387
Double_t * GetY() const
Definition TGraph.h:139
void Paint(Option_t *chopt="") override
Draw this graph with its current attributes.
Definition TGraph.cxx:2007
Int_t GetN() const
Definition TGraph.h:131
Double_t * GetX() const
Definition TGraph.h:138
void SetName(const char *name="") override
Set graph name.
Definition TGraph.cxx:2426
TAxis * GetXaxis() const
Get x axis of the graph.
Definition TGraph.cxx:1596
TAxis * GetYaxis() const
Get y axis of the graph.
Definition TGraph.cxx:1605
void SetTitle(const char *title="") override
Change (i.e.
Definition TGraph.cxx:2442
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a graph.
Definition TGraph.cxx:907
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
Definition TLine.cxx:88
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1075
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:893
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:840
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:772
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:70
A Pave (see TPave) with text, lines or/and boxes inside.
Definition TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Paint(Option_t *option="") override
Paint this pavetext with its current attributes.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a pave.
Definition TPave.cxx:207
Stopwatch class.
Definition TStopwatch.h:28
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
Basic string class.
Definition TString.h:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
Definition TString.cxx:1121
const char * Data() const
Definition TString.h:384
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Definition TString.cxx:1159
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:641
virtual TString GetFromPipe(const char *command, Int_t *ret=nullptr, Bool_t redirectStderr=kFALSE)
Execute command and return output in TString.
Definition TSystem.cxx:684
Base class for several text objects.
Definition TText.h:22
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a string.
Definition TText.cxx:143
void Paint(Option_t *option="") override
Paint this text with its current attributes.
Definition TText.cxx:686
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Definition TText.cxx:816
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition TTimeStamp.h:45
A cache to speed-up the reading of ROOT datasets.
Definition TTreeCache.h:32
const TObjArray * GetCachedBranches() const
Definition TTreeCache.h:139
TTree I/O performance measurement.
TGraphErrors * fGraphIO
Pointer to the graph with IO data.
Long64_t fUnzipInputSize
Compressed bytes seen by the decompressor.
TString fName
Name of this TTreePerfStats.
Int_t fNleaves
Number of leaves in the tree.
void Browse(TBrowser *b) override
Browse.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Return distance to one of the objects in the TTreePerfStats.
Double_t fRealNorm
Real time scale factor for fGraphTime.
BasketInfo & GetBasketInfo(TBranch *b, size_t basketNumber)
Return the BasketInfo corresponding to the given branch and basket.
std::vector< std::vector< BasketInfo > > fBasketsInfo
Long64_t fUnzipObjSize
Uncompressed bytes produced by the decompressor.
TStopwatch * fWatch
TStopwatch pointer.
TTree * fTree
! Pointer to the Tree being monitored
TString fHostInfo
Name of the host system, ROOT version and date.
void Print(Option_t *option="") const override
Print the TTree I/O perf stats.
Int_t fReadCalls
Number of read calls.
Long64_t fBytesRead
Number of bytes read.
void UpdateBranchIndices(TObjArray *branchNames) override
Update the fBranchIndexCache collection to match the current TTree given the ordered list of branch n...
BasketList_t GetDuplicateBasketCache() const
Return the collection of baskets which have been read by the TTreeCache more than once.
Double_t fCpuTime
Cpu time.
virtual void Finish()
When the run is finished this function must be called to save the current parameters in the file and ...
const char * GetName() const override
Returns name of object.
void Paint(Option_t *chopt="") override
Draw the TTree I/O perf graph.
std::vector< std::pair< TBranch *, std::vector< size_t > > > BasketList_t
void SaveAs(const char *filename="", Option_t *option="") const override
Save this object to filename.
void FileReadEvent(TFile *file, Int_t len, Double_t start) override
Record TTree file read event.
Double_t fCompress
Tree compression factor.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
static TClass * Class()
void PrintBasketInfo(Option_t *option="") const override
Print the TTree basket information.
void Draw(Option_t *option="") override
Draw the TTree I/O perf graph.
TFile * fFile
! Pointer to the file containing the Tree
const char * GetHostInfo() const
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Return distance to one of the objects in the TTreePerfStats.
Double_t fRealTime
Real time.
Int_t fReadaheadSize
Read-ahead cache size.
std::unordered_map< TBranch *, size_t > fBranchIndexCache
~TTreePerfStats() override
Destructor.
Double_t fDiskTime
Time spent in pure raw disk IO.
TGaxis * fRealTimeAxis
Pointer to TGaxis object showing real-time.
Double_t fUnzipTime
Time spent uncompressing the data.
TPaveText * fPave
Pointer to annotation pavetext.
Int_t fTreeCacheSize
TTreeCache buffer size.
TGraphErrors * fGraphTime
Pointer to the graph with timestamp info.
TText * fHostInfoText
Graphics Text object with the fHostInfo data.
Long64_t fBytesReadExtra
Number of bytes (overhead) of the read-ahead cache.
void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen) override
Record TTree unzip event.
TTreePerfStats()
default constructor (used when reading an object only)
A TTree represents a columnar dataset.
Definition TTree.h:89
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition TTree.cxx:5555
TDirectory * GetDirectory() const
Definition TTree.h:509
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
Definition TTree.cxx:9594
virtual Long64_t GetReadEntry() const
Definition TTree.h:596
virtual TTree * GetTree() const
Definition TTree.h:604
TClass * IsA() const override
Definition TTree.h:757
virtual Long64_t GetCacheSize() const
Definition TTree.h:500
Provides the interface for the an internal performance measurement and event tracing.
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Definition TROOT.cxx:600
T MaxElement(Long64_t n, const T *a)
Returns maximum of array a of length n.
Definition TMath.h:979
th1 Draw()