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