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