21from caf
import backends
22from caf.framework
import CAF
23from basf2
import B2ERROR
24from top_calibration
import photonYields_calibration
25from caf.strategies
import SingleIOV
29globalTags = [
'patch_main_release-08',
'patch_main_release-07_noTOP',
30 'data_reprocessing_proc13',
'online']
32data_dir =
'/gpfs/group/belle2/dataprod/Data/PromptReco/bucket16_calib/'
33bhabha_skim_dir =
'skim/bhabha_all_calib/cdst/sub00'
34dimuon_skim_dir =
'skim/mumutight_calib/cdst/sub00/'
35main_output_dir =
'top_calibration'
36default_sample =
'dimuon'
43 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample]")
44 print(
" sample = bhabha/dimuon (D = dimuon)")
46experiment = int(argvs[1])
47run_first = int(argvs[2])
48run_last = int(argvs[3])
49sample = default_sample
55 skim_dir = bhabha_skim_dir
56elif sample ==
'dimuon':
57 skim_dir = dimuon_skim_dir
59 B2ERROR(
"Invalid sample name: " + sample)
64expNo =
'e' + f
'{experiment:04d}'
65for run
in range(run_first, run_last + 1):
66 runNo =
'r' + f
'{run:05d}'
67 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
68 inputFiles += glob.glob(filename)
70if 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 +
')')
77run_range =
'r' + f
'{run_first:05d}' +
'-' + f
'{run_last:05d}'
78output_dir = f
"{main_output_dir}/photonYields-{sample}-{expNo}-{run_range}"
81cal = photonYields_calibration(inputFiles, sample, globalTags, localDBs)
82cal.strategies = SingleIOV
83cal.backend_args = {
"queue":
"s"}
87cal_fw.add_calibration(cal)
88cal_fw.output_dir = output_dir
89cal_fw.backend = backends.LSF()