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