Belle II Software development
XTFit.py
1
8import datetime
9import re
10import basf2 as b2
11from ROOT import Belle2
12from ROOT import gSystem
13gSystem.Load('libcdc')
14# gSystem.SetBatch(1);
15
16b2.reset_database()
17b2.use_database_chain()
18b2.use_central_database("Calibration_Offline_Development", b2.LogLevel.INFO)
19b2.logging.log_level = b2.LogLevel.INFO
20b2.set_debug_level(200)
21
22d = datetime.datetime.today()
23print(d.strftime('This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
24
25rootdir = None
26param_dir = None
27xt_file = None
28
29with open('location') as file:
30 lines = file.readlines()
31 for line in lines:
32 if re.match(r'dir_root', line):
33 rootdir = line.split('"')[1]
34 if re.match(r'dir_params', line):
35 param_dir = line.split('"')[1]
36 if re.match(r'xt_file', line):
37 xt_file = line.split('"')[1]
38
39xtfile = param_dir + xt_file
40rootfile = rootdir + "/output_*"
41
42main = b2.create_path()
43main.add_module('EventInfoSetter',
44 evtNumList=[1],
45 runList=[1])
46b2.process(main)
47
49fit.inputFileNames(rootfile)
50fit.profileFileNames("xt_profile.dat")
51fit.useProfileFromInputXT(False)
52fit.setXTFileName(xtfile)
53# fit.setUseSliceFit(False);
54fit.setStoreHisto(True)
55fit.setDebug(False)
56fit.setUseDB(False)
57fit.setMinimumNDF(30)
58fit.setMinimumPval(0.0001)
59fit.execute()
Class to perform xt calibration for drift chamber.
Definition: XTCalibration.h:21