Belle II Software  release-08-01-10
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 main.add_module('Progress')
53 # memory profile
54 main.add_module("Profile")
55 
56 # output
57 main.add_module(
58  "RootOutput",
59  additionalBranchNames=["SpacePoints", "SVDSpacePoints"],
60  outputFileName="../EvtGenSimRec.root",
61 )
62 
63 process(main)
64 
65 # Print call statistics
66 print(statistics)
67 
68 statistics_plots(
69  "EvtGenSimRec_statistics.root",
70  contact="Software team b2soft@mail.desy.de",
71  job_desc="a standard simulation and reconstruction job with generic EvtGen events",
72  prefix="EvtGenSimRec",
73 )
74 event_timing_plot(
75  "../EvtGenSimRec.root",
76  "EvtGenSimRec_statistics.root",
77  contact="Software team b2soft@mail.desy.de",
78  job_desc="a standard simulation and reconstruction job with generic EvtGen events",
79  prefix="EvtGenSimRec",
80 )