Belle II Software  release-05-01-25
EvtGenSimRec.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 <header>
6  <output>EvtGenSimRec.root</output>
7  <cacheable/>
8  <contact>Software team b2soft@mail.desy.de</contact>
9  <description>This steering file produces 1000 generic BBbar events with EvtGen,
10  runs the detector simulation with mixed in background, and performs the standard reconstruction.</description>
11 </header>
12 """
13 
14 from basf2 import set_random_seed, create_path, process, statistics, \
15  set_nprocesses
16 from simulation import add_simulation
17 from L1trigger import add_tsim
18 from reconstruction import add_reconstruction
19 from validation import statistics_plots, event_timing_plot
20 from background import get_background_files
21 
22 set_random_seed(12345)
23 
24 # set one parallel process to excercise the basf2 parallel code
25 # set_nprocesses(1)
26 
27 main = create_path()
28 
29 # specify number of events to be generated
30 main.add_module('EventInfoSetter', evtNumList=[1000], runList=[1], expList=[0])
31 
32 # generate BBbar events
33 main.add_module('EvtGenInput')
34 
35 # detector simulation
36 add_simulation(main, bkgfiles=get_background_files())
37 
38 # trigger simulation
39 add_tsim(main)
40 
41 # reconstruction
42 add_reconstruction(main)
43 
44 # memory profile
45 main.add_module('Profile')
46 
47 # output
48 main.add_module(
49  'RootOutput',
50  additionalBranchNames=['SpacePoints', 'SVDSpacePoints'],
51  outputFileName='../EvtGenSimRec.root'
52 )
53 
54 process(main)
55 
56 # Print call statistics
57 print(statistics)
58 
59 statistics_plots(
60  'EvtGenSimRec_statistics.root',
61  contact='Software team b2soft@mail.desy.de',
62  job_desc='a standard simulation and reconstruction job with generic EvtGen events',
63  prefix='EvtGenSimRec'
64 )
65 event_timing_plot(
66  '../EvtGenSimRec.root', 'EvtGenSimRec_statistics.root',
67  contact='Software team b2soft@mail.desy.de',
68  job_desc='a standard simulation and reconstruction job with generic EvtGen events',
69  prefix='EvtGenSimRec'
70 )