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