diff --git a/Trigger/TrigValidation/TrigValTools/bin/chainDump.py b/Trigger/TrigValidation/TrigValTools/bin/chainDump.py index 548d16c9d574c3400c62a7df8fd13af7ec5a9a42..6c900e20432f585f38d0342cb3057f1ebdaa32a9 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/chainDump.py +++ b/Trigger/TrigValidation/TrigValTools/bin/chainDump.py @@ -120,7 +120,7 @@ class chainDump: chainCounts = hst.GetBinContent(j+1) pairedList +=[[char_label,chainCounts]] if self.verbose: - print char_label.ljust(lenMax) + "%6.0f" % hst.GetBinContent(j+1) + print char_label.ljust(lenMax) + "%15.0f" % hst.GetBinContent(j+1) return pairedList @@ -304,7 +304,7 @@ class chainDump: print chains for name,count in chains: if self.saveToFile: - f.write( name + "%6.0f" % count+"\n" ) + f.write( name + "%15.0f" % count+"\n" ) else: print name, count diff --git a/Trigger/TrigValidation/TrigValTools/bin/dumpTimes.py b/Trigger/TrigValidation/TrigValTools/bin/dumpTimes.py new file mode 100755 index 0000000000000000000000000000000000000000..bf96ee749e05b3833362a4042f47d48d83a5ba3a --- /dev/null +++ b/Trigger/TrigValidation/TrigValTools/bin/dumpTimes.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# @file: dumpTimes.py +# @purpose: Script to dump the timing histograms from expert-monitoring.root/TIMERS +# @author: Stewart Martin-Haugh + +import argparse +import ROOT +from optparse import OptionParser +import os +import re + +def timing(hist): + mean = hist.GetMean() + error = hist.GetMeanError() + if hist.GetEntries() == 0: + return "0" + mean_plus_err = str(round(mean,3)) + " +/- " + str(round(error,3)) + overflow = str(hist.GetBinContent(hist.GetNbinsX()+1)) + if overflow != 0.0: + return mean_plus_err + else: + return mean_plus_err + "\nOverflow: " + overflow + + +def match(pattern, name): + regex = re.compile(pattern) + return regex.match(name) + +def get_matches(pattern, myFile, matches): + for key in ROOT.gDirectory.GetListOfKeys(): + if match(pattern,key.GetName())!=None: + hist = myFile.Get("TIMERS/" + key.GetName()) + print myFile.GetName() + " " + key.GetName() + " " + timing(hist) + matches.append(key.GetName()) + +def main(): + parser = OptionParser() + parser.add_option("-H", "--hist", dest="hist_name", type = "string", + help="Histogram to time") + parser.add_option("-p", "--pattern", dest="pattern", type = "string", default = None, + help="Pattern to match histogram to") + (options, args) = parser.parse_args() + print options, args + for arg in args: + print "" + myFile = ROOT.TFile(arg) + if (options.hist_name!=None): + hist = myFile.Get("TIMERS/" + options.hist_name) + print myFile.GetName() + " " + options.hist_name + " " + timing(hist) + elif (options.pattern!=None): + ROOT.gDirectory.Cd("TIMERS") + matches = [] + get_matches(options.pattern, myFile, matches) + if (len(matches)==0): + get_matches(".*" + options.pattern + ".*", myFile, matches) + else: + ROOT.gDirectory.Cd("TIMERS") + for key in ROOT.gDirectory.GetListOfKeys(): + hist = myFile.Get("TIMERS/" + key.GetName()) + print myFile.GetName() + " " + key.GetName() + " " + timing(hist) + + +if __name__ == "__main__": + main() diff --git a/Trigger/TrigValidation/TrigValTools/bin/histSizes.py b/Trigger/TrigValidation/TrigValTools/bin/histSizes.py index 28c586b7f733e93a37737facd5651752b0d88e4e..4aa22ff1a764c0df8de4fb569c3e0af635cae528 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/histSizes.py +++ b/Trigger/TrigValidation/TrigValTools/bin/histSizes.py @@ -11,7 +11,14 @@ opts = None def filledBins(h): N = h.GetSize() return sum([1 for i in range(N) if h.At(i)!=0]) - + +def hasLabels(h): + return (h.GetXaxis().GetLabels()!=None) + +def missingLabels(h): + l = h.GetXaxis().GetLabels() + return (l!=None and h.GetXaxis().GetNbins()!=l.GetSize()) + def addDirList(dir,path,hists): list=dir.GetListOfKeys() for key in list: @@ -22,6 +29,8 @@ def addDirList(dir,path,hists): else: h = key.ReadObj() if not h.InheritsFrom('TH1'): continue + if opts.labeled==True and not hasLabels(h): continue + if opts.misslabel==True and not missingLabels(h): continue b = filledBins(h) if opts.filled else h.GetSize() hists[path+name]=(cname,b) @@ -71,6 +80,12 @@ def main(): parser.add_option('-f', '--filled', action='store_true', help='Show number of filled bins instead of total bins') + + parser.add_option('-l', '--labeled', action='store_true', + help='Only show histograms with text labels') + + parser.add_option('-m', '--misslabel', action='store_true', + help='Only show labeled histograms with at least one unlabeled bin') global opts (opts, args) = parser.parse_args() diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigperfmonrtt.py b/Trigger/TrigValidation/TrigValTools/bin/trigperfmonrtt.py index 4890f7d685aefc60ca4f94a10cf4ef97f6ba8d08..59ce560a689ffc705383173cad8973bcdef9c7c0 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/trigperfmonrtt.py +++ b/Trigger/TrigValidation/TrigValTools/bin/trigperfmonrtt.py @@ -27,7 +27,7 @@ opts = None class Config: memImgWidth = 800 memImgHeight = 600 - defaultPlatform = 'x86_64-slc6-gcc47-opt' + defaultPlatform = 'x86_64-slc6-gcc48-opt' class Build: def __init__(self, name, branch, platform, project = "offline"): @@ -117,7 +117,7 @@ class Rtt: sh = projshort.get(prj,prj) if len(sh)>0: alias += '/'+sh if platform != Config.defaultPlatform: - try: alias += (' [%s]') % platform.split('-')[0] + try: alias += (' [%s]') % platform.split('-')[2] except: pass b = Build(alias, branch, platform, rttprj) diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py b/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py index 4de2f5038b6d73541e7b66a29e44988d15eda20e..99c2c0e97578b76d224677bb8991cc55628b0aec 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py +++ b/Trigger/TrigValidation/TrigValTools/bin/trigtestlink.py @@ -44,14 +44,14 @@ for p in path.split(':'): if basename in ["trigp1test_testconfiguration_work", "triggertest_testconfiguration_work", "triganalysistest_testconfiguration_work"]: if testname == "-l": conf = { "trigp1test_testconfiguration_work" : "TrigP1Test.conf", - "triggertest_testconfiguration_work" : "TriggerTest", - "triganalysistest_testconfiguration_work" : "TrigAnalysisTest" }[basename] + "triggertest_testconfiguration_work" : "TriggerTest.conf", + "triganalysistest_testconfiguration_work" : "TrigAnalysisTest.conf" }[basename] # list all tests print "\n"+basename+":" print len(basename)*"=" + "=" w = max(len(x) for x in subdirs) for test in sorted(subdirs): - print "%-*s ==> trigtest.pl --cleardir --test %s --rundir %s --conf %s.conf" % (w, test,test,test,conf) + print "%-*s ==> trigtest.pl --cleardir --test %s --rundir %s --conf %s" % (w, test,test,test,conf) continue if basename == testname: