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