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