ROOT  6.06/09
Reference Guide
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 
14 TTree I/O performance measurement. see example of use below.
15 
16 The function FileReadEvent is called from TFile::ReadBuffer.
17 For 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
21 For 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
25 The TTreePerfStats object can be saved in a ROOT file in such a way that
26 its inspection can be done outside the job that generated it.
27 
28 Example 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 ~~~
46 then, 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 ~~~
52 The 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 :
71 The ReadTotal value indicates the effective number of zipped bytes
72 returned to the application. The physical number of bytes read
73 from the device (as measured for example with strace) is
74 ReadTotal +ReadTotal*Readextra/100. Same for ReadSize.
75 
76  ### NOTE 2 :
77 A consequence of NOTE1, the Disk I/O speed corresponds to the effective
78 number of bytes returned to the application per second.
79 The Physical disk speed is DiskIO + DiskIO*ReadExtra/100.
80 */
81 
82 #include "TTreePerfStats.h"
83 #include "TROOT.h"
84 #include "TSystem.h"
85 #include "Riostream.h"
86 #include "TFile.h"
87 #include "TTree.h"
88 #include "TAxis.h"
89 #include "TBrowser.h"
90 #include "TVirtualPad.h"
91 #include "TPaveText.h"
92 #include "TGraphErrors.h"
93 #include "TStopwatch.h"
94 #include "TGaxis.h"
95 #include "TTimeStamp.h"
96 #include "TDatime.h"
97 #include "TMath.h"
98 
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// default constructor (used when reading an object only)
103 
105 {
106  fName = "";
107  fHostInfo = "";
108  fTree = 0;
109  fNleaves = 0;
110  fFile = 0;
111  fGraphIO = 0;
112  fGraphTime = 0;
113  fWatch = 0;
114  fPave = 0;
115  fTreeCacheSize = 0;
116  fReadCalls = 0;
117  fReadaheadSize = 0;
118  fBytesRead = 0;
119  fBytesReadExtra= 0;
120  fRealNorm = 0;
121  fRealTime = 0;
122  fCpuTime = 0;
123  fDiskTime = 0;
124  fUnzipTime = 0;
125  fCompress = 0;
126  fRealTimeAxis = 0;
127  fHostInfoText = 0;
128 }
129 
130 ////////////////////////////////////////////////////////////////////////////////
131 /// Create a TTree I/O perf stats object.
132 
134 {
135  fName = name;
136  fTree = T;
137  T->SetPerfStats(this);
139  fFile = T->GetCurrentFile();
140  fGraphIO = new TGraphErrors(0);
141  fGraphIO->SetName("ioperf");
142  fGraphIO->SetTitle(Form("%s/%s",fFile->GetName(),T->GetName()));
143  fGraphIO->SetUniqueID(999999999);
144  fGraphTime = new TGraphErrors(0);
146  fGraphTime->SetName("iotime");
147  fGraphTime->SetTitle("Real time vs entries");
148  fWatch = new TStopwatch();
149  fWatch->Start();
150  fPave = 0;
151  fTreeCacheSize = 0;
152  fReadCalls = 0;
153  fReadaheadSize = 0;
154  fBytesRead = 0;
155  fBytesReadExtra= 0;
156  fRealNorm = 0;
157  fRealTime = 0;
158  fCpuTime = 0;
159  fDiskTime = 0;
160  fUnzipTime = 0;
161  fRealTimeAxis = 0;
162  fCompress = (T->GetTotBytes()+0.00001)/T->GetZipBytes();
163 
164  Bool_t isUNIX = strcmp(gSystem->GetName(), "Unix") == 0;
165  if (isUNIX)
166  fHostInfo = gSystem->GetFromPipe("uname -a");
167  else
168  fHostInfo = "Windows ";
169  fHostInfo.Resize(20);
170  fHostInfo += TString::Format("ROOT %s, Git: %s", gROOT->GetVersion(), gROOT->GetGitCommit());
171  TDatime dt;
172  fHostInfo += TString::Format(" %s",dt.AsString());
173  fHostInfoText = 0;
174 
175  gPerfStats = this;
176 }
177 
178 ////////////////////////////////////////////////////////////////////////////////
179 /// Destructor
180 
182 {
183  fTree = 0;
184  fFile = 0;
185  delete fGraphIO;
186  delete fGraphTime;
187  delete fPave;
188  delete fWatch;
189  delete fRealTimeAxis;
190  delete fHostInfoText;
191 
192  if (gPerfStats == this) {
193  gPerfStats = 0;
194  }
195 }
196 
197 
198 ////////////////////////////////////////////////////////////////////////////////
199 /// Browse
200 
202 {
203  Draw();
204  gPad->Update();
205 }
206 
207 ////////////////////////////////////////////////////////////////////////////////
208 /// Return distance to one of the objects in the TTreePerfStats
209 
211 {
212  const Int_t kMaxDiff = 7;
213  Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
214  Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
215  Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
216  Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
217  if (py < puymax) return 9999;
218  //on the fGraphIO ?
220  if (distance <kMaxDiff) {if (px > puxmin && py < puymin) gPad->SetSelected(fGraphIO); return distance;}
221  // on the fGraphTime ?
222  distance = fGraphTime->DistancetoPrimitive(px,py);
223  if (distance <kMaxDiff) {if (px > puxmin && py < puymin) gPad->SetSelected(fGraphTime); return distance;}
224  // on the pave ?
225  distance = fPave->DistancetoPrimitive(px,py);
226  if (distance <kMaxDiff) {gPad->SetSelected(fPave); return distance;}
227  // on the real time axis ?
228  distance = fRealTimeAxis->DistancetoPrimitive(px,py);
229  if (distance <kMaxDiff) {gPad->SetSelected(fRealTimeAxis); return distance;}
230  // on the host info label ?
231  distance = fHostInfoText->DistancetoPrimitive(px,py);
232  if (distance <kMaxDiff) {gPad->SetSelected(fHostInfoText); return distance;}
233  if (px > puxmax-300) return 2;
234  return 999;
235 }
236 
237 ////////////////////////////////////////////////////////////////////////////////
238 /// Draw the TTree I/O perf graph.
239 /// by default the graph is drawn with option "al"
240 /// Specify option ="ap" to show only the read blocks and not the line
241 /// connecting the blocks
242 
244 {
245  Finish();
246 
247  TString opt = option;
248  if (strlen(option)==0) opt = "al";
249  opt.ToLower();
250  if (gPad) {
251  if (!gPad->IsEditable()) gROOT->MakeDefCanvas();
252  //the following statement is necessary in case one attempts to draw
253  //a temporary histogram already in the current pad
254  if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);
255  } else {
256  gROOT->MakeDefCanvas();
257  }
258  if (opt.Contains("a")) {
259  gPad->SetLeftMargin(0.35);
260  gPad->Clear();
261  gPad->SetGridx();
262  gPad->SetGridy();
263  }
264  AppendPad(opt.Data());
265 }
266 
267 ////////////////////////////////////////////////////////////////////////////////
268 /// Return distance to one of the objects in the TTreePerfStats
269 
270 void TTreePerfStats::ExecuteEvent(Int_t /*event*/, Int_t /*px*/, Int_t /*py*/)
271 {
272 }
273 
274 ////////////////////////////////////////////////////////////////////////////////
275 /// Record TTree file read event.
276 /// - start is the TimeStamp before reading
277 /// - len is the number of bytes read
278 
280 {
281  if (file == this->fFile){
282  Long64_t offset = file->GetRelOffset();
283  Int_t np = fGraphIO->GetN();
285  fGraphIO->SetPoint(np,entry,1e-6*offset);
286  fGraphIO->SetPointError(np,0.001,1e-9*len);
287  Double_t tnow = TTimeStamp();
288  Double_t dtime = tnow-start;
289  fDiskTime += dtime;
290  fGraphTime->SetPoint(np,entry,tnow);
291  fGraphTime->SetPointError(np,0.001,dtime);
292  fReadCalls++;
293  fBytesRead += len;
294  }
295 }
296 
297 
298 ////////////////////////////////////////////////////////////////////////////////
299 /// Record TTree unzip event.
300 /// - start is the TimeStamp before unzip
301 /// - pos is where in the file the compressed buffer came from
302 /// - complen is the length of the compressed buffer
303 /// - objlen is the length of the de-compressed buffer
304 
305 void TTreePerfStats::UnzipEvent(TObject * tree, Long64_t /* pos */, Double_t start, Int_t /* complen */, Int_t /* objlen */)
306 {
307  if (tree == this->fTree){
308  Double_t tnow = TTimeStamp();
309  Double_t dtime = tnow-start;
310  fUnzipTime += dtime;
311  }
312 }
313 
314 ////////////////////////////////////////////////////////////////////////////////
315 /// When the run is finished this function must be called
316 /// to save the current parameters in the file and Tree in this object
317 /// the function is automatically called by Draw and Print
318 
320 {
321  if (fRealNorm) return; //has already been called
322  if (!fFile) return;
323  if (!fTree) return;
328  fCpuTime = fWatch->CpuTime();
329  Int_t npoints = fGraphIO->GetN();
330  if (!npoints) return;
331  Double_t iomax = TMath::MaxElement(npoints,fGraphIO->GetY());
332  fRealNorm = iomax/fRealTime;
333  fGraphTime->GetY()[0] = fRealNorm*fGraphTime->GetEY()[0];
334  // we normalize the fGraphTime such that it can be drawn on top of fGraphIO
335  for (Int_t i=1;i<npoints;i++) {
336  fGraphTime->GetY()[i] = fGraphTime->GetY()[i-1] +fRealNorm*fGraphTime->GetEY()[i];
337  fGraphTime->GetEY()[i] = 0;
338  }
339 }
340 
341 
342 ////////////////////////////////////////////////////////////////////////////////
343 /// Draw the TTree I/O perf graph.
344 
346 {
347  Int_t npoints = fGraphIO->GetN();
348  if (!npoints) return;
349  Double_t iomax = fGraphIO->GetY()[npoints-1];
350  Double_t toffset=1;
351  if (iomax >= 1e9) toffset = 1.2;
352  fGraphIO->GetXaxis()->SetTitle("Tree entry number");
353  fGraphIO->GetYaxis()->SetTitle("file position (MBytes) ");
354  fGraphIO->GetYaxis()->SetTitleOffset(toffset);
355  fGraphIO->GetXaxis()->SetLabelSize(0.03);
356  fGraphIO->GetYaxis()->SetLabelSize(0.03);
357  fGraphIO->Paint(option);
358 
359  TString opts(option);
360  opts.ToLower();
361  Bool_t unzip = opts.Contains("unzip");
362 
363  //superimpose the time info (max 10 points)
364  if (fGraphTime) {
365  fGraphTime->Paint("l");
366  TText tdisk(fGraphTime->GetX()[npoints-1],1.1*fGraphTime->GetY()[npoints-1],"RAW IO");
367  tdisk.SetTextAlign(31);
368  tdisk.SetTextSize(0.03);
369  tdisk.SetTextColor(kRed);
370  tdisk.Paint();
371  if (!fRealTimeAxis) {
372  Double_t uxmax = gPad->GetUxmax();
373  Double_t uymax = gPad->GetUymax();
374  Double_t rtmax = uymax/fRealNorm;
375  fRealTimeAxis = new TGaxis(uxmax,0,uxmax,uymax,0.,rtmax,510,"+L");
376  fRealTimeAxis->SetName("RealTimeAxis");
378  fRealTimeAxis->SetTitle("RealTime (s) ");
380  toffset = 1;
381  if (fRealTime >= 100) toffset = 1.2;
382  if (fRealTime >= 1000) toffset = 1.4;
383  fRealTimeAxis->SetTitleOffset(toffset);
386  }
387  fRealTimeAxis->Paint();
388  }
389 
390  Double_t extra = 100.*fBytesReadExtra/fBytesRead;
391  if (!fPave) {
392  fPave = new TPaveText(.01,.10,.24,.90,"brNDC");
393  fPave->SetTextAlign(12);
394  fPave->AddText(Form("TreeCache = %d MB",fTreeCacheSize/1000000));
395  fPave->AddText(Form("N leaves = %d",fNleaves));
396  fPave->AddText(Form("ReadTotal = %g MB",1e-6*fBytesRead));
397  fPave->AddText(Form("ReadUnZip = %g MB",1e-6*fBytesRead*fCompress));
398  fPave->AddText(Form("ReadCalls = %d",fReadCalls));
399  fPave->AddText(Form("ReadSize = %7.3f KB",0.001*fBytesRead/fReadCalls));
400  fPave->AddText(Form("Readahead = %d KB",fReadaheadSize/1000));
401  fPave->AddText(Form("Readextra = %5.2f per cent",extra));
402  fPave->AddText(Form("Real Time = %7.3f s",fRealTime));
403  fPave->AddText(Form("CPU Time = %7.3f s",fCpuTime));
404  fPave->AddText(Form("Disk Time = %7.3f s",fDiskTime));
405  if (unzip) {
406  fPave->AddText(Form("UnzipTime = %7.3f s",fUnzipTime));
407  }
408  fPave->AddText(Form("Disk IO = %7.3f MB/s",1e-6*fBytesRead/fDiskTime));
409  fPave->AddText(Form("ReadUZRT = %7.3f MB/s",1e-6*fCompress*fBytesRead/fRealTime));
410  fPave->AddText(Form("ReadUZCP = %7.3f MB/s",1e-6*fCompress*fBytesRead/fCpuTime));
411  fPave->AddText(Form("ReadRT = %7.3f MB/s",1e-6*fBytesRead/fRealTime));
412  fPave->AddText(Form("ReadCP = %7.3f MB/s",1e-6*fBytesRead/fCpuTime));
413  }
414  fPave->Paint();
415 
416  if (!fHostInfoText) {
417  fHostInfoText = new TText(0.01,0.01,fHostInfo.Data());
419  fHostInfoText->SetTextSize(0.025);
420  }
421  fHostInfoText->Paint();
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Print the TTree I/O perf stats.
426 
427 void TTreePerfStats::Print(Option_t * option) const
428 {
429  TString opts(option);
430  opts.ToLower();
431  Bool_t unzip = opts.Contains("unzip");
432  TTreePerfStats *ps = (TTreePerfStats*)this;
433  ps->Finish();
434 
435  Double_t extra = 100.*fBytesReadExtra/fBytesRead;
436  printf("TreeCache = %d MBytes\n",Int_t(fTreeCacheSize/1000000));
437  printf("N leaves = %d\n",fNleaves);
438  printf("ReadTotal = %g MBytes\n",1e-6*fBytesRead);
439  printf("ReadUnZip = %g MBytes\n",1e-6*fBytesRead*fCompress);
440  printf("ReadCalls = %d\n",fReadCalls);
441  printf("ReadSize = %7.3f KBytes/read\n",0.001*fBytesRead/fReadCalls);
442  printf("Readahead = %d KBytes\n",fReadaheadSize/1000);
443  printf("Readextra = %5.2f per cent\n",extra);
444  printf("Real Time = %7.3f seconds\n",fRealTime);
445  printf("CPU Time = %7.3f seconds\n",fCpuTime);
446  printf("Disk Time = %7.3f seconds\n",fDiskTime);
447  if (unzip) {
448  printf("Strm Time = %7.3f seconds\n",fCpuTime-fUnzipTime);
449  printf("UnzipTime = %7.3f seconds\n",fUnzipTime);
450  }
451  printf("Disk IO = %7.3f MBytes/s\n",1e-6*fBytesRead/fDiskTime);
452  printf("ReadUZRT = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fRealTime);
453  printf("ReadUZCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fCpuTime);
454  printf("ReadRT = %7.3f MBytes/s\n",1e-6*fBytesRead/fRealTime);
455  printf("ReadCP = %7.3f MBytes/s\n",1e-6*fBytesRead/fCpuTime);
456  if (unzip) {
457  printf("ReadStrCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/(fCpuTime-fUnzipTime));
458  printf("ReadZipCP = %7.3f MBytes/s\n",1e-6*fCompress*fBytesRead/fUnzipTime);
459  }
460 }
461 
462 ////////////////////////////////////////////////////////////////////////////////
463 /// Save this object to filename
464 
465 void TTreePerfStats::SaveAs(const char *filename, Option_t * /*option*/) const
466 {
467  TTreePerfStats *ps = (TTreePerfStats*)this;
468  ps->Finish();
469  ps->TObject::SaveAs(filename);
470 }
471 
472 ////////////////////////////////////////////////////////////////////////////////
473 /// Save primitive as a C++ statement(s) on output stream out
474 
475 void TTreePerfStats::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
476 {
477  char quote = '"';
478  out<<" "<<std::endl;
479  if (gROOT->ClassSaved(TTreePerfStats::Class())) {
480  out<<" ";
481  } else {
482  out<<" TTreePerfStats *";
483  }
484  out<<"ps = new TTreePerfStats();"<<std::endl;
485  out<<" ps->SetName("<<quote<<GetName()<<quote<<");"<<std::endl;
486  out<<" ps->SetHostInfo("<<quote<<GetHostInfo()<<quote<<");"<<std::endl;
487  out<<" ps->SetTreeCacheSize("<<fTreeCacheSize<<");"<<std::endl;
488  out<<" ps->SetNleaves("<<fNleaves<<");"<<std::endl;
489  out<<" ps->SetReadCalls("<<fReadCalls<<");"<<std::endl;
490  out<<" ps->SetReadaheadSize("<<fReadaheadSize<<");"<<std::endl;
491  out<<" ps->SetBytesRead("<<fBytesRead<<");"<<std::endl;
492  out<<" ps->SetBytesReadExtra("<<fBytesReadExtra<<");"<<std::endl;
493  out<<" ps->SetRealNorm("<<fRealNorm<<");"<<std::endl;
494  out<<" ps->SetRealTime("<<fRealTime<<");"<<std::endl;
495  out<<" ps->SetCpuTime("<<fCpuTime<<");"<<std::endl;
496  out<<" ps->SetDiskTime("<<fDiskTime<<");"<<std::endl;
497  out<<" ps->SetUnzipTime("<<fUnzipTime<<");"<<std::endl;
498  out<<" ps->SetCompress("<<fCompress<<");"<<std::endl;
499 
500  Int_t i, npoints = fGraphIO->GetN();
501  out<<" TGraphErrors *psGraphIO = new TGraphErrors("<<npoints<<");"<<std::endl;
502  out<<" psGraphIO->SetName("<<quote<<fGraphIO->GetName()<<quote<<");"<<std::endl;
503  out<<" psGraphIO->SetTitle("<<quote<<fGraphIO->GetTitle()<<quote<<");"<<std::endl;
504  out<<" ps->SetGraphIO(psGraphIO);"<<std::endl;
505  fGraphIO->SaveFillAttributes(out,"psGraphIO",0,1001);
506  fGraphIO->SaveLineAttributes(out,"psGraphIO",1,1,1);
507  fGraphIO->SaveMarkerAttributes(out,"psGraphIO",1,1,1);
508  for (i=0;i<npoints;i++) {
509  out<<" psGraphIO->SetPoint("<<i<<","<<fGraphIO->GetX()[i]<<","<<fGraphIO->GetY()[i]<<");"<<std::endl;
510  out<<" psGraphIO->SetPointError("<<i<<",0,"<<fGraphIO->GetEY()[i]<<");"<<std::endl;
511  }
512  npoints = fGraphTime->GetN();
513  out<<" TGraphErrors *psGraphTime = new TGraphErrors("<<npoints<<");"<<std::endl;
514  out<<" psGraphTime->SetName("<<quote<<fGraphTime->GetName()<<quote<<");"<<std::endl;
515  out<<" psGraphTime->SetTitle("<<quote<<fGraphTime->GetTitle()<<quote<<");"<<std::endl;
516  out<<" ps->SetGraphTime(psGraphTime);"<<std::endl;
517  fGraphTime->SaveFillAttributes(out,"psGraphTime",0,1001);
518  fGraphTime->SaveLineAttributes(out,"psGraphTime",1,1,1);
519  fGraphTime->SaveMarkerAttributes(out,"psGraphTime",1,1,1);
520  for (i=0;i<npoints;i++) {
521  out<<" psGraphTime->SetPoint("<<i<<","<<fGraphTime->GetX()[i]<<","<<fGraphTime->GetY()[i]<<");"<<std::endl;
522  out<<" psGraphTime->SetPointError("<<i<<",0,"<<fGraphTime->GetEY()[i]<<");"<<std::endl;
523  }
524 
525  out<<" ps->Draw("<<quote<<option<<quote<<");"<<std::endl;
526 }
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Return distance to one of the objects in the TTreePerfStats.
virtual void Browse(TBrowser *b)
Browse.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
Definition: TAttAxis.cxx:244
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
virtual void SetName(const char *name)
Change the name of the axis.
Definition: TGaxis.cxx:2242
Long64_t fBytesRead
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
Definition: TStopwatch.cxx:108
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Return distance to one of the objects in the TTreePerfStats.
virtual void FileReadEvent(TFile *file, Int_t len, Double_t start)
Record TTree file read event.
long long Long64_t
Definition: RtypesCore.h:69
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Definition: TStopwatch.cxx:56
TGraphErrors * fGraphIO
pointer to the Tree being monitored
Long64_t GetRelOffset() const
Definition: TFile.h:211
Provides the interface for the PROOF internal performance measurement and event tracing.
const char Option_t
Definition: RtypesCore.h:62
void SetTitleColor(Int_t titlecolor)
Definition: TGaxis.h:134
Definition: Rtypes.h:61
virtual Long64_t GetReadEntry() const
Definition: TTree.h:424
virtual void Finish()
When the run is finished this function must be called to save the current parameters in the file and ...
double T(double x)
Definition: ChebyshevPol.h:34
Double_t distance(const TPoint2 &p1, const TPoint2 &p2)
Definition: CsgOps.cxx:467
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition: TSystem.cxx:684
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
Long64_t fBytesReadExtra
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:160
static const char * filename()
#define gROOT
Definition: TROOT.h:340
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
Definition: TLine.cxx:80
virtual void SetTitle(const char *title="")
Change the title of the axis.
Definition: TGaxis.cxx:2280
Double_t fRealTime
Basic string class.
Definition: TString.h:137
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
Definition: TStopwatch.cxx:123
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1088
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetTitle(const char *title="")
Set graph title.
Definition: TGraph.cxx:2153
virtual void Paint(Option_t *option="")
Paint this text with its current attributes.
Definition: TText.cxx:676
virtual Long64_t GetZipBytes() const
Definition: TTree.h:459
Int_t GetN() const
Definition: TGraph.h:132
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition: TTree.cxx:5006
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition: TObject.cxx:164
const char * Data() const
Definition: TString.h:349
Double_t * GetY() const
Definition: TGraph.h:140
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
Definition: TGraph.cxx:1907
TGaxis * fRealTimeAxis
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:2334
void Class()
Definition: Class.C:29
virtual void Paint(Option_t *option="")
Paint this pavetext with its current attributes.
Definition: TPaveText.cxx:392
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttLine.cxx:257
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a string.
Definition: TText.cxx:140
Double_t * GetEY() const
Definition: TGraphErrors.h:69
Double_t fUnzipTime
Base class for several text objects.
Definition: TText.h:42
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
Definition: TText.cxx:809
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save this object to filename.
const char * GetHostInfo() const
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
Definition: TAttMarker.cxx:226
char * out
Definition: TBase64.cxx:29
void SetLabelSize(Float_t labelsize)
Definition: TGaxis.h:118
virtual void SetTextAlign(Short_t align=11)
Definition: TAttText.h:55
Double_t fDiskTime
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition: TObject.cxx:743
ClassImp(TTreePerfStats) TTreePerfStats
default constructor (used when reading an object only)
virtual Long64_t GetTotBytes() const
Definition: TTree.h:431
virtual void SetLineColor(Color_t lcolor)
Definition: TAttLine.h:54
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Double_t * GetX() const
Definition: TGraph.h:139
TAxis * GetXaxis() const
Get x axis of the graph.
Definition: TGraph.cxx:1563
Double_t fCompress
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
virtual Long64_t GetCacheSize() const
Definition: TTree.h:373
virtual void UnzipEvent(TObject *tree, Long64_t pos, Double_t start, Int_t complen, Int_t objlen)
Record TTree unzip event.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
Definition: TAttFill.cxx:229
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
virtual ~TTreePerfStats()
Destructor.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
The axis painter class.
Definition: TGaxis.h:39
Long64_t entry
TTree I/O performance measurement.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
Definition: TAttAxis.cxx:186
TStopwatch * fWatch
#define gPerfStats
Double_t fCpuTime
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:35
double Double_t
Definition: RtypesCore.h:55
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
Definition: TFile.cxx:4344
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a pave.
Definition: TPave.cxx:189
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
Definition: TTree.cxx:8374
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a graph.
Definition: TGraph.cxx:781
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:76
virtual void Print(Option_t *option="") const
Print the TTree I/O perf stats.
T MaxElement(Long64_t n, const T *a)
Definition: TMath.h:688
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:493
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
TAxis * GetYaxis() const
Get y axis of the graph.
Definition: TGraph.cxx:1573
TText * fHostInfoText
virtual void Paint(Option_t *chopt="")
Draw the TTree I/O perf graph.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
Definition: TGraph.cxx:2127
virtual void Paint(Option_t *chopt="")
Draw this axis with its current attributes.
Definition: TGaxis.cxx:684
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
TTree * fTree
pointer to the file containing the Tree
Double_t fRealNorm
A TGraphErrors is a TGraph with error bars.
Definition: TGraphErrors.h:28
void SetLabelColor(Int_t labelcolor)
Definition: TGaxis.h:115
#define gPad
Definition: TVirtualPad.h:288
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
A TTree object has a header with a name and a title.
Definition: TTree.h:94
virtual void SetTextSize(Float_t tsize=1)
Definition: TAttText.h:60
virtual void SetPointError(Double_t ex, Double_t ey)
Set ex and ey values for point pointed by the mouse.
void SetTitleOffset(Float_t titleoffset=1)
Definition: TGaxis.h:131
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
TGraphErrors * fGraphTime
virtual void Draw(Option_t *option="")
Draw the TTree I/O perf graph.
virtual Long64_t GetBytesReadExtra() const
Definition: TFile.h:202
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Definition: TString.cxx:1058
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:39
virtual TObjArray * GetListOfLeaves()
Definition: TTree.h:406
TPaveText * fPave
const char * GetName() const
Returns name of object.
Stopwatch class.
Definition: TStopwatch.h:30