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