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