Belle II Software  release-08-01-10
EvtGenSimNoBkg.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <output>EvtGenSimNoBkg.root</output>
15  <contact>Software team b2soft@mail.desy.de</contact>
16  <cacheable/>
17  <description>This steering file produces 1000 generic BBbar events with EvtGen
18  and runs the detector simulation without mixing in background.</description>
19 </header>
20 """
21 
22 from basf2 import (
23  set_random_seed,
24  create_path,
25  process,
26  statistics,
27  register_module,
28 )
29 from simulation import add_simulation
30 from beamparameters import add_beamparameters
31 from validation import statistics_plots, event_timing_plot
32 
33 set_random_seed(12345)
34 
35 main = create_path()
36 
37 # specify number of events to be generated
38 eventinfosetter = register_module("EventInfoSetter")
39 eventinfosetter.param("evtNumList", [1000])
40 eventinfosetter.param("runList", [1])
41 eventinfosetter.param("expList", [0])
42 main.add_module(eventinfosetter)
43 
44 # beam parameters
45 beamparameters = add_beamparameters(main, "Y4S")
46 # beamparameters.param("smearVertex", False)
47 
48 # generate BBbar events
49 evtgeninput = register_module("EvtGenInput")
50 main.add_module(evtgeninput)
51 
52 # detector and L1 trigger simulation, no background files
53 add_simulation(main)
54 
55 # memory profile
56 main.add_module(register_module("Profile"))
57 
58 # output
59 output = register_module("RootOutput")
60 output.param("outputFileName", "../EvtGenSimNoBkg.root")
61 main.add_module(output)
62 
63 main.add_module('Progress')
64 process(main)
65 
66 # Print call statistics
67 print(statistics)
68 
69 statistics_plots(
70  "EvtGenSimNoBkg_statistics.root",
71  contact="Software team b2soft@mail.desy.de",
72  job_desc="a standard simulation job with generic EvtGen events",
73  prefix="EvtGenSimNoBkg",
74 )
75 event_timing_plot(
76  "../EvtGenSimNoBkg.root",
77  "EvtGenSimNoBkg_statistics.root",
78  contact="Software team b2soft@mail.desy.de",
79  job_desc="a standard simulation job with generic EvtGen events",
80  prefix="EvtGenSimNoBkg",
81 )