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