Belle II Software development
run_eclGammaGammaE_collector.py
1#!/usr/bin/env python3
2
3
10
11# Usage: basf2 -i inputFile run_eclGammaGammaE_collector.py
12# option: basf2 -i inputFile run_eclGammaGammaE_collector.py OutputFile.root
13
14# Run just the collector part of the eclGammaGammaE calibration, which calibrates the single crystal
15# energy response using gamma gamma events.
16# Input file should be a gamma gamma skim (or MC) and include ECLDigits, ECLCalDigits, ECLClusters,
17# and tracks (to veto Bhabhas).
18# Output histograms are written to specified output file. Default is eclGammaGammaECollectorOutput.root
19# run_eclGammaGammaE_algorithm.py is then used to perform calibration using these histograms, or to simply copy
20# them to an output file.
21
22import sys
23import basf2 as b2
24
25
26main = b2.create_path()
27DR2 = '/ghi/fs01/belle2/bdata/users/karim/MC/DR2/release-01-00-00/gg/mdst/gg_0.root'
28main.add_module('RootInput', inputFileNames=[DR2])
29
30narg = len(sys.argv)
31outputName = "eclGammaGammaECollectorOutput.root"
32if(narg >= 2):
33 outputName = sys.argv[1]
34main.add_module("HistoManager", histoFileName=outputName)
35
36eclGammaGammaE = b2.register_module('eclGammaGammaECollector')
37eclGammaGammaE.param('thetaLabMinDeg', 0.)
38eclGammaGammaE.param('thetaLabMaxDeg', 180.)
39eclGammaGammaE.param('minPairMass', 9.)
40eclGammaGammaE.param('mindPhi', 179.)
41eclGammaGammaE.param('maxTime', 1.)
42# Can fill histograms with MC eclCalDigits to calculate true deposited energy
43eclGammaGammaE.param('measureTrueEnergy', False)
44eclGammaGammaE.param('requireL1', True)
45main.add_module(eclGammaGammaE)
46
47main.add_module('Progress')
48
49b2.set_log_level(b2.LogLevel.INFO)
50
51# It is possible to force the job to use the specified global tag.
52# Default localdb is the subdirectory of current working directory, but can be overwritten
53b2.reset_database()
54b2.use_database_chain()
55b2.use_central_database("development")
56b2.use_local_database("localdb/database.txt")
57
58b2.process(main)
59
60print(b2.statistics)