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