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