24 from caf
import backends
25 from caf.framework
import CAF
26 from basf2
import B2ERROR
27 from top_calibration
import module_alignment
31 globalTags = [
'Reco_master_patch',
'data_reprocessing_proc10']
33 data_dir =
'/group/belle2/dataprod/Data/OfficialReco/proc10/'
34 dimuon_skim_dir =
'offskim/offskim_mumutop/cdst/sub00'
35 bhabha_skim_dir =
'skim/hlt_bhabha/cdst/sub00'
36 main_output_dir =
'top_calibration'
37 default_sample =
'dimuon'
38 fixedParameters =
None
39 new_cdst_format =
False
46 print(
"usage: basf2", argvs[0],
"experiment runFirst runLast [sample]")
47 print(
" sample = dimuon/bhabha (D = dimuon)")
49 experiment = int(argvs[1])
50 run_first = int(argvs[2])
51 run_last = int(argvs[3])
52 sample = default_sample
57 if sample ==
'dimuon':
58 skim_dir = dimuon_skim_dir
59 elif sample ==
'bhabha':
60 skim_dir = bhabha_skim_dir
62 B2ERROR(
"Invalid sample name: " + sample)
67 expNo =
'e' +
'{:0=4d}'.format(experiment)
68 for run
in range(run_first, run_last + 1):
69 runNo =
'r' +
'{:0=5d}'.format(run)
70 filename = f
"{data_dir}/{expNo}/*/{runNo}/{skim_dir}/cdst*.root"
71 inputFiles += glob.glob(filename)
73 if len(inputFiles) == 0:
74 B2ERROR(
'No cdst files found in ' + data_dir +
' for exp=' + str(experiment) +
75 ' runFirst=' + str(run_first) +
' runLast=' + str(run_last) +
76 ' (skim_dir=' + skim_dir +
')')
80 run_range =
'r' +
'{:0=5d}'.format(run_first) +
'-' +
'{:0=5d}'.format(run_last)
81 output_dir = f
"{main_output_dir}/alignment-{sample}-{expNo}-{run_range}"
84 backend_args = {
"queue":
"l"}
85 cal = module_alignment(inputFiles, sample, fixedParameters,
86 globalTags, localDBs, new_cdst_format, backend_args)
90 cal_fw.add_calibration(cal)
91 cal_fw.output_dir = output_dir
92 cal_fw.backend = backends.LSF()