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