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