Belle II Software development
run_ee5x5_collector_mc.py
1#!/usr/bin/env python3
2
3
10
11# Usage: basf2 -i inputFile run_ee5x5_collector_mc.py
12# option: basf2 -i inputFile run_ee5x5_collector_mc.py OutputFile.root
13
14# Run the collector part of the eclee5x5 calibration, which calibrates the single crystal
15# energy response using Bhabha events.
16
17# This script sets parameters appropriate for mc. Use run_ee5x5_collector_data.py for data
18
19# Input file should be cdst file, including ECLDigits, ECLCalDigits, and clusters
20# Output histograms are written to specified output file.
21
22# run_ee5x5_algorithm_XXX.py is then used to find payloads or output merged histograms.
23
24import sys
25import basf2 as b2
26
27
28main = b2.create_path()
29DR2 = '/ghi/fs01/belle2/bdata/users/karim/MC/DR2/release-02-01-00/eegamma/cdst/eegamma_1.root'
30main.add_module('RootInput', inputFileNames=[DR2])
31
32narg = len(sys.argv)
33outputName = "ee5x5CollectorOutput_mc.root"
34if(narg >= 2):
35 outputName = sys.argv[1]
36main.add_module("HistoManager", histoFileName=outputName)
37
38eclee5x5 = b2.register_module('eclee5x5Collector')
39eclee5x5.param('thetaLabMinDeg', 17.)
40eclee5x5.param('thetaLabMaxDeg', 150.)
41eclee5x5.param('minE0', 0.45)
42eclee5x5.param('minE1', 0.40)
43eclee5x5.param('maxdThetaSum', 2.)
44eclee5x5.param('dPhiScale', 1.)
45eclee5x5.param('maxTime', 10.)
46# Can fill histograms with eclCalDigits to calculate deposited energy using MC
47eclee5x5.param('useCalDigits', True)
48eclee5x5.param('requireL1', False)
49main.add_module(eclee5x5)
50
51main.add_module('Progress')
52
53b2.set_log_level(b2.LogLevel.INFO)
54
55# Force the job to use the global tag for offline calibration.
56# Default localdb is the subdirectory of current working directory, but can be overwritten
57b2.reset_database()
58b2.use_database_chain()
59b2.use_central_database("Calibration_Offline_Development")
60b2.use_local_database("localdb/database.txt")
61
62b2.process(main)
63
64print(b2.statistics)