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