Belle II Software development
BabayagaNLOBhabhaSimRec.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <output>BabayagaNLOBhabhaSimRec.root</output>
14 <cacheable/>
15 <contact>arul.prakash@physik.uni-muenchen.de</contact>
16 <description>
17 This steering file produces 1000 radiative Bhabha events with
18 Babayaga.NLO, runs the detector simulation with mixed in background, and
19 performs the standard reconstruction.
20 </description>
21</header>
22"""
23
24from basf2 import set_random_seed, create_path, process, statistics
25from simulation import add_simulation
26from reconstruction import add_reconstruction
27from validation import statistics_plots, event_timing_plot
28from background import get_background_files
29
30set_random_seed(12345)
31
32main = create_path()
33emptypath = create_path()
34
35# specify number of events to be generated
36main.add_module("EventInfoSetter", evtNumList=[1000], runList=[1], expList=[0])
37
38# generate Bhabha events
39main.add_module("BabayagaNLOInput")
40
41# register the preselection module
42generatorpreselection = main.add_module("GeneratorPreselection")
43generatorpreselection.param(
44 {
45 "nChargedMin": 1,
46 "MinChargedP": 0.5,
47 "MinChargedPt": 0.1,
48 "MinChargedTheta": 16.5,
49 "MaxChargedTheta": 150.5,
50 "nPhotonMin": 1,
51 "MinPhotonEnergy": 0.5,
52 "MinPhotonTheta": 12.0,
53 "MaxPhotonTheta": 156.0,
54 }
55)
56generatorpreselection.if_value("<1", emptypath)
57
58# detector simulation
59add_simulation(main, bkgfiles=get_background_files())
60
61# reconstruction
62add_reconstruction(main)
63
64# memory profile
65main.add_module("Profile")
66
67# output
68main.add_module("RootOutput", outputFileName="../BabayagaNLOBhabhaSimRec.root")
69
70main.add_module('Progress')
71process(main)
72
73# Print call statistics
74print(statistics)
75
76statistics_plots(
77 "BabayagaNLOBhabhaSimRec_statistics.root",
78 contact="arul.prakash@physik.uni-muenchen.de",
79 job_desc="a standard simulation and reconstruction job with radiative "
80 "Bhabha events using Babayaga.NLO",
81 prefix="BabayagaNLOBhabhaSimRec",
82)
83event_timing_plot(
84 "../BabayagaNLOBhabhaSimRec.root",
85 "BabayagaNLOBhabhaSimRec_statistics.root",
86 contact="arul.prakash@physik.uni-muenchen.de",
87 job_desc="a standard simulation and reconstruction job with radiative "
88 "Bhabha events using Babayaga.NLO",
89 prefix="BabayagaNLOBhabhaSimRec",
90)