Belle II Software  release-08-01-10
tsim_subdetectors.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # The example of running simulation of subdetectors trigger.
13 # basf2 tsim_subdetectors.py -o outputrootfile
14 
15 import basf2 as b2
16 from simulation import add_simulation
17 from L1trigger import add_subdetector_tsim
18 
19 
20 main = b2.create_path()
21 eventinfosetter = b2.register_module('EventInfoSetter')
22 eventinfosetter.param({'evtNumList': [10], 'runList': [1]})
23 main.add_module(eventinfosetter)
24 
25 babayaganlo = b2.register_module('BabayagaNLOInput')
26 babayaganlo.param('FMax', 7.5e4)
27 babayaganlo.param('FinalState', 'ee')
28 babayaganlo.param('MaxAcollinearity', 180.0)
29 babayaganlo.param('ScatteringAngleRange', [15.0, 165.0])
30 # babayaganlo.param('VacuumPolarization', 'hadr5')
31 babayaganlo.param('VacuumPolarization', 'hlmnt')
32 babayaganlo.param('SearchMax', 10000)
33 babayaganlo.param('VPUncertainty', True)
34 main.add_module(babayaganlo)
35 
36 # add simulation
37 add_simulation(main)
38 
39 # add trigger simlation of sub detectors (CDC, ECL, and bKLM are included currently)
40 add_subdetector_tsim(main, component=["CDC", "ECL", "KLM"])
41 
42 branches = [
43  'EventMetaData',
44  'TRGCDC2DFinderTracks',
45  'TRGCDC2DFitterTracks',
46  'TRGCDC3DFitterTracks',
47  'TRGCDCNeuroTracks',
48  'TRGECLClusters',
49  'TRGECLClustersToTRGCDC2DFinderTracks',
50  'TRGECLClustersToTRGCDCNeuroTracks',
51  'TRGECLTrgs',
52  'TRGKLMHits',
53  'TRGKLMTracks'
54 ]
55 branches += ['MCParticles']
56 # output
57 main.add_module('RootOutput', branchNames=branches)
58 
59 
60 # main
61 b2.process(main)
62 print(b2.statistics)
63 # ===<END>