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