Belle II Software development
T0Correction.py
1
8import re
9import datetime
10import basf2 as b2
11from ROOT import Belle2
12from ROOT import gSystem
13gSystem.Load('libcdc')
14
15b2.reset_database()
16b2.use_database_chain()
17b2.use_central_database("Calibration_Offline_Development", b2.LogLevel.INFO)
18
19d = datetime.datetime.today()
20print(d.strftime('This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
21
22rootdir = None
23param_dir = None
24t0_file = None
25
26with open('location') as file:
27 lines = file.readlines()
28 for line in lines:
29 if re.match(r'dir_root', line):
30 rootdir = line.split('"')[1]
31 if re.match(r'dir_params', line):
32 param_dir = line.split('"')[1]
33 if re.match(r't0_file', line):
34 t0_file = line.split('"')[1]
35 t0file = param_dir + t0_file
36
37inputfiles = rootdir + "/output_*"
38print(t0file)
39print(inputfiles)
40
41
42main = b2.create_path()
43main.add_module('EventInfoSetter',
44 evtNumList=[1],
45 runList=[1])
46main.add_module('Gearbox')
47main.add_module('CDCJobCntlParModifier',
48 T0InputType=False,
49 T0File=t0file)
50main.add_module('Geometry',
51 components=['CDC'])
52b2.process(main)
54Corr.inputFileNames(inputfiles)
55Corr.outputFileName("t0.dat")
56# Corr.InputFileNames("rootfile/output_cdc.*")
57Corr.storeHisto(True)
58Corr.setDebug(False)
59Corr.setUseDB(False)
60Corr.setMinimumNDF(10)
61Corr.setMinimumPval(0.)
62Corr.execute()
Class for T0 Correction .
Definition: T0Correction.h:21