108 report_counter_dict = {
"empty" : 0 ,
"all_zeros":0}
110 for module, frontEnds
in new_calib.items():
114 for itr_fe
in range(nFE):
116 failures = frontEnds[itr_fe].
count(0) + frontEnds[itr_fe].
count(-28284.3)
119 if module
not in report_dict:
120 report_dict[module] = []
123 if failures != len(frontEnds[itr_fe]):
124 report_counter_dict[
"empty"] += 1
125 report_dict[module].
append(
" FE%02d with %i zeros. Positions:" % (itr_fe,failures))
128 for itr_par
in range(len(frontEnds[itr_fe])):
129 if( frontEnds[itr_fe][itr_par] == 0
or frontEnds[itr_fe][itr_par] == -28284.3):
131 report_dict[module][-1] = report_dict[module][-1] + (
" %s,"%(
str(itr_par)))
134 val_list = [new_calib[module][i][itr_par]
for i
in range(nFE)
if new_calib[module][i][itr_par] != 0 ]
135 val_list_fit = [new_calib[module][i][itr_par]
for i
in range(nFE)
if new_calib[module][i][itr_par] != 0
and new_calib[module][i][itr_par] != -28284.3 ]
139 new_calib[module][itr_fe][itr_par] =
recover_thr(frontEnds[itr_fe][4], frontEnds[itr_fe][8], val_list, ref_calib[module][itr_fe][itr_par] )
143 new_calib[module][itr_fe][itr_par] =
recover_thr(frontEnds[itr_fe][0], frontEnds[itr_fe][8], val_list, ref_calib[module][itr_fe][itr_par])
147 new_calib[module][itr_fe][itr_par] =
recover_thr(frontEnds[itr_fe][0], frontEnds[itr_fe][4], val_list, ref_calib[module][itr_fe][itr_par])
152 if itr_par == 13
or itr_par == 16:
153 new_calib[module][itr_fe][itr_par] =
recover(val_list_fit, ref_calib[module][itr_fe][itr_par])
155 new_calib[module][itr_fe][itr_par] =
recover(val_list, ref_calib[module][itr_fe][itr_par])
159 report_counter_dict[
"all_zeros"] += 1
160 report_dict[module].
append(
" FE%02d full copy" % itr_fe)
161 new_calib[module][itr_fe] = ref_calib[module][itr_fe]
163 return report_dict, report_counter_dict