21from caf
import backends
22from caf.framework
import CAF
23from basf2
import B2ERROR
24from top_calibration
import calibration_validation
28globalTags = [
'data_reprocessing_prompt',
'dp_recon_release6_patch',
'online']
30data_dir =
'/gpfs/group/belle2/dataprod/Data/PromptReco/bucket16_calib/'
31bhabha_skim_dir =
'skim/bhabha_all_calib/cdst/sub00/'
32dimuon_skim_dir =
'skim/mumutight_calib/cdst/sub00'
33main_output_dir =
'top_calibration'
34default_sample =
'dimuon'
42 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample]")
43 print(
" sample = bhabha/dimuon (D = dimuon)")
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}/validation-{sample}-{expNo}-{run_range}"
80cal = calibration_validation(inputFiles, sample, globalTags, localDBs, new_cdst_format)
81cal.backend_args = {
"queue":
"s"}
85cal_fw.add_calibration(cal)
86cal_fw.output_dir = output_dir
87cal_fw.backend = backends.LSF()