Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFileDrawMap.cxx
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Rene Brun 15/01/2003
3
4/*************************************************************************
5 * Copyright (C) 1995-2003, 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 TFileDrawMap
13This class is automatically called by TFile::DrawMap.
14It draws a canvas showing the internal structure of a ROOT file.
15Each key or basket in a file is shown with a fill area drawn
16at the byte position of the key/basket in the file.
17The Y axis of the canvas shows the number of Kbytes/Mbytes.
18The X axis shows the bytes between y(i) and y(i+1).
19A color corresponding to the class in the key/basket is automatically
20selected using the class unique identifier.
21
22When moving the mouse in the canvas, the "Event Status" panels
23shows the object corresponding to the mouse position.
24if the object is a key, it shows the class and object name as well as
25the file directory name if the file has sub-directories.
26
27if the object is a basket, it shows:
28 - the name of the Tree
29 - the name of the branch
30 - the basket number
31 - the entry number in the basket
32
33Special keys like the StreamerInfo record, the Keys List Record
34and the Free Blocks Record are also shown.
35
36When clicking the right mouse button, a pop-up menu is shown
37with its title identifying the picked object and with the items:
38 - DrawObject: in case of a key, the Draw function of the object is called
39 in case of a basket, the branch is drawn for all entries
40 - DumpObject: in case of a key, the Dump function of the object is called
41 in case of a basket, tree->Show(entry) is called
42 - InspectObject: the Inspect function is called for the object.
43
44The normal axis zoom functionality can be used to zoom or unzoom
45One can also use the TCanvas context menu SetCanvasSize to make
46a larger canvas and use the canvas scroll bars.
47
48When the class is built, it is possible to identify a subset of the
49objects to be shown. For example, to view only the keys with
50names starting with "abc", set the argument keys to "abc*".
51The default is to view all the objects.
52The argument options can also be used (only one option currently)
53When the option "same" is given, the new picture is superimposed.
54The option "same" is useful, eg:
55to draw all keys with names = "abc" in a first pass
56then all keys with names = "uv*" in a second pass, etc.
57*/
58
59#include "TFileDrawMap.h"
60#include "TROOT.h"
61#include "TClass.h"
62#include "TFile.h"
63#include "TTree.h"
64#include "TBranch.h"
65#include "TLeaf.h"
66#include "TMath.h"
67#include "TVirtualPad.h"
68#include "TVirtualX.h"
69#include "TH1.h"
70#include "TBox.h"
71#include "TKey.h"
72#include "TRegexp.h"
73#include "TSystem.h"
74#include "strlcpy.h"
75
77
78////////////////////////////////////////////////////////////////////////////////
79/// Default TreeFileMap constructor.
80
82{
83 fFile = nullptr;
84 fFrame = nullptr;
85 fXsize = 1000;
86 fYsize = 1000;
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// TFileDrawMap normal constructor.
91/// see descriptions of arguments above
92
93TFileDrawMap::TFileDrawMap(const TFile *file, const char *keys, Option_t *option)
94 : TNamed("TFileDrawMap","")
95{
96 fFile = (TFile*)file;
97 fKeys = keys;
101
102 //create histogram used to draw the map frame
103
104 if (file->GetEND() > 1000000) {
105 fXsize = 1000000;
106 } else {
107 fXsize = 1000;
108 }
109 fFrame = new TH1D("hmapframe","",1000,0,fXsize);
110 fFrame->SetDirectory(nullptr);
113 fFrame->SetMinimum(0);
114 if (fXsize > 1000) {
115 fFrame->GetYaxis()->SetTitle("MBytes");
116 } else {
117 fFrame->GetYaxis()->SetTitle("KBytes");
118 }
119 fFrame->GetXaxis()->SetTitle("Bytes");
120 fYsize = 1 + Int_t(file->GetEND()/fXsize);
123
124 //bool show = false;
125 if (gPad) {
126 gPad->Clear();
127 //show = gPad->GetCanvas()->GetShowEventStatus();
128 }
129 Draw();
130 if (gPad) {
131 //if (!show) gPad->GetCanvas()->ToggleEventStatus();
132 gPad->Update();
133 }
134}
135
136////////////////////////////////////////////////////////////////////////////////
137/// Tree destructor.
138
140{
141 //delete fFrame; //should not be deleted (kCanDelete set)
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// Show sequence of baskets reads for the list of baskets involved
146/// in the list of branches (separated by ",")
147/// - if branches="", the branch pointed by the mouse is taken.
148/// - if branches="*", all branches are taken
149/// Example:
150///
151/// AnimateTree("x,y,u");
152
153void TFileDrawMap::AnimateTree(const char *branches)
154{
155 TString ourbranches( GetName() );
156 Ssiz_t pos = ourbranches.Index(", basket=");
157 if (pos == kNPOS) return;
158 ourbranches.Remove(pos);
159 pos = ourbranches.Index(", branch=");
160 if (pos == kNPOS) return;
161 ourbranches[pos] = 0;
162
163 TTree *tree = (TTree*)fFile->Get(ourbranches.Data());
164 if (!tree) return;
165 TString info;
166 if (strlen(branches) > 0) info = branches;
167 else info = ourbranches.Data()+pos+9;
168 printf("Animating tree, branches=%s\n",info.Data());
169
170 // create list of branches
171 Int_t nzip = 0;
172 TBranch *branch;
173 TObjArray list;
174 char *comma;
175 while((comma = strrchr((char*)info.Data(),','))) {
176 *comma = 0;
177 comma++;
178 while (*comma == ' ') comma++;
179 branch = tree->GetBranch(comma);
180 if (branch) {
181 nzip += (Int_t)branch->GetZipBytes();
182 branch->SetUniqueID(0);
183 list.Add(branch);
184 }
185 }
186 comma = (char*)info.Data();
187 while (*comma == ' ') comma++;
188 branch = tree->GetBranch(comma);
189 if (branch) {
190 nzip += (Int_t)branch->GetZipBytes();
191 branch->SetUniqueID(0);
192 list.Add(branch);
193 }
194 Double_t fractionRead = Double_t(nzip)/Double_t(fFile->GetEND());
195 Int_t nbranches = list.GetEntries();
196
197 // loop on all tree entries
198 Int_t nentries = (Int_t)tree->GetEntries();
199 Int_t sleep = 1;
200 Int_t stime = (Int_t)(100./(nentries*fractionRead));
201 if (stime < 10) {stime=1; sleep = nentries/400;}
202 gPad->SetDoubleBuffer(0); // turn off double buffer mode
203 gVirtualX->SetDrawMode(TVirtualX::kInvert); // set the drawing mode to XOR mode
204 for (Int_t entry=0;entry<nentries;entry++) {
205 for (Int_t ib=0;ib<nbranches;ib++) {
206 branch = (TBranch*)list.At(ib);
207 Int_t nbaskets = branch->GetListOfBaskets()->GetSize();
208 Int_t basket = TMath::BinarySearch(nbaskets,branch->GetBasketEntry(), (Long64_t) entry);
209 Int_t nbytes = branch->GetBasketBytes()[basket];
210 Int_t bseek = branch->GetBasketSeek(basket);
211 Int_t entry0 = branch->GetBasketEntry()[basket];
212 Int_t entryn = branch->GetBasketEntry()[basket+1];
213 Int_t eseek = (Int_t)(bseek + nbytes*Double_t(entry-entry0)/Double_t(entryn-entry0));
214 DrawMarker(ib,branch->GetUniqueID());
215 DrawMarker(ib,eseek);
216 branch->SetUniqueID(eseek);
218 if (entry%sleep == 0) gSystem->Sleep(stime);
219 }
220 }
221}
222
223////////////////////////////////////////////////////////////////////////////////
224/// Compute distance from point px,py to this TreeFileMap.
225/// Find the closest object to the mouse, save its path in the TFileDrawMap name.
226
228{
229 Int_t pxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
230 Int_t pxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
231 Int_t pymin = gPad->YtoAbsPixel(gPad->GetUymin());
232 Int_t pymax = gPad->YtoAbsPixel(gPad->GetUymax());
233 if (px > pxmin && px < pxmax && py > pymax && py < pymin) {
234 SetName(GetObjectInfo(px,py));
235 return 0;
236 }
237 return fFrame->DistancetoPrimitive(px,py);
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Draw marker.
242
244{
245 Int_t iy = gPad->YtoAbsPixel(eseek/fXsize);
246 Int_t ix = gPad->XtoAbsPixel(eseek%fXsize);
247 Int_t d;
248 Int_t mark = marker%4;
249 switch (mark) {
250 case 0 :
251 d = 6; //arrow
252 gVirtualX->DrawLine(ix-3*d,iy,ix,iy);
253 gVirtualX->DrawLine(ix-d,iy+d,ix,iy);
254 gVirtualX->DrawLine(ix-d,iy-d,ix,iy);
255 gVirtualX->DrawLine(ix-d,iy-d,ix-d,iy+d);
256 break;
257 case 1 :
258 d = 5; //up triangle
259 gVirtualX->DrawLine(ix-d,iy-d,ix+d,iy-d);
260 gVirtualX->DrawLine(ix+d,iy-d,ix,iy+d);
261 gVirtualX->DrawLine(ix,iy+d,ix-d,iy-d);
262 break;
263 case 2 :
264 d = 5; //open square
265 gVirtualX->DrawLine(ix-d,iy-d,ix+d,iy-d);
266 gVirtualX->DrawLine(ix+d,iy-d,ix+d,iy+d);
267 gVirtualX->DrawLine(ix+d,iy+d,ix-d,iy+d);
268 gVirtualX->DrawLine(ix-d,iy+d,ix-d,iy-d);
269 break;
270 case 3 :
271 d = 8; //cross
272 gVirtualX->DrawLine(ix-d,iy,ix+d,iy);
273 gVirtualX->DrawLine(ix,iy-d,ix,iy+d);
274 break;
275 }
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Draw object at the mouse position.
280
282{
283 TVirtualPad *padsave = gROOT->GetSelectedPad();
284 if (padsave == gPad) {
285 //must create a new canvas
286 gROOT->MakeDefCanvas();
287 } else if (padsave) {
288 padsave->cd();
289 }
290
291 // case of a TTree
292 char *info = new char[fName.Length()+1];
293 strlcpy(info,fName.Data(),fName.Length()+1);
294 char *cbasket = (char*)strstr(info,", basket=");
295 if (cbasket) {
296 *cbasket = 0;
297 char *cbranch = (char*)strstr(info,", branch=");
298 if (!cbranch) { delete [] info; return; }
299 *cbranch = 0;
300 cbranch += 9;
301 TTree *tree = (TTree*)fFile->Get(info);
302 if (tree) tree->Draw(cbranch);
303 delete [] info;
304 return;
305 }
306
307 delete [] info;
308
309 // other objects
310 TObject *obj = GetObject();
311 if (obj) obj->Draw();
312}
313
314
315////////////////////////////////////////////////////////////////////////////////
316/// Dump object at the mouse position.
317
319{
320 TObject *obj = GetObject();
321 if (obj) {
322 obj->Dump();
323 return;
324 }
325 char *centry = (char*)strstr(GetName(),"entry=");
326 if (!centry) return;
327 Int_t entry = 0;
328 sscanf(centry+6,"%d",&entry);
329 TString info(GetName());
330 char *colon = (char*)strstr((char*)info.Data(),"::");
331 if (!colon) return;
332 colon--;
333 *colon = 0;
334 TTree *tree; fFile->GetObject(info.Data(),tree);
335 if (tree) tree->Show(entry);
336}
337
338////////////////////////////////////////////////////////////////////////////////
339/// Execute action corresponding to one event.
340
342{
343 fFrame->ExecuteEvent(event,px,py);
344}
345
346////////////////////////////////////////////////////////////////////////////////
347/// Retrieve object at the mouse position in memory.
348
350{
351 if (strstr(GetName(),"entry=")) return nullptr;
352 char *info = new char[fName.Length()+1];
353 strlcpy(info,fName.Data(),fName.Length()+1);
354 char *colon = strstr(info,"::");
355 if (!colon) {
356 delete [] info;
357 return nullptr;
358 }
359 colon--;
360 *colon = 0;
361 auto res = fFile->Get(info);
362 delete [] info;
363 return res;
364}
365
366////////////////////////////////////////////////////////////////////////////////
367/// Redefines TObject::GetObjectInfo.
368/// Displays the keys info in the file corresponding to cursor position px,py
369/// in the canvas status bar info panel
370
372{
373 // Thread safety: this solution is not elegant, but given the action performed
374 // by the method, this construct can be considered non-problematic.
375 static TString info;
376 GetObjectInfoDir(fFile, px, py, info);
377 return (char*)info.Data();
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Redefines TObject::GetObjectInfo.
382/// Displays the keys info in the directory
383/// corresponding to cursor position px,py
384
386{
387 Double_t x = gPad->AbsPixeltoX(px);
388 Double_t y = gPad->AbsPixeltoY(py);
389 Int_t iy = (Int_t)y;
390 Long64_t pbyte = (Long64_t)(fXsize*iy+x);
391 Int_t nbytes;
392 Long64_t bseek;
393 TDirectory *dirsav = gDirectory;
394 dir->cd();
395
396 TIter next(dir->GetListOfKeys());
397 TKey *key;
398 while ((key = (TKey*)next())) {
399 TDirectory *curdir = gDirectory;
401 // a TDirectory ?
402 if (cl && cl == TDirectoryFile::Class()) {
403 curdir->cd(key->GetName());
404 TDirectory *subdir = gDirectory;
405 bool gotInfo = GetObjectInfoDir(subdir, px, py, info);
406 if (gotInfo) {
407 dirsav->cd();
408 return true;
409 }
410 curdir->cd();
411 continue;
412 }
413 // a TTree ?
414 if (cl && cl->InheritsFrom(TTree::Class())) {
415 TTree *tree = (TTree*)gDirectory->Get(key->GetName());
416 TIter nextb(tree->GetListOfLeaves());
417 TLeaf *leaf;
418 while ((leaf = (TLeaf*)nextb())) {
419 TBranch *branch = leaf->GetBranch();
420 Int_t nbaskets = branch->GetMaxBaskets();
421 Int_t offsets = branch->GetEntryOffsetLen();
422 Int_t len = leaf->GetLen();
423 for (Int_t i=0;i<nbaskets;i++) {
424 bseek = branch->GetBasketSeek(i);
425 if (!bseek) break;
426 nbytes = branch->GetBasketBytes()[i];
427 if (pbyte >= bseek && pbyte < bseek+nbytes) {
428 Int_t entry = branch->GetBasketEntry()[i];
429 if (!offsets) entry += (pbyte-bseek)/len;
430 if (curdir == (TDirectory*)fFile) {
431 info.Form("%s%s, branch=%s, basket=%d, entry=%d",curdir->GetPath(),key->GetName(),branch->GetName(),i,entry);
432 } else {
433 info.Form("%s/%s, branch=%s, basket=%d, entry=%d",curdir->GetPath(),key->GetName(),branch->GetName(),i,entry);
434 }
435 return true;
436 }
437 }
438 }
439 }
440 nbytes = key->GetNbytes();
441 bseek = key->GetSeekKey();
442 if (pbyte >= bseek && pbyte < bseek+nbytes) {
443 if (curdir == (TDirectory*)fFile) {
444 info.Form("%s%s ::%s, nbytes=%d",curdir->GetPath(),key->GetName(),key->GetClassName(),nbytes);
445 } else {
446 info.Form("%s/%s ::%s, nbytes=%d",curdir->GetPath(),key->GetName(),key->GetClassName(),nbytes);
447 }
448 dirsav->cd();
449 return true;
450 }
451 }
452 // Are we in the Keys list
453 if (pbyte >= dir->GetSeekKeys() && pbyte < dir->GetSeekKeys()+dir->GetNbytesKeys()) {
454 info.Form("%sKeys List, nbytes=%d",dir->GetPath(),dir->GetNbytesKeys());
455 dirsav->cd();
456 return true;
457 }
458 if (dir == (TDirectory*)fFile) {
459 // Are we in the TStreamerInfo
460 if (pbyte >= fFile->GetSeekInfo() && pbyte < fFile->GetSeekInfo()+fFile->GetNbytesInfo()) {
461 info.Form("%sStreamerInfo List, nbytes=%d",dir->GetPath(),fFile->GetNbytesInfo());
462 dirsav->cd();
463 return true;
464 }
465 // Are we in the Free Segments
466 if (pbyte >= fFile->GetSeekFree() && pbyte < fFile->GetSeekFree()+fFile->GetNbytesFree()) {
467 info.Form("%sFree List, nbytes=%d",dir->GetPath(),fFile->GetNbytesFree());
468 dirsav->cd();
469 return true;
470 }
471 }
472 info.Form("(byte=%lld)",pbyte);
473 dirsav->cd();
474 return false;
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Inspect object at the mouse position.
479
481{
482 TObject *obj = GetObject();
483 if (obj) obj->Inspect();
484}
485
486////////////////////////////////////////////////////////////////////////////////
487/// Paint this TFileDrawMap.
488
490{
491 // draw map frame
492 if (!fOption.Contains("same")) {
493 gPad->Clear();
494 //just in case axis Y has been unzoomed
495 if (fFrame->GetMaximumStored() < -1000) {
497 fFrame->SetMinimum(0);
499 }
500 fFrame->Paint();
501 }
502
503 //draw keys
505
506 fFrame->Draw("sameaxis");
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Paint the object at bseek with nbytes using the box object.
511
513{
514 Int_t iy = bseek/fXsize;
515 Int_t ix = bseek%fXsize;
516 Int_t ny = 1+(nbytes+ix)/fXsize;
518 for (Int_t j=0;j<ny;j++) {
519 if (j == 0) xmin = (Double_t)ix;
520 else xmin = 0;
521 xmax = xmin + nbytes;
522 if (xmax > fXsize) xmax = fXsize;
523 ymin = iy+j;
524 ymax = ymin+1;
525 nbytes -= (Int_t)(xmax-xmin);
526 if (xmax < gPad->GetUxmin()) continue;
527 if (xmin > gPad->GetUxmax()) continue;
528 if (xmin < gPad->GetUxmin()) xmin = gPad->GetUxmin();
529 if (xmax > gPad->GetUxmax()) xmax = gPad->GetUxmax();
530 if (ymax < gPad->GetUymin()) continue;
531 if (ymin > gPad->GetUymax()) continue;
532 if (ymin < gPad->GetUymin()) ymin = gPad->GetUymin();
533 if (ymax > gPad->GetUymax()) ymax = gPad->GetUymax();
534 //box.TAttFill::Modify();
535 box.PaintBox(xmin,ymin,xmax,ymax);
536 }
537}
538
539////////////////////////////////////////////////////////////////////////////////
540/// Paint keys in a directory.
541
542void TFileDrawMap::PaintDir(TDirectory *dir, const char *keys)
543{
544 TDirectory *dirsav = gDirectory;
545 TIter next(dir->GetListOfKeys());
546 TKey *key;
547 Int_t color = 0;
548 TBox box;
549 TRegexp re(keys,true);
550 while ((key = (TKey*)next())) {
551 Int_t nbytes = key->GetNbytes();
552 Long64_t bseek = key->GetSeekKey();
554 if (cl) {
555 color = (Int_t)(cl->GetUniqueID()%20);
556 } else {
557 color = 1;
558 }
559 box.SetFillColor(color);
560 box.SetFillStyle(1001);
561 TString s = key->GetName();
562 if (strcmp(fKeys.Data(),key->GetName()) && s.Index(re) == kNPOS) continue;
563 // a TDirectory ?
564 if (cl && cl == TDirectoryFile::Class()) {
565 TDirectory *curdir = gDirectory;
566 gDirectory->cd(key->GetName());
567 TDirectory *subdir = gDirectory;
568 PaintDir(subdir,"*");
569 curdir->cd();
570 }
571 PaintBox(box,bseek,nbytes);
572 // a TTree ?
573 if (cl && cl->InheritsFrom(TTree::Class())) {
574 TTree *tree = (TTree*)gDirectory->Get(key->GetName());
575 TIter nextb(tree->GetListOfLeaves());
576 TLeaf *leaf;
577 while ((leaf = (TLeaf*)nextb())) {
578 TBranch *branch = leaf->GetBranch();
579 color = branch->GetFillColor();
580 if (color == 0) {
581 gPad->IncrementPaletteColor(1, "pfc");
582 color = gPad->NextPaletteColor();
583 }
584 box.SetFillColor(color);
585 Int_t nbaskets = branch->GetMaxBaskets();
586 for (Int_t i=0;i<nbaskets;i++) {
587 bseek = branch->GetBasketSeek(i);
588 if (!bseek) break;
589 nbytes = branch->GetBasketBytes()[i];
590 PaintBox(box,bseek,nbytes);
591 }
592 }
593 }
594 }
595 // draw the box for Keys list
596 box.SetFillColor(50);
597 box.SetFillStyle(1001);
598 PaintBox(box,dir->GetSeekKeys(),dir->GetNbytesKeys());
599 if (dir == (TDirectory*)fFile) {
600 // draw the box for TStreamerInfo
601 box.SetFillColor(6);
602 box.SetFillStyle(3008);
604 // draw the box for Free Segments
605 box.SetFillColor(1);
606 box.SetFillStyle(1001);
608 }
609 dirsav->cd();
610}
#define d(i)
Definition RSha256.hxx:102
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
constexpr Ssiz_t kNPOS
Definition RtypesCore.h:124
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
#define gDirectory
Definition TDirectory.h:384
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 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
float xmin
int nentries
float ymin
float xmax
float ymax
R__EXTERN C unsigned int sleep(unsigned int seconds)
#define gROOT
Definition TROOT.h:406
R__EXTERN TSystem * gSystem
Definition TSystem.h:555
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
virtual Color_t GetFillColor() const
Return the fill area color.
Definition TAttFill.h:30
virtual void SetLimits(Double_t xmin, Double_t xmax)
Definition TAxis.h:164
Create a Box.
Definition TBox.h:22
A TTree is a list of TBranches.
Definition TBranch.h:93
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
Definition TBranch.cxx:1302
TObjArray * GetListOfBaskets()
Definition TBranch.h:245
Int_t GetMaxBaskets() const
Definition TBranch.h:248
Int_t * GetBasketBytes() const
Definition TBranch.h:214
Long64_t GetZipBytes(Option_t *option="") const
Return total number of zip bytes in the branch if option ="*" includes all sub-branches of this branc...
Definition TBranch.cxx:2238
Long64_t * GetBasketEntry() const
Definition TBranch.h:215
Int_t GetEntryOffsetLen() const
Definition TBranch.h:227
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Definition TClass.cxx:4874
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2968
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static TClass * Class()
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
Definition TDirectory.h:45
virtual Int_t GetNbytesKeys() const
Definition TDirectory.h:226
virtual const char * GetPath() const
Returns the full path of the directory.
virtual Bool_t cd()
Change current directory to "this" directory.
virtual Long64_t GetSeekKeys() const
Definition TDirectory.h:230
virtual TList * GetListOfKeys() const
Definition TDirectory.h:223
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
Definition TDirectory.h:212
This class is automatically called by TFile::DrawMap.
virtual bool GetObjectInfoDir(TDirectory *dir, Int_t px, Int_t py, TString &info) const
Redefines TObject::GetObjectInfo.
TFile * fFile
Pointer to the file.
virtual void DrawObject()
Draw object at the mouse position.
virtual void DrawMarker(Int_t marker, Long64_t eseek)
Draw marker.
Int_t fYsize
Size in K/Mbytes of Y axis.
TString fKeys
List of keys.
TString fOption
Drawing options.
~TFileDrawMap() override
Tree destructor.
virtual void PaintDir(TDirectory *dir, const char *keys)
Paint keys in a directory.
Int_t fXsize
Size in bytes of X axis.
virtual void DumpObject()
Dump object at the mouse position.
virtual void InspectObject()
Inspect object at the mouse position.
TFileDrawMap()
Default TreeFileMap constructor.
char * GetObjectInfo(Int_t px, Int_t py) const override
Redefines TObject::GetObjectInfo.
virtual void PaintBox(TBox &box, Long64_t bseek, Int_t nbytes)
Paint the object at bseek with nbytes using the box object.
virtual TObject * GetObject()
Retrieve object at the mouse position in memory.
virtual void AnimateTree(const char *branches="")
Show sequence of baskets reads for the list of baskets involved in the list of branches (separated by...
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
TH1 * fFrame
Histogram used to draw the map frame.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to this TreeFileMap.
void Paint(Option_t *option) override
Paint this TFileDrawMap.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
virtual Long64_t GetSeekFree() const
Definition TFile.h:252
virtual Long64_t GetEND() const
Definition TFile.h:231
virtual Long64_t GetSeekInfo() const
Definition TFile.h:253
virtual Int_t GetNbytesFree() const
Definition TFile.h:249
virtual Int_t GetNbytesInfo() const
Definition TFile.h:248
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:669
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8905
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
Definition TH1.cxx:2823
@ kNoStats
Don't draw stats box.
Definition TH1.h:165
TAxis * GetXaxis()
Definition TH1.h:324
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:403
TAxis * GetYaxis()
Definition TH1.h:325
void Draw(Option_t *option="") override
Draw this histogram with options.
Definition TH1.cxx:3066
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:404
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
Definition TH1.cxx:6174
virtual Double_t GetMaximumStored() const
Definition TH1.h:289
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TH1.cxx:3240
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition TKey.h:28
virtual Long64_t GetSeekKey() const
Definition TKey.h:89
Int_t GetNbytes() const
Definition TKey.h:86
virtual const char * GetClassName() const
Definition TKey.h:75
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
Definition TLeaf.cxx:404
TBranch * GetBranch() const
Definition TLeaf.h:116
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
TString fName
Definition TNamed.h:32
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
void Add(TObject *obj) override
Definition TObjArray.h:68
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Inspect() const
Dump contents of this object in a graphics canvas.
Definition TObject.cxx:546
virtual void Dump() const
Dump contents of object on stdout.
Definition TObject.cxx:348
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition TObject.cxx:457
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:780
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:791
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:274
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:62
Regular expression class.
Definition TRegexp.h:31
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
void ToLower()
Change string to lower-case.
Definition TString.cxx:1182
const char * Data() const
Definition TString.h:376
TString & Remove(Ssiz_t pos)
Definition TString.h:685
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2356
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition TString.h:651
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition TSystem.cxx:437
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:416
A TTree represents a columnar dataset.
Definition TTree.h:79
static TClass * Class()
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual TVirtualPad * GetSelectedPad() const =0
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Definition TMathBase.h:347
th1 Draw()