Belle II Software development
SpaceResol.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)
19
20b2.logging.log_level = b2.LogLevel.INFO
21b2.set_debug_level(200)
22
23d = datetime.datetime.today()
24print(d.strftime('This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
25
26# For file name
27rootdir = None
28param_dir = None
29sigma_file = None
30with open('location') as file:
31 lines = file.readlines()
32 for line in lines:
33 if re.match(r'dir_root', line):
34 rootdir = line.split('"')[1]
35 if re.match(r'dir_params', line):
36 param_dir = line.split('"')[1]
37 if re.match(r'sigma_file', line):
38 sigma_file = line.split('"')[1]
39 sigmafile = param_dir + sigma_file
40print(sigmafile)
41rootfile = rootdir + "/output_*"
42# rootfile="rootfile_finalMapper_newSigma/output_*"
43
44main = b2.create_path()
45main.add_module('EventInfoSetter',
46 evtNumList=[1],
47 runList=[1])
48main.add_module('Gearbox')
49main.add_module('Geometry',
50 components=['CDC'])
51
52b2.process(main)
53
55fit.inputFileNames(rootfile)
56fit.ProfileFileNames("sigma_profile.dat")
57fit.useProfileFromInputSigma(False)
58fit.setSigmaFileName(sigmafile)
59fit.setStoreHisto(True)
60fit.setDebug(False)
61fit.setUseDB(False)
62fit.setMinimumNDF(30)
63fit.setBinWidth(0.05)
64fit.setMinimumPval(0.001)
65fit.execute()
Class for Space resolution calibration.