22 from caf
import backends
23 from caf.framework
import CAF
24 from basf2
import B2ERROR
25 from top_calibration
import moduleT0_calibration_DeltaT, moduleT0_calibration_LL
29 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
31 data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
32 bhabha_skim_dir =
'skim/hlt_bhabha/cdst/sub00'
33 dimuon_skim_dir =
'offskim/offskim_mumutop/cdst/sub00'
34 main_output_dir =
'top_calibration'
35 default_sample =
'bhabha'
36 new_cdst_format =
False
43 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample]")
44 print(
" sample = bhabha/dimuon (D = bhabha)")
46 experiment = int(argvs[1])
47 run_first = int(argvs[2])
48 run_last = int(argvs[3])
49 sample = default_sample
54 if sample ==
'bhabha':
55 skim_dir = bhabha_skim_dir
56 elif sample ==
'dimuon':
57 skim_dir = dimuon_skim_dir
59 B2ERROR(
"Invalid sample name: " + sample)
64 expNo =
'e' +
'{:0=4d}'.format(experiment)
65 for run
in range(run_first, run_last + 1):
66 runNo =
'r' +
'{:0=5d}'.format(run)
67 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
68 inputFiles += glob.glob(filename)
70 if len(inputFiles) == 0:
71 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
72 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
73 ' (skim_dir=' + skim_dir +
')')
77 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
78 output_dir = f
"{main_output_dir}/moduleT0-{sample}-{expNo}-{run_range}"
81 cal1 = moduleT0_calibration_DeltaT(inputFiles, globalTags, localDBs, new_cdst_format)
82 cal2 = moduleT0_calibration_LL(inputFiles, sample, globalTags, localDBs, new_cdst_format)
83 cal1.backend_args = {
"queue":
"s"}
84 cal2.backend_args = {
"queue":
"s"}
89 cal_fw.add_calibration(cal1)
90 cal_fw.add_calibration(cal2)
91 cal_fw.output_dir = output_dir
92 cal_fw.backend = backends.LSF()