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