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