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