Belle II Software  release-06-01-15
CosmicsSimNoBkg.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <output>CosmicsSimNoBkg.root</output>
15  <contact>Software team b2soft@mail.desy.de</contact>
16  <cacheable/>
17  <description>
18  This steering file produces 10000 cosmic ray events without background, for the early_phase3 geometry.
19  </description>
20 </header>
21 """
22 
23 from basf2 import create_path, statistics, set_random_seed, process
24 from simulation import add_simulation
25 from validation import statistics_plots, event_timing_plot
26 
27 set_random_seed(12345)
28 
29 main = create_path()
30 
31 # specify number of events to be generated
32 main.add_module(
33  "EventInfoSetter", evtNumList=[10000], runList=[1], expList=[1003]
34 )
35 
36 # Generate cosmic events.
37 # Set initial radius to 350 cm to include KLM (excluded by default).
38 main.add_module("Cosmics", cylindricalR=350)
39 
40 # detector simulation
41 add_simulation(main)
42 
43 # memory profile
44 main.add_module("Profile")
45 
46 # output
47 main.add_module("RootOutput", outputFileName="../CosmicsSimNoBkg.root")
48 
49 process(main)
50 
51 # Print call statistics
52 print(statistics)
53 
54 statistics_plots(
55  "CosmicsSimNoBkg_statistics.root",
56  contact="Software team b2soft@mail.desy.de",
57  job_desc="a standard simulation job with Cosmics events",
58  prefix="CosmicsSimNoBkg",
59 )
60 event_timing_plot(
61  "../CosmicsSimNoBkg.root",
62  "CosmicsSimNoBkg_statistics.root",
63  contact="Software team b2soft@mail.desy.de",
64  job_desc="a standard simulation job with Cosmics events",
65  prefix="CosmicsSimNoBkg",
66 )