Belle II Software development
SecondaryParticles.py
1#!/usr/bin/env python3
2
3
10
11"""
12This script saves all the secondary particles in MCParticles.
13
14Saves 100 EvtGen events + all the secondary particles created by Geant4 in MCParticles.
15"""
16
17import basf2 as b2
18
19main = b2.create_path()
20
21# create 100 events
22main.add_module("EventInfoSetter", evtNumList=[100])
23
24# using standard evtgen
25main.add_module("EvtGenInput")
26
27# and parameters
28main.add_module("Gearbox")
29
30# and the geometry
31main.add_module("Geometry")
32
33# as well as the simulation, saving secondary particles with kinetic energy > 1.0 MeV.
34main.add_module("FullSim", StoreAllSecondaries=True, SecondariesEnergyCut=1.0)
35
36# output
37main.add_module("RootOutput", outputFileName="EvtGenSimNoBkgYesSecondaries.root")
38
39# run it
40b2.process(main)
41
42# Print call statistics
43print(b2.statistics)