21 from caf
import backends
22 from caf.framework
import CAF
23 from basf2
import B2ERROR
24 from top_calibration
import pulseHeight_calibration_rawdata
28 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
30 data_dir =
'/group/belle2/dataprod/Data/Raw'
31 main_output_dir =
'top_calibration'
38 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast")
40 experiment = int(argvs[1])
41 run_first = int(argvs[2])
42 run_last = int(argvs[3])
46 expNo =
'e' +
'{:0=4d}'.format(experiment)
47 for run
in range(run_first, run_last + 1):
48 runNo =
'r' +
'{:0=5d}'.format(run)
49 filename = f
"{data_dir}/{expNo}/{runNo}/sub00/physics.*.root"
50 inputFiles += glob.glob(filename)
52 if len(inputFiles) == 0:
53 B2ERROR(
'No rawdata files found in ' + data_dir +
' for exp=' + str(experiment) +
54 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last))
58 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
59 output_dir = f
"{main_output_dir}/pulseHeight-rawdata-{expNo}-{run_range}"
62 cal = pulseHeight_calibration_rawdata(inputFiles, globalTags, localDBs)
63 cal.backend_args = {
"queue":
"s"}
67 cal_fw.add_calibration(cal)
68 cal_fw.output_dir = output_dir
69 cal_fw.backend = backends.LSF()