Belle II Software  release-08-01-10
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 main.add_module('Progress')
50 process(main)
51 
52 # Print call statistics
53 print(statistics)
54 
55 statistics_plots(
56  "CosmicsSimNoBkg_statistics.root",
57  contact="Software team b2soft@mail.desy.de",
58  job_desc="a standard simulation job with Cosmics events",
59  prefix="CosmicsSimNoBkg",
60 )
61 event_timing_plot(
62  "../CosmicsSimNoBkg.root",
63  "CosmicsSimNoBkg_statistics.root",
64  contact="Software team b2soft@mail.desy.de",
65  job_desc="a standard simulation job with Cosmics events",
66  prefix="CosmicsSimNoBkg",
67 )