34 from ROOT
import Belle2
38 from basf2
import conditions
as b2conditions
53 print(
"Python arguments:")
57 counting = counting + 1
59 fileNames = [
'eclBhabhaTCollector.root']
62 fileNames = glob(sys.argv[1])
63 algo.setInputFileNames(fileNames)
67 basePath = sys.argv[2] +
"/"
68 print(
"basePath = ", basePath)
73 algo.debugOutput =
True
74 algo.meanCleanRebinFactor = 3
76 algo.meanCleanCutMinFactor = 0.3
79 algo.debugFilenameBase =
"eclBhabhaTAlgorithm"
95 set_log_level(LogLevel.INFO)
98 exprun_vector = algo.getRunListFromAllData()
100 baseName =
"eclBhabhaTAlgorithm"
101 basePathAndName = basePath + baseName
102 algo.debugFilenameBase = basePathAndName
107 b2conditions.override_globaltags()
109 B2INFO(
"Adding Local Database {} to head of chain of local databases.")
110 b2conditions.prepend_testing_payloads(
"localdb/database.txt")
111 B2INFO(
"Using Global Tag {}")
112 b2conditions.prepend_globaltag(
"ECL_testingNewPayload_RefCrystalPerCrate")
113 b2conditions.prepend_globaltag(
"master_2020-05-13")
114 b2conditions.prepend_globaltag(
"online_proc11")
115 b2conditions.prepend_globaltag(
"data_reprocessing_proc11")
116 b2conditions.prepend_globaltag(
"Reco_master_patch_rel5")
120 print(
"Combining all runs' histograms for a single calibration")
121 print(
"path = ", basePathAndName)
122 alg_result = algo.execute()
123 print(
"Calibration completion status", alg_result)
124 if (alg_result == 0):
127 print(
"Calibrating each run individually")
128 runsWithoutEnoughData = []
129 for exprun
in exprun_vector:
130 iov_to_execute = ROOT.vector(
"std::pair<int,int>")()
131 iov_to_execute.push_back(exprun)
132 print(
"path = ", basePathAndName)
133 alg_result = algo.execute(iov_to_execute, 0)
134 print(
"Calibration success-result was", alg_result,
" (0=ok, 2=needs more data)")
135 if (alg_result == 0):
139 print(
"Summary of possible calibration completion status values:")
140 print(
" c_OK = Finished successfuly = 0 in Python")
141 print(
" c_Iterate, = Needs iteration = 1 in Python")
142 print(
" c_NotEnoughData, = Needs more data = 2 in Python")
143 print(
" c_Failure, = Failed = 3 in Python")
144 print(
" c_Undefined = Not yet known (before execution) = 4 in Python")