22from caf
import backends
23from caf.framework
import CAF
24from basf2
import B2ERROR
25from top_calibration
import commonT0_calibration_BF, commonT0_calibration_LL
29globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
31data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
32bhabha_skim_dir =
'skim/hlt_bhabha/cdst/sub00'
33dimuon_skim_dir =
'offskim/offskim_mumutop/cdst/sub00'
34main_output_dir =
'top_calibration'
35default_sample =
'bhabha'
37new_cdst_format =
False
44 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample method]")
45 print(
" sample = bhabha/dimuon (D = bhabha)")
46 print(
" method = BF/LL (D = BF)")
48experiment = int(argvs[1])
49run_first = int(argvs[2])
50run_last = int(argvs[3])
51sample = default_sample
52method = default_method
61 skim_dir = bhabha_skim_dir
62elif sample ==
'dimuon':
63 skim_dir = dimuon_skim_dir
65 B2ERROR(
"Invalid sample name: " + sample)
70expNo =
'e' + f
'{experiment:04d}'
71for run
in range(run_first, run_last + 1):
72 runNo =
'r' + f
'{run:05d}'
73 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
74 inputFiles += glob.glob(filename)
76if len(inputFiles) == 0:
77 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
78 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
79 ' (skim_dir=' + skim_dir +
')')
83run_range =
'r' + f
'{run_first:05d}' +
'-' + f
'{run_last:05d}'
84output_dir = f
"{main_output_dir}/commonT0-{sample}-{method}-{expNo}-{run_range}"
88 cal = commonT0_calibration_BF(inputFiles, globalTags, localDBs, new_cdst_format)
90 cal = commonT0_calibration_LL(inputFiles, sample, globalTags, localDBs, new_cdst_format)
92 B2ERROR(
'Invalid method name: ' + method)
94cal.backend_args = {
"queue":
"s"}
98cal_fw.add_calibration(cal)
99cal_fw.output_dir = output_dir
100cal_fw.backend = backends.LSF()