Belle II Software  release-08-01-10
SecondaryParticles.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 EvtGen events + all the secondary particles created by Geant4 in MCParticles.
16 """
17 
18 import basf2 as b2
19 
20 main = b2.create_path()
21 
22 # create 100 events
23 main.add_module("EventInfoSetter", evtNumList=[100])
24 
25 # using standard evtgen
26 main.add_module("EvtGenInput")
27 
28 # and parameters
29 main.add_module("Gearbox")
30 
31 # and the geometry
32 main.add_module("Geometry")
33 
34 # as well as the simulation, saving secondary particles with kinetic energy > 1.0 MeV.
35 main.add_module("FullSim", StoreAllSecondaries=True, SecondariesEnergyCut=1.0)
36 
37 # output
38 main.add_module("RootOutput", outputFileName="EvtGenSimNoBkgYesSecondaries.root")
39 
40 # run it
41 b2.process(main)
42 
43 # Print call statistics
44 print(b2.statistics)