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