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