Belle II Software  release-08-01-10
CosmicsSimNoBkgTrackingVolume.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 <header>
14  <output>CosmicsSimNoBkgTrackingVolume.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  The particles are created on a cylinder of radius 125cm (right outside the tracking volume).
20  </description>
21 </header>
22 """
23 
24 from basf2 import create_path, statistics, set_random_seed, process
25 from simulation import add_simulation
26 from validation import statistics_plots, event_timing_plot
27 
28 set_random_seed(12345)
29 
30 main = create_path()
31 
32 # specify number of events to be generated
33 main.add_module(
34  "EventInfoSetter", evtNumList=[10000], runList=[1], expList=[1003]
35 )
36 
37 # Generate cosmic events. Note: with default settings the cosmics are
38 # generated on a cylinder of 125cm (closely outside the tracking valume)!
39 main.add_module("Cosmics")
40 
41 # detector simulation
42 add_simulation(main)
43 
44 # memory profile
45 main.add_module("Profile")
46 
47 # output
48 main.add_module(
49  "RootOutput", outputFileName="../CosmicsSimNoBkgTrackingVolume.root"
50 )
51 
52 main.add_module('Progress')
53 process(main)
54 
55 # Print call statistics
56 print(statistics)
57 
58 statistics_plots(
59  "CosmicsSimNoBkgTrackingVolume_statistics.root",
60  contact="Software team b2soft@mail.desy.de",
61  job_desc="a standard simulation job with Cosmics events",
62  prefix="CosmicsSimNoBkgTrackingVolume",
63 )
64 event_timing_plot(
65  "../CosmicsSimNoBkgTrackingVolume.root",
66  "CosmicsSimNoBkgTrackingVolume_statistics.root",
67  contact="Software team b2soft@mail.desy.de",
68  job_desc="a standard simulation job with Cosmics events",
69  prefix="CosmicsSimNoBkgTrackingVolume",
70 )