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