138 def hancool_histo(inputFilePath="", input_run=-1, dbConnectionHisto="", dqmfOflHisto="", dbTagName=""):
140 if (input_run == -1):
143 if (len(inputFilePath) < 1):
144 inputFilePath =
"/afs/cern.ch/user/a/atlasdqm/dqmdisk1/han_results/tier0/FDR2b/1/physics_Express/"
145 if (inputFilePath.rfind(
"/") != (len(inputFilePath)-1)):
147 if (len(dbConnectionHisto) < 1):
148 dbConnectionHisto =
"sqlite://;schema=/afs/cern.ch/user/a/atlasdqm/w0/users/onofrio/DQMF_08112008/14.2.10/WorkArea/python/MyCOOL_histo_FDR2c.db;dbname=OFLP200"
150 if (len(dqmfOflHisto) < 1):
151 dqmfOflHisto =
"/GLOBAL/DETSTATUS/DQMFOFLH"
152 if (len(dbTagName) < 1):
153 dbTagName =
"DetStatusDQMFOFLH-FDR2-02"
157 dbConnectionHisto, dqmfOflHisto, 0, 0, 0, 0)
160 filename =
"run_"+
str(run)+
"_han.root"
163 for pair
in folderMapHisto.items():
166 print(pair[0], pair[1])
171 while ((os.path.isfile(path+filename))
and (i < 2)):
172 while os.path.isfile(path+filename):
173 if (
getLimits(filename)[
"until"] == 4294967295):
174 modH.setIOV(run,
getLimits(filename)[
"since"],
177 xml =
'Allhisto.list'
179 print(the_result_histo)
181 if (the_result_histo ==
"Undefined"):
183 print(
" This histogram DOES NOT have a corresponding channel in the DB! ")
184 print(
" Info cannot be inserted ")
187 histo_nameonly = the_result_histo.split(
188 '/')[
int(len(the_result_histo.split(
'/')))-1]
189 print(histo_nameonly)
191 path+filename, pair[0]+
"_/Results/Status")
194 path+filename, pair[0]+
"_/Config/name")
197 path+filename, path_string, histo_string)
200 path+filename, pair[0]+
"_/Results")
209 if (algo.find(
'Bins_Diff_FromAvg') > -1
and mean_rms.find(
'null') < 0):
212 elif (algo.find(
'GatherData') > -1
and mean_rms.find(
'null') < 0):
213 if (mean_rms.find(
'Error') > -1):
221 elif (algo.find(
'Simple_pol1_Fit') > -1
and mean_rms.find(
'null') < 0):
224 elif (algo.find(
'Simple_gaus_Fit') > -1
and mean_rms.find(
'null') < 0):
228 elif (algo.find(
'SideBand') > -1
and mean_rms.find(
'null') < 0):
231 elif (algo.find(
'CheckHisto_Mean') > -1
and mean_rms.find(
'null') < 0):
234 elif (algo.find(
'CheckHisto_RMS') > -1
and mean_rms.find(
'null') < 0):
237 elif (algo.find(
'Bin') > -1)
and mean_rms.find(
'null') < 0
and ((algo.find(
'Threshold') > -1)
or (algo.find(
'ContentComp') > -1)):
240 if (len(output) > 1):
252 if (algo.find(
'CheckHisto_Mean') > -1
and algo.find(
'GatherData') > -1
and mean_rms.find(
'null') < 0):
253 comb_mean_rms = mean_rms.split(
'XMean: ')
254 if (comb_mean_rms[0].
find(
'Error') > -1):
266 if (algo.find(
'BinContentComp') > -1
and algo.find(
'GatherData') > -1
and mean_rms.find(
'null') < 0):
267 if (mean_rms.find(
'Error') > -1):
271 histo_nameonly, mean_rms)
278 histo_nameonly, mean_rms)
280 codeH = codeMap[resultH]
288 modH.insertH(pair[1], codeH,
str(algo),
int(entries),
float(
290 print(
"----------- global: Insertion successfull! --------------------")
293 modH.insertH(pair[1], codeH,
str(algo),
int(
294 entries), 0, 0, 0, 0, 0, dbTagName)
295 print(
'Could not upload parameters in DB, they are not numbers! Check the algorithm!')
298 filename =
"run_" + \
299 str(run)+intervalType[i]+
str(number)+
"_han.root"
302 filename =
"run_" + \
303 str(run)+intervalType[i]+
str(number)+
"_han.root"
304 filename =
"run_"+
str(run)+
"_han.root"
305 print(
"--------------------------------------")