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