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