20from caf
import backends
21from caf.framework
import CAF
22from basf2
import B2ERROR
23from top_calibration
import moduleT0_calibration_cosmics
27globalTags = [
'patch_main_release-08',
28 'patch_main_release-07_noTOP',
29 'data_reprocessing_prompt',
32data_dir =
'/gpfs/group/belle2/dataprod/Data/PromptSkim'
33skim_dir =
'skim/cosmic_calib'
36main_output_dir =
'top_calibration'
43 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
45experiment = int(argvs[1])
46run_first = int(argvs[2])
47run_last = int(argvs[3])
51expNo =
'e' + f
'{experiment:04d}'
52for run
in range(run_first, run_last + 1):
53 runNo =
'r' + f
'{run:05d}'
54 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/{data_format}/sub00/*.root"
55 inputFiles += glob.glob(filename)
57if len(inputFiles) == 0:
58 B2ERROR(
'No files found in ' + data_dir +
' for exp=' + str(experiment) +
59 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
60 ' (skim_dir=' + skim_dir +
')')
64run_range =
'r' + f
'{run_first:05d}' +
'-' + f
'{run_last:05d}'
65output_dir = f
"{main_output_dir}/moduleT0-cosmics-{expNo}-{run_range}"
68cal = moduleT0_calibration_cosmics(inputFiles, globalTags, localDBs, data_format, full_reco)
69if data_format ==
'raw' or full_reco:
70 cal.backend_args = {
"queue":
"l"}
72 cal.backend_args = {
"queue":
"s"}
76cal_fw.add_calibration(cal)
77cal_fw.output_dir = output_dir
78cal_fw.backend = backends.LSF()