17 from caf
import backends
18 from caf.framework
import CAF
19 from basf2
import B2ERROR
20 from top_calibration
import moduleT0_calibration_DeltaT, moduleT0_calibration_LL
24 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
26 data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
27 bhabha_skim_dir =
'skim/hlt_bhabha/cdst/sub00'
28 dimuon_skim_dir =
'offskim/offskim_mumutop/cdst/sub00'
29 main_output_dir =
'top_calibration'
30 default_sample =
'bhabha'
31 new_cdst_format =
False
38 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample]")
39 print(
" sample = bhabha/dimuon (D = bhabha)")
41 experiment = int(argvs[1])
42 run_first = int(argvs[2])
43 run_last = int(argvs[3])
44 sample = default_sample
49 if sample ==
'bhabha':
50 skim_dir = bhabha_skim_dir
51 elif sample ==
'dimuon':
52 skim_dir = dimuon_skim_dir
54 B2ERROR(
"Invalid sample name: " + sample)
59 expNo =
'e' +
'{:0=4d}'.format(experiment)
60 for run
in range(run_first, run_last + 1):
61 runNo =
'r' +
'{:0=5d}'.format(run)
62 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
63 inputFiles += glob.glob(filename)
65 if len(inputFiles) == 0:
66 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
67 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
68 ' (skim_dir=' + skim_dir +
')')
72 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
73 output_dir = f
"{main_output_dir}/moduleT0-{sample}-{expNo}-{run_range}"
76 cal1 = moduleT0_calibration_DeltaT(inputFiles, globalTags, localDBs, new_cdst_format)
77 cal2 = moduleT0_calibration_LL(inputFiles, sample, globalTags, localDBs, new_cdst_format)
78 cal1.backend_args = {
"queue":
"s"}
79 cal2.backend_args = {
"queue":
"s"}
84 cal_fw.add_calibration(cal1)
85 cal_fw.add_calibration(cal2)
86 cal_fw.output_dir = output_dir