Belle II Software  release-05-01-25
SecondaryParticles2.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 This script saves all the secondary particles in MCParticles.
6 
7 <header>
8  <contact>dorisykim@ssu.ac.kr</contact>
9  <description>
10  Saves 100 generic BBbar events with EvtGen + all the secondary particles created by Geant4 in MCParticles.
11  The detector simulation mixed with background, trigger simulation, and standard reconstruction is done.
12  </description>
13 </header>
14 """
15 
16 from basf2 import *
17 from simulation import add_simulation
18 from L1trigger import add_tsim
19 from reconstruction import add_reconstruction
20 from background import get_background_files
21 
22 set_random_seed(12345)
23 
24 
25 main = create_path()
26 
27 # specify number of events to be generated
28 main.add_module('EventInfoSetter', evtNumList=[100], runList=[1], expList=[1])
29 
30 # generate BBbar events
31 main.add_module('EvtGenInput')
32 
33 # detector simulation
34 add_simulation(main, bkgfiles=get_background_files())
35 
36 # saving secondary particles with kinetic energy > 1.0 MeV.
37 set_module_parameters(main, "FullSim", StoreAllSecondaries=True, SecondariesEnergyCut=1.0)
38 
39 # trigger simulation
40 add_tsim(main)
41 
42 # reconstruction
43 add_reconstruction(main)
44 
45 # output
46 main.add_module("RootOutput", outputFileName="EvtGenSimRecYesSecondaries.root")
47 
48 
49 process(main)
50 
51 # Print call statistics
52 print(statistics)