From 8b63e8d9b36636aa27baad11650d397b125e64b2 Mon Sep 17 00:00:00 2001 From: Peter Onyisi <ponyisi@utexas.edu> Date: Thu, 26 Jul 2018 19:35:47 +0000 Subject: [PATCH] Add pixel improvements for hancool Former-commit-id: 656e12a2f69b6755eeb86ce03ca8485461013517 --- .../DataQualityUtils/python/hancoolmod.py | 4 +- .../DataQualityUtils/python/pix_defect.py | 68 +++++++++++-------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/DataQuality/DataQualityUtils/python/hancoolmod.py b/DataQuality/DataQualityUtils/python/hancoolmod.py index b7ed7da5db785..3f6425b91946d 100644 --- a/DataQuality/DataQualityUtils/python/hancoolmod.py +++ b/DataQuality/DataQualityUtils/python/hancoolmod.py @@ -507,8 +507,7 @@ def hancool_defects(runNumber, filePath="./", dbConnection="", db_tag='HEAD', is globname = fnames[0][0] filename = os.path.basename(globname) since, until = getLimits(filename) - # disabled until fixed - #defects += pix_defect.execute(runNumber, globname, until-1) + defects += pix_defect.execute(runNumber, globname, until-1) from DQDefects import DefectsDB ddb = DefectsDB(dbConnection, read_only=False) @@ -532,4 +531,3 @@ def hancool_defects(runNumber, filePath="./", dbConnection="", db_tag='HEAD', is #ddb = DefectsDB(dbConnection, read_only=False, tag="HEAD") #import pix_defect #pix_defect.execute(runNumber, globname_pix, until-1, 'sys:hancool', ddb) - diff --git a/DataQuality/DataQualityUtils/python/pix_defect.py b/DataQuality/DataQualityUtils/python/pix_defect.py index fa8931871660c..0ec2f464d5f83 100644 --- a/DataQuality/DataQualityUtils/python/pix_defect.py +++ b/DataQuality/DataQualityUtils/python/pix_defect.py @@ -2,7 +2,7 @@ import sys #from DQDefects import DefectsDB -from ROOT import gROOT, TCanvas, TDirectory, TFile, TH1F, TH2F, TF1 +from ROOT import gROOT, TCanvas, TDirectory, TFile, TH1F, TH2F, TF1, TProfile import collections defect_val = collections.namedtuple('defect_val', 'defect, comment, recoverable') @@ -86,7 +86,7 @@ def print_def(defect_name, defect_lb): for i in range(0, len(defect_lb)): print defect_name, "[", defect_lb[i][0], "]:", defect_lb[i][1], "-", defect_lb[i][2] -def assign_defect(db, defect_name, run, defect_lb, comment): +def assign_defect(db, defect_name, run, defect_lb): for i in range(0, len(defect_lb)): layer = defect_lb[i][0] if layer == 0: @@ -111,6 +111,7 @@ def assign_defect(db, defect_name, run, defect_lb, comment): until = (run << 32) + lbend + 1 #print sdefect, ": LB = ", lbstart,"-",lbend,")" + comment = "assign " + sdefect db.append(defect_iov(sdefect, comment, False, start, until)) def assign_lowstat(db, run, comment): @@ -124,29 +125,30 @@ def assign_lowstat(db, run, comment): #print sdefect, ": LB = ", lbstart,"-",lbend,")" db.append(defect_iov(sdefect, comment, False, start, until)) +#def execute(run, sfile, lb_max, user, db): def execute(run, sfile, lb_max): db = [] gROOT.Reset(); file = TFile(sfile) - shtest = "InnerDetector/Pixel/PIX0/_Experts/HitsLB/Hits_per_lumi_B0" - htest = file.Get(shtest) + shmu = "Global/Luminosity/AnyTrigger/actualMu_vs_LB" + hmu = file.Get(shmu) shits = [] - shits.append("InnerDetector/Pixel/PIXIBL/_Experts/HitsLB/Hits_per_lumi_IBL") - shits.append("InnerDetector/Pixel/PIX0/_Experts/HitsLB/Hits_per_lumi_B0") - shits.append("InnerDetector/Pixel/PIX1/_Experts/HitsLB/Hits_per_lumi_B1") - shits.append("InnerDetector/Pixel/PIX2/_Experts/HitsLB/Hits_per_lumi_B2") - shits.append("InnerDetector/Pixel/PIXECA/_Experts/HitsLB/Hits_per_lumi_ECA") - shits.append("InnerDetector/Pixel/PIXECC/_Experts/HitsLB/Hits_per_lumi_ECC") + shits.append("InnerDetector/Pixel/PIXIBL/Hits/AvgOcc_active_per_lumi_IBL") + shits.append("InnerDetector/Pixel/PIX0/Hits/AvgOcc_active_per_lumi_B0") + shits.append("InnerDetector/Pixel/PIX1/Hits/AvgOcc_active_per_lumi_B1") + shits.append("InnerDetector/Pixel/PIX2/Hits/AvgOcc_active_per_lumi_B2") + shits.append("InnerDetector/Pixel/PIXECA/Hits/AvgOcc_active_per_lumi_ECA") + shits.append("InnerDetector/Pixel/PIXECC/Hits/AvgOcc_active_per_lumi_ECC") sdisabled = [] sdisabled.append("InnerDetector/Pixel/PIXIBL/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_IBL2D_byPostProcess") - sdisabled.append("InnerDetector/Pixel/PIX0/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B0_byPostProcess") - sdisabled.append("InnerDetector/Pixel/PIX1/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B1_byPostProcess") - sdisabled.append("InnerDetector/Pixel/PIX2/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B2_byPostProcess") - sdisabled.append("InnerDetector/Pixel/PIXECA/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_ECA_byPostProcess") - sdisabled.append("InnerDetector/Pixel/PIXECC/_Experts/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_ECC_byPostProcess") + sdisabled.append("InnerDetector/Pixel/PIX0/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B0_byPostProcess") + sdisabled.append("InnerDetector/Pixel/PIX1/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B1_byPostProcess") + sdisabled.append("InnerDetector/Pixel/PIX2/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_B2_byPostProcess") + sdisabled.append("InnerDetector/Pixel/PIXECA/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_ECA_byPostProcess") + sdisabled.append("InnerDetector/Pixel/PIXECC/DisableAndErrorsLB/DisabledAndSyncErrorsModules_per_lumi_ECC_byPostProcess") nlayer = 6 hhits = [] @@ -170,20 +172,26 @@ def execute(run, sfile, lb_max): find_notready(nlayer, hdisabled, 0.3, 1., notready_gt30pct_lb) #print_def("standby", standby_lb) - #print_def("5to7pct", notready5to7pct_lb) - #print_def("7to10pct", notready7to10pct_lb) - #print_def("10to20pct", notready10to20pct_lb) - #print_def("20to30pct", notready20to30pct_lb) - #print_def("gt30pct", notready_gt30pct_lb) - #user = "atlpixdq" - assign_defect(db, "STANDBY", run, standby_lb, "assign standby") - assign_defect(db, "5to7pct_NOTREADY", run, notready5to7pct_lb, "assign notready") - assign_defect(db, "7to10pct_NOTREADY", run, notready7to10pct_lb, "assign notready") - assign_defect(db, "10to20pct_NOTREADY", run, notready10to20pct_lb, "assign notready") - assign_defect(db, "20to30pct_NOTREADY", run, notready20to30pct_lb, "assign notready") - assign_defect(db, "GT30pct_NOTREADY", run, notready_gt30pct_lb, "assign notready") - - # if nevent < 100000: - # assign_lowstat(db, run, "assign lowstat") + #assign_defect(db, "STANDBY", run, standby_lb) + + if 0: + print_def("5to7pct", notready5to7pct_lb) + print_def("7to10pct", notready7to10pct_lb) + print_def("10to20pct", notready10to20pct_lb) + print_def("20to30pct", notready20to30pct_lb) + print_def("gt30pct", notready_gt30pct_lb) + + + if 1: + assign_defect(db, "5to7pct_NOTREADY", run, notready5to7pct_lb) + assign_defect(db, "7to10pct_NOTREADY", run, notready7to10pct_lb) + assign_defect(db, "10to20pct_NOTREADY", run, notready10to20pct_lb) + assign_defect(db, "20to30pct_NOTREADY", run, notready20to30pct_lb) + assign_defect(db, "GT30pct_NOTREADY", run, notready_gt30pct_lb) + + #nevent = hmu.GetEntries() + #if nevent < 100000: + #assign_lowstat(db, run, "assign lowstat") + return db -- GitLab