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