Belle II Software  release-08-01-10
display_cdc.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 #
13 # Opens a .root file and shows MCParticles,
14 # SimHits and GFTracks using the Display module.
15 # Usage:
16 # basf2 display/example/display.py -i MyInputFile.root
17 #
18 # Note: this file is also used by the 'b2display' command,
19 # so the following is also possible:
20 # b2display MyInputFile.root
21 #
22 # If you want custom settings for b2display, you thus only need to
23 # edit this steering file.
24 
25 import basf2 as b2
26 
27 # create paths
28 main = b2.create_path()
29 
30 rootinput = b2.register_module('RootInput')
31 # rootinput = register_module('SeqRootInput')
32 # no input file set, use -i
33 
34 # create geometry
35 gearbox = b2.register_module('Gearbox')
36 geometry = b2.register_module('Geometry')
37 # Since Geometry is only required for track extrapolation in inner detectors,
38 # we'll exclude ECL (saves about 10s in startup time)
39 # geometry.param('excludedComponents', ['ECL','CDC','PXD','SVD','EKLM','ARICH','BKLM'])
40 geometry.param('components', ['TOP'])
41 
42 main.add_module(rootinput)
43 main.add_module(gearbox)
44 main.add_module(geometry)
45 
46 display = b2.register_module('Display')
47 
48 # The options parameter is a combination of:
49 # D draw detectors - draw simple detector representation (with different size)
50 # for each hit
51 # H draw track hits
52 # M draw track markers - intersections of track with detector planes
53 # P draw detector planes
54 # S scale manually - spacepoint hits are drawn as spheres and scaled with
55 # errors
56 #
57 # Note that you can always turn off an individual detector component or track
58 # interactively by removing its checkmark in the 'Eve' tab.
59 #
60 # only makes sense when showTrackLevelObjects/showTrackCandidates is used
61 display.param('options', 'MH') # default
62 
63 # should hits always be assigned to a particle with c_PrimaryParticle flag?
64 display.param('assignHitsToPrimaries', False)
65 display.param('showMCInfo', False)
66 
67 # show all primary MCParticles?
68 # display.param('showAllPrimaries', True)
69 
70 # show all charged MCParticles? (SLOW)
71 # display.param('showCharged', True)
72 
73 # show all neutral MCParticles? (SLOW)
74 # display.param('showNeutrals', True)
75 
76 # show tracks, vertices, eclgammas?
77 display.param('showTrackLevelObjects', True)
78 
79 # show track candidates?
80 # You most likely don't want this unless you are a tracking developer
81 display.param('showTrackCandidates', True)
82 # If showTrackCandidates is true, you can set this option to switch between
83 # PXD/SVDClusters and PXD/SVDTrueHits
84 # display.param('useClusters', True)
85 display.param('useClusters', False)
86 
87 # save events non-interactively (without showing window)?
88 display.param('automatic', False)
89 
90 # change to True to show the full TGeo geometry instead of simplified extract
91 # display.param('fullGeometry', True)
92 display.param('fullGeometry', False)
93 # Show CDCHits.
94 display.param('showCDCHits', True)
95 
96 main.add_module(display)
97 
98 b2.process(main)
99 # print statistics(statistics.INIT)