Belle II Software development
0_dedxPID_ParticleGun.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <input>PartGunChargedStableGenSim.root</input>
14 <output>ParticleGunSimRec_dedx.root</output>
15 <description>Generates dE/dx debug data (DedxTracks) for testing</description>
16 <contact>renu2@andrew.cmu.edu</contact>
17</header>
18"""
19
20import basf2
21from reconstruction import add_reconstruction
22
23main = basf2.create_path()
24
25# Read input.
26inputFileName = "../PartGunChargedStableGenSim.root"
27main.add_module("RootInput", inputFileName=inputFileName)
28
29# Load parameters.
30main.add_module("Gearbox")
31# Create geometry.
32main.add_module("Geometry")
33
34# Reconstruct events.
35add_reconstruction(main)
36
37# enable debug output for the module added by add_reconstruction()
38for m in main.modules():
39 if m.name() == 'CDCDedxPID':
40 m.param('enableDebugOutput', True)
41
42
43output = basf2.register_module('RootOutput')
44output.param('outputFileName', '../ParticleGunSimRec_dedx.root')
45# let's keep this small
46output.param('branchNames', ['CDCDedxLikelihoods', 'CDCDedxTracks', 'VXDDedxLikelihoods', 'VXDDedxTracks', 'EventMetaData'])
47main.add_module(output)
48
49main.add_module("ProgressBar")
50
51basf2.process(main)
52print(basf2.statistics)