11from ROOT
import TCanvas, TPaveLabel, TPaveText, TPavesText, TText
12from ROOT
import TArrow, TLine
13from ROOT
import gROOT, gBenchmark
17c1 =
TCanvas(
'c1',
'Tree Data Structure',200,10,750,940)
18c1.Range(0,-0.1,1,1.15)
20gBenchmark.Start(
'tree')
27title =
TPaveLabel(.3,1.05,.8,1.13,
'Tree Data Structure')
33tnt = tree.AddText(
'Tree')
36tree.AddText(
'fScanField')
37tree.AddText(
'fMaxEventLoop')
38tree.AddText(
'fMaxVirtualSize')
39tree.AddText(
'fEntries')
40tree.AddText(
'fDimension')
41tree.AddText(
'fSelectedRows')
44tfarm = farm.AddText(
'CHAIN')
45tfarm.SetTextSize(0.024)
46farm.AddText(
'Collection')
47farm.AddText(
'of Trees')
49link =
TLine(.15,.92,.80,.92)
53link.DrawLine(.21,.87,.21,.275)
54link.DrawLine(.23,.87,.23,.375)
55link.DrawLine(.25,.87,.25,.775)
56link.DrawLine(.41,.25,.41,-.025)
57link.DrawLine(.43,.25,.43,.075)
58link.DrawLine(.45,.25,.45,.175)
59branch0 =
TPaveLabel(.20,.87,.35,.97,
'Branch 0')
60branch0.SetTextSize(0.35)
61branch0.SetFillColor(branchcolor)
63branch1 =
TPaveLabel(.40,.87,.55,.97,
'Branch 1')
64branch1.SetTextSize(0.35)
65branch1.SetFillColor(branchcolor)
67branch2 =
TPaveLabel(.60,.87,.75,.97,
'Branch 2')
68branch2.SetTextSize(0.35)
69branch2.SetFillColor(branchcolor)
71branch3 =
TPaveLabel(.80,.87,.95,.97,
'Branch 3')
72branch3.SetTextSize(0.35)
73branch3.SetFillColor(branchcolor)
76leaf0.SetFillColor(leafcolor)
79leaf1.SetFillColor(leafcolor)
82leaf2.SetFillColor(leafcolor)
85firstevent.AddText(
'First event of each basket')
86firstevent.AddText(
'Array of fMaxBaskets Integers')
87firstevent.SetFillColor(basketcolor)
90basket0.SetFillColor(basketcolor)
93basket1.SetFillColor(basketcolor)
96basket2.SetFillColor(basketcolor)
100offset.AddText(
'Offset of events in fBuffer')
101offset.AddText(
'Array of fEventOffsetLen Integers')
102offset.AddText(
'(if variable length structure)')
103offset.SetFillColor(offsetcolor)
106buffer.AddText(
'Basket buffer')
107buffer.AddText(
'Array of fBasketSize chars')
108buffer.SetFillColor(offsetcolor)
111zipbuffer.AddText(
'Basket compressed buffer')
112zipbuffer.AddText(
'(if compression)')
113zipbuffer.SetFillColor(offsetcolor)
118ar1.SetFillStyle(1001)
120ar1.DrawArrow(.21,.275,.39,.275,0.015,
'|>')
121ar1.DrawArrow(.23,.375,.39,.375,0.015,
'|>')
122ar1.DrawArrow(.25,.775,.39,.775,0.015,
'|>')
123ar1.DrawArrow(.50,.775,.59,.775,0.015,
'|>')
124ar1.DrawArrow(.70,.775,.79,.775,0.015,
'|>')
125ar1.DrawArrow(.50,.275,.59,.275,0.015,
'|>')
126ar1.DrawArrow(.70,.275,.79,.275,0.015,
'|>')
127ar1.DrawArrow(.45,.175,.54,.175,0.015,
'|>')
128ar1.DrawArrow(.43,.075,.54,.075,0.015,
'|>')
129ar1.DrawArrow(.41,-.025,.54,-.025,0.015,
'|>')
130ldot =
TLine(.95,.92,.99,.92)
133ldot.DrawLine(.9,.775,.99,.775)
134ldot.DrawLine(.9,.275,.99,.275)
135ldot.DrawLine(.55,.05,.55,0)
136ldot.DrawLine(.9,.05,.75,0)
137pname =
TText(.46,.21,
'fEventOffset')
139pname.SetTextSize(0.018)
141pname.DrawText(.44,.11,
'fBuffer')
142pname.DrawText(.42,.01,
'fZipBuffer')
143pname.DrawText(.26,.81,
'fLeaves = TObjArray of TLeaf')
144pname.DrawText(.24,.40,
'fBasketEvent')
145pname.DrawText(.22,.31,
'fBaskets = TObjArray of TBasket')
146pname.DrawText(.20,1.0,
'fBranches = TObjArray of TBranch')
148ntleaf.SetTextSize(0.014)
149ntleaf.SetFillColor(leafcolor)
150ntleaf.SetTextAlign(12)
151ntleaf.AddText(
'fLen: number of fixed elements')
152ntleaf.AddText(
'fLenType: number of bytes of data type')
153ntleaf.AddText(
'fOffset: relative to Leaf0-fAddress')
154ntleaf.AddText(
'fNbytesIO: number of bytes used for I/O')
155ntleaf.AddText(
'fIsPointer: True if pointer')
156ntleaf.AddText(
'fIsRange: True if leaf has a range')
157ntleaf.AddText(
'fIsUnsigned: True if unsigned')
158ntleaf.AddText(
'*fLeafCount: points to Leaf counter')
160ntleaf.AddLine(0,0,0,0)
161ntleaf.AddText(
'fName = Leaf name')
162ntleaf.AddText(
'fTitle = Leaf type (see Type codes)')
166type.SetFillColor(leafcolor)
168type.AddText(
'C : a character string')
169type.AddText(
'B : an 8 bit signed integer')
170type.AddText(
'b : an 8 bit unsigned integer')
171type.AddText(
'S : a 16 bit signed short integer')
172type.AddText(
's : a 16 bit unsigned short integer')
173type.AddText(
'I : a 32 bit signed integer')
174type.AddText(
'i : a 32 bit unsigned integer')
175type.AddText(
'F : a 32 bit floating point')
176type.AddText(
'D : a 64 bit floating point')
177type.AddText(
'TXXXX : a class name TXXXX')
179typecode =
TPaveLabel(.7,.68,.9,.72,
'fType codes')
180typecode.SetFillColor(leafcolor)
182ldot.DrawLine(.4,.75,.30,.7)
183ldot.DrawLine(.5,.75,.62,.7)
185ntbasket.SetFillColor(basketcolor)
186ntbasket.SetTextSize(0.014)
187ntbasket.SetTextAlign(12)
188ntbasket.AddText(
'fNbytes: Size of compressed Basket')
189ntbasket.AddText(
'fObjLen: Size of uncompressed Basket')
190ntbasket.AddText(
'fDatime: Date/Time when written to store')
191ntbasket.AddText(
'fKeylen: Number of bytes for the key')
192ntbasket.AddText(
'fCycle : Cycle number')
193ntbasket.AddText(
'fSeekKey: Pointer to Basket on file')
194ntbasket.AddText(
'fSeekPdir: Pointer to directory on file')
195ntbasket.AddText(
"fClassName: 'TBasket'")
196ntbasket.AddText(
'fName: Branch name')
197ntbasket.AddText(
'fTitle: Tree name')
199ntbasket.AddLine(0,0,0,0)
200ntbasket.AddText(
'fNevBuf: Number of events in Basket')
201ntbasket.AddText(
'fLast: pointer to last used byte in Basket')
203ldot.DrawLine(.4,.3,0.02,0.25)
204ldot.DrawLine(.5,.25,0.35,-.07)
205ldot.DrawLine(.5,.3,0.35,0.25)
207ntbranch.SetFillColor(branchcolor)
208ntbranch.SetTextSize(0.015)
209ntbranch.SetTextAlign(12)
210ntbranch.AddText(
'fBasketSize')
211ntbranch.AddText(
'fEventOffsetLen')
212ntbranch.AddText(
'fMaxBaskets')
213ntbranch.AddText(
'fEntries')
214ntbranch.AddText(
'fAddress of Leaf0')
216ntbranch.AddLine(0,0,0,0)
217ntbranch.AddText(
'fName: Branchname')
218ntbranch.AddText(
'fTitle: leaflist')
220ldot.DrawLine(.2,.97,.02,.68)
221ldot.DrawLine(.35,.97,.18,.68)
222ldot.DrawLine(.35,.87,.18,.40)
223basketstore =
TPavesText(.8,-0.088,0.952,-0.0035,7,
'tr')
224basketstore.SetFillColor(28)
225basketstore.AddText(
'Baskets')
226basketstore.AddText(
'Stores')
230gBenchmark.Show(
'tree')
Draw all kinds of Arrows.
Use the TLine constructor to create a simple line.
A Pave (see TPave) with a text centered in the Pave.
A Pave (see TPave) with text, lines or/and boxes inside.
A PaveText (see TPaveText) with several stacked paves.
Base class for several text objects.