Belle II Software  release-08-00-04
cosmicsExtrapolationReconstruction.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 <header>
13  <contact>software-tracking@belle2.org</contact>
14  <input>CosmicsSimNoBkg.root</input>
15  <output>CosmicsExtrapolation.root</output>
16  <description>Validation of cosmic track extrapolation.</description>
17 </header>
18 """
19 
20 import basf2
21 from reconstruction import add_cosmics_reconstruction
22 
23 basf2.set_random_seed(12345)
24 
25 main = basf2.create_path()
26 
27 # Input.
28 main.add_module('RootInput', inputFileName='../CosmicsSimNoBkg.root')
29 
30 # Extrapolation. Tracks are not merged (otherwise, many backward-extrapolated
31 # tracks are removed).
32 main.add_module('Gearbox')
33 main.add_module('Geometry')
34 add_cosmics_reconstruction(main, merge_tracks=False)
35 
36 # Output.
37 output = basf2.register_module('RootOutput')
38 output.param('outputFileName', '../CosmicsExtrapolation.root')
39 output.param('branchNames', ['ExtHits', 'KLMHit2ds',
40  'MCParticles', 'Tracks', 'TrackFitResults'])
41 main.add_module(output)
42 
43 # Process the path.
44 basf2.process(main, max_event=1000)