27 from ROOT
import Belle2
31 from basf2
import conditions
as b2conditions
46 print(
"Python arguments:")
50 counting = counting + 1
52 fileNames = [
'eclHadronTimeCalibrationValidationCollector.root']
55 fileNames = glob(sys.argv[1])
56 algo.setInputFileNames(fileNames)
60 basePath = sys.argv[2] +
"/"
61 print(
"basePath = ", basePath)
66 algo.meanCleanRebinFactor = 3
68 algo.meanCleanCutMinFactor = 0.4
71 set_log_level(LogLevel.INFO)
74 exprun_vector = algo.getRunListFromAllData()
76 baseName =
"eclHadronTValidationAlgorithm"
77 basePathAndName = basePath + baseName
78 algo.debugFilenameBase = basePathAndName
83 b2conditions.override_globaltags()
85 B2INFO(
"Adding Local Database {} to head of chain of local databases.")
86 b2conditions.prepend_testing_payloads(
"localdb/database.txt")
87 B2INFO(
"Using Global Tag {}")
88 b2conditions.prepend_globaltag(
"ECL_testingNewPayload_RefCrystalPerCrate")
89 b2conditions.prepend_globaltag(
"master_2020-05-13")
90 b2conditions.prepend_globaltag(
"online_proc11")
91 b2conditions.prepend_globaltag(
"data_reprocessing_proc11")
92 b2conditions.prepend_globaltag(
"Reco_master_patch_rel5")
96 print(
"Combining all runs' histograms for a single calibration")
97 print(
"path = ", basePathAndName)
98 alg_result = algo.execute()
99 print(
"Calibration completion status", alg_result)
100 if (alg_result == 0):
103 print(
"Calibrating each run individually")
104 runsWithoutEnoughData = []
105 for exprun
in exprun_vector:
106 iov_to_execute = ROOT.vector(
"std::pair<int,int>")()
107 iov_to_execute.push_back(exprun)
108 print(
"path = ", basePathAndName)
109 alg_result = algo.execute(iov_to_execute, 0)
110 print(
"Calibration success-result was", alg_result,
" (0=ok, 2=needs more data)")
111 if (alg_result == 0):
115 print(
"Summary of possible calibration completion status values:")
116 print(
" c_OK = Finished successfuly = 0 in Python")
117 print(
" c_Iterate, = Needs iteration = 1 in Python")
118 print(
" c_NotEnoughData, = Needs more data = 2 in Python")
119 print(
" c_Failure, = Failed = 3 in Python")
120 print(
" c_Undefined = Not yet known (before execution) = 4 in Python")