Belle II Software development
PairConversions.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
14Saves 100 EvtGen events + secondary e+ or e- from pair conversions created by Geant4 in MCParticles.
15The corresponding secondaryPhysicsProcess ID is 14, which is defined as fGammaConversion in G4EmProcessSubType.h.
16"""
17
18import basf2 as b2
19
20main = b2.create_path()
21
22# create 100 events
23main.add_module("EventInfoSetter", evtNumList=[100])
24
25# using standard evtgen
26main.add_module("EvtGenInput")
27
28# and parameters
29main.add_module("Gearbox")
30
31# and the geometry
32main.add_module("Geometry")
33
34# as well as the simulation, saving e+ or e- from pair conversions with kinetic energy > 10.0 MeV.
35main.add_module("FullSim", StorePairConversions=True, PairConversionsEnergyCut=10.0)
36
37# output
38main.add_module("RootOutput", outputFileName="EvtGenSimNoBkgYesPairConversions.root")
39
40# run it
41b2.process(main)
42
43# Print call statistics
44print(b2.statistics)