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