Logo ROOT  
Reference Guide
na49visible.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_pyroot
3## Set visibility attributes for the NA49 geometry
4## Set Shape attributes
5##
6## \macro_code
7##
8## \author Wim Lavrijsen
9
10import ROOT
11
12ROOT.YK01.SetVisibility( 0 )
13ROOT.YK03.SetLineColor( 2 )
14ROOT.YK04.SetLineColor( 5 )
15ROOT.SEC1.SetLineColor( 6 )
16ROOT.SEC2.SetLineColor( 6 )
17ROOT.SEC3.SetLineColor( 3 )
18ROOT.SEC4.SetLineColor( 3 )
19ROOT.TOFR.SetLineColor( 5 )
20ROOT.COI1.SetLineColor( 4 )
21ROOT.COI2.SetLineColor( 4 )
22ROOT.COI3.SetLineColor( 4 )
23ROOT.COI4.SetLineColor( 4 )
24ROOT.CS38.SetLineColor( 5 )
25ROOT.CS28.SetLineColor( 5 )
26ROOT.CS18.SetLineColor( 5 )
27ROOT.TF4D.SetLineColor( 3 )
28ROOT.OGB4.SetLineColor( 3 )
29ROOT.TF3D.SetLineColor( 3 )
30ROOT.OGB3.SetLineColor( 3 )
31ROOT.TF4A.SetLineColor( 3 )
32ROOT.OGB4.SetLineColor( 3 )
33ROOT.TF3A.SetLineColor( 3 )
34ROOT.OGB3.SetLineColor( 3 )
35
36# Copy shape attributes (colors,etc) in nodes referencing the shapse
37CAVE1 = ROOT.gGeometry.FindObject( 'CAVE1' )
38CAVE1.ImportShapeAttributes( )
39
40# Set Node attributes
41CAVE1.SetVisibility( 2 ) # node is not drawn but its sons are drawn
42ROOT.gGeometry.FindObject( 'VT1_1' ).SetVisibility( -4 ) # Node is not drawn.
43 # Its immediate sons are drawn
44ROOT.gGeometry.FindObject( 'VT2_1' ).SetVisibility( -4 )
45ROOT.gGeometry.FindObject( 'MTL_1' ).SetVisibility( -4 )
46ROOT.gGeometry.FindObject( 'MTR_1' ).SetVisibility( -4 )
47ROOT.gGeometry.FindObject( 'TOFR1' ).SetVisibility( -4 )
48