ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fildir.py
Go to the documentation of this file.
1 #
2 # This macro displays the ROOT Directory data structure
3 #
4 
5 from ROOT import TCanvas, TPaveLabel, TPaveText, TText, TArrow, TLine
6 from ROOT import gROOT
7 
8 
9 
10 c1 = TCanvas( 'c1', 'ROOT FilDir description', 700, 900 )
11 c1.Range( 1, 1, 19, 24.5 )
12 
13 title = TPaveLabel( 4, 23, 16, 24.2, 'ROOT File/Directory/Key description' )
14 title.SetFillColor( 16 )
15 title.Draw()
16 
17 keycolor = 42
18 dircolor = 21
19 objcolor = 46
20 file = TPaveText( 2, 19, 6, 22 )
21 file.SetFillColor( 39 )
22 file.Draw()
23 file.SetTextSize( 0.04 )
24 file.AddText( 'TFile' )
25 file.AddText( 'Header' )
26 arrow = TArrow( 6, 20.5, 17, 20.5, 0.02, '|>' )
27 arrow.SetFillStyle( 1001 )
28 arrow.SetLineWidth( 2 )
29 arrow.Draw()
30 free = TPaveText( 8, 20, 11, 21 )
31 free.SetFillColor( 18 )
32 free.Draw()
33 free.AddText( 'First:Last' )
34 free2 = TPaveText( 12, 20, 15, 21 )
35 free2.SetFillColor( 18 )
36 free2.Draw()
37 free2.AddText( 'First:Last' )
38 tfree = TText( 6.2, 21.2, 'fFree = TList of free blocks' )
39 tfree.SetTextSize( 0.02 )
40 tfree.Draw()
41 tkeys = TText( 5.2, 18.2, 'fKeys = TList of Keys' )
42 tkeys.SetTextSize( 0.02 )
43 tkeys.Draw()
44 tmemory = TText( 3.2, 15.2, 'fListHead = TList of Objects in memory' )
45 tmemory.SetTextSize( 0.02 )
46 tmemory.Draw()
47 
48 arrow.DrawArrow( 5, 17, 17, 17, 0.02, '|>' )
49 line = TLine( 5, 19, 5, 17 )
50 line.SetLineWidth( 2 )
51 line.Draw()
52 key0 = TPaveText( 7, 16, 10, 18 )
53 key0.SetTextSize( 0.04 )
54 key0.SetFillColor( keycolor )
55 key0.AddText( 'Key 0' )
56 key0.Draw()
57 key1 = TPaveText( 12, 16, 15, 18 )
58 key1.SetTextSize( 0.04 )
59 key1.SetFillColor( keycolor )
60 key1.AddText( 'Key 1' )
61 key1.Draw()
62 line.DrawLine( 3, 19, 3, 14 )
63 line.DrawLine( 3, 14, 18, 14 )
64 obj0 = TPaveText( 5, 13, 8, 15 )
65 obj0.SetFillColor( objcolor )
66 obj0.AddText( 'Object' )
67 obj0.Draw()
68 dir1 = TPaveText( 10, 13, 13, 15 )
69 dir1.SetFillColor( dircolor )
70 dir1.AddText( 'SubDir' )
71 dir1.Draw()
72 obj1 = TPaveText( 15, 13, 18, 15 )
73 obj1.SetFillColor( objcolor )
74 obj1.AddText( 'Object' )
75 obj1.Draw()
76 arrow.DrawArrow( 12, 11, 17, 11, 0.015, '|>' )
77 arrow.DrawArrow( 11, 9, 17, 9, 0.015, '|>' )
78 line.DrawLine( 12, 13, 12, 11 )
79 line.DrawLine( 11, 13, 11, 9 )
80 key2 = TPaveText( 14, 10.5, 16, 11.5 )
81 key2.SetFillColor( keycolor )
82 key2.AddText( 'Key 0' )
83 key2.Draw()
84 obj2 = TPaveText( 14, 8.5, 16, 9.5 )
85 obj2.SetFillColor( objcolor )
86 obj2.AddText( 'Object' )
87 obj2.Draw()
88 ldot = TLine( 10, 15, 2, 11 )
89 ldot.SetLineStyle( 2 )
90 ldot.Draw()
91 ldot.DrawLine( 13, 15, 8, 11 )
92 ldot.DrawLine( 13, 13, 8, 5 )
93 dirdata = TPaveText( 2, 5, 8, 11 )
94 dirdata.SetTextAlign( 12 )
95 dirdata.SetFillColor( dircolor )
96 dirdata.Draw()
97 dirdata.SetTextSize( 0.015 )
98 dirdata.AddText( 'fModified: True if directory is modified' )
99 dirdata.AddText( 'fWritable: True if directory is writable' )
100 dirdata.AddText( 'fDatimeC: Creation Date/Time' )
101 dirdata.AddText( 'fDatimeM: Last mod Date/Time' )
102 dirdata.AddText( 'fNbytesKeys: Number of bytes of key' )
103 dirdata.AddText( 'fNbytesName : Header length up to title' )
104 dirdata.AddText( 'fSeekDir: Start of Directory on file' )
105 dirdata.AddText( 'fSeekParent: Start of Parent Directory' )
106 dirdata.AddText( 'fSeekKeys: Pointer to Keys record' )
107 keydata = TPaveText( 10, 2, 17, 7 )
108 keydata.SetTextAlign( 12 )
109 keydata.SetFillColor( keycolor )
110 keydata.Draw()
111 ldot.DrawLine( 14, 11.5, 10, 7 )
112 ldot.DrawLine( 16, 11.5, 17, 7 )
113 keydata.SetTextSize( 0.015 )
114 keydata.AddText( 'fNbytes: Size of compressed Object' )
115 keydata.AddText( 'fObjLen: Size of uncompressed Object' )
116 keydata.AddText( 'fDatime: Date/Time when written to store' )
117 keydata.AddText( 'fKeylen: Number of bytes for the key' )
118 keydata.AddText( 'fCycle : Cycle number' )
119 keydata.AddText( 'fSeekKey: Pointer to Object on file' )
120 keydata.AddText( 'fSeekPdir: Pointer to directory on file' )
121 keydata.AddText( 'fClassName: "TKey"' )
122 keydata.AddText( 'fName: Object name' )
123 keydata.AddText( 'fTitle: Object Title' )
124 
125 c1.Update()