ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
na49view.py
Go to the documentation of this file.
1 #
2 # This macro generates
3 # a begin_html <a href="gif/na49canvas.gif">Canvas</a> end_html
4 # with 2 views of the NA49 detector.
5 #
6 
7 import ROOT
8 
9 c1 = ROOT.TCanvas( 'c1', 'The NA49 canvas', 200, 10, 700, 780 )
10 
11 ROOT.gBenchmark.Start( 'na49view' )
12 
13 all = ROOT.TPad( 'all', 'A Global view of NA49', 0.02, 0.02, 0.48, 0.82, 28 )
14 tof = ROOT.TPad( 'tof', 'One Time Of Flight element', 0.52, 0.02, 0.98, 0.82, 28 )
15 all.Draw();
16 tof.Draw();
17 na49title = ROOT.TPaveLabel( 0.04, 0.86, 0.96, 0.98, 'Two views of the NA49 detector' )
18 na49title.SetFillColor( 32 )
19 na49title.Draw()
20 #
21 nageom = ROOT.TFile( 'py-na49.root' )
22 n49 = ROOT.gROOT.FindObject( 'na49' )
23 n49.SetBomb( 1.2 )
24 n49.cd() # Set current geometry
25 all.cd() # Set current pad
26 n49.Draw()
27 c1.Update()
28 tof.cd()
29 TOFR1 = n49.GetNode( 'TOFR1' )
30 TOFR1.Draw()
31 c1.Update()
32 
33 ROOT.gBenchmark.Show( 'na49view' )
34 
35 # To have a better and dynamic view of any of these pads,
36 # you can click with the middle button of your mouse to select it.
37 # Then select "View with x3d" in the VIEW menu of the Canvas.
38 # Once in x3d, you are in wireframe mode by default.
39 # You can switch to:
40 # - Hidden Line mode by typing E
41 # - Solid mode by typing R
42 # - Wireframe mode by typing W
43 # - Stereo mode by clicking S (and you need special glasses)
44 # - To leave x3d type Q