Belle II Software  release-06-02-00
EvtGenSimRecLarge.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <contact>Software team b2soft@mail.desy.de</contact>
15  <output>EvtGenSimRecLarge.root</output>
16  <description>
17  This steering file produces 10000 generic BBbar events with
18  EvtGen, runs the detector simulation with mixed in background, and performs
19  the standard reconstruction. It will only be run for release validation in
20  order to test the software on a larger set of events to be more closer to
21  the typical runtime on a grid site.
22  </description>
23  <interval>release</interval>
24 </header>
25 """
26 
27 from basf2 import (
28  set_random_seed,
29  create_path,
30  process,
31  statistics,
32  register_module,
33 )
34 from simulation import add_simulation
35 from reconstruction import add_reconstruction
36 from beamparameters import add_beamparameters
37 from background import get_background_files
38 from validation import statistics_plots, event_timing_plot
39 
40 set_random_seed(12345)
41 
42 main = create_path()
43 
44 # specify number of events to be generated
45 eventinfosetter = register_module("EventInfoSetter")
46 # will roughly run for 10 hours
47 eventinfosetter.param("evtNumList", [40000])
48 eventinfosetter.param("runList", [1])
49 eventinfosetter.param("expList", [0])
50 main.add_module(eventinfosetter)
51 
52 # beam parameters
53 beamparameters = add_beamparameters(main, "Y4S")
54 # beamparameters.param("smearVertex", False)
55 
56 # generate BBbar events
57 evtgeninput = register_module("EvtGenInput")
58 main.add_module(evtgeninput)
59 
60 # detector and L1 trigger simulation
61 add_simulation(main, bkgfiles=get_background_files())
62 
63 # reconstruction
64 add_reconstruction(main)
65 
66 # memory profile
67 main.add_module(register_module("Profile"))
68 
69 # do not output to save storage space
70 process(main)
71 
72 # Print call statistics
73 print(statistics)
74 
75 statistics_plots(
76  "EvtGenSimRecLarge_statistics.root",
77  contact="Software team b2soft@mail.desy.de",
78  job_desc="a standard simulation and reconstruction job with generic "
79  "EvtGen events",
80  prefix="EvtGenSimRecLarge",
81 )
82 event_timing_plot(
83  "../EvtGenSimRecLarge.root",
84  "EvtGenSimRecLarge_statistics.root",
85  contact="Software team b2soft@mail.desy.de",
86  job_desc="a standard simulation and reconstruction job with generic "
87  "EvtGen events",
88  prefix="EvtGenSimRecLarge",
89 )