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