ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/DatabaseRateMonitor.py
Revision: 1.31
Committed: Tue Apr 10 08:45:14 2012 UTC (13 years ago) by grchrist
Content type: text/x-python
Branch: MAIN
CVS Tags: V00-00-28, V00-00-27, V00-00-26
Changes since 1.30: +3 -4 lines
Log Message:
removed some comments

File Contents

# User Rev Content
1 amott 1.1 #!/usr/bin/env python
2    
3 amott 1.15 #from AndrewGetRun import GetRun
4 amott 1.1 from DatabaseParser import *
5     from ReadConfig import RateMonConfig
6     import sys
7     import os
8     import cPickle as pickle
9     import getopt
10     import time
11     from colors import *
12     from TablePrint import *
13     from AddTableInfo_db import MoreTableInfo
14     from math import *
15    
16     WBMPageTemplate = "http://cmswbm/cmsdb/servlet/RunSummary?RUN=%s&DB=cms_omds_lb"
17     WBMRunInfoPage = "https://cmswbm/cmsdb/runSummary/RunSummary_1.html"
18    
19     RefRunNameTemplate = "RefRuns/Run_%s.pk"
20    
21     # define a function that clears the terminal screen
22     def clear():
23     print("\x1B[2J")
24    
25    
26     def usage():
27     print sys.argv[0]+" [Options]"
28     print "This script gets the current HLT trigger rates and compares them to a reference run"
29     print "Options: "
30     print "--AllowedDiff=<diff> Report only if difference in trigger rate is greater than <diff>%"
31     print "--CompareRun=<Run #> Compare run <Run #> to the reference run (Default = Current Run)"
32     print "--FindL1Zeros Look for physics paths with 0 L1 rate"
33     print "--FirstLS=<ls> Specify the first lumisection to consider. This will set LSSlidingWindow to -1"
34     print "--NumberLS=<#> Specify the last lumisection to consider. Make sure LastLS > LSSlidingWindow"
35     print " or set LSSlidingWindow = -1"
36     print "--IgnoreLowRate=<rate> Ignore triggers with an actual and expected rate below <rate>"
37     print "--ListIgnoredPaths Prints the paths that are not compared by this script and their rate in the CompareRun"
38     print "--PrintLumi Prints Instantaneous, Delivered, and Live lumi by LS for the run"
39     print "--RefRun=<Run #> Specifies <Run #> as the reference run to use (Default in defaults.cfg)"
40     print "--ShowPSTriggers Show prescaled triggers in rate comparison"
41 amott 1.2 print "--force Override the check for collisions run"
42 amott 1.1 print "--help Print this help"
43 grchrist 1.20
44     def pickYear():
45     global thisyear
46 grchrist 1.23 thisyear="2012"
47     ##print "Year set to ",thisyear
48 grchrist 1.20
49 amott 1.1 def main():
50 grchrist 1.21 pickYear()
51 amott 1.1 try:
52     opt, args = getopt.getopt(sys.argv[1:],"",["AllowedDiff=","CompareRun=","FindL1Zeros",\
53     "FirstLS=","NumberLS=","IgnoreLowRate=","ListIgnoredPaths",\
54 amott 1.2 "PrintLumi","RefRun=","ShowPSTriggers","force","help"])
55 amott 1.1 except getopt.GetoptError, err:
56     print str(err)
57     usage()
58     sys.exit(2)
59    
60     Config = RateMonConfig(os.path.abspath(os.path.dirname(sys.argv[0])))
61     for o,a in opt:
62     if o=="--ConfigFile":
63     Config.CFGfile=a
64     Config.ReadCFG()
65 grchrist 1.27
66 grchrist 1.30 print "NoVersion=",Config.NoVersion
67 grchrist 1.23
68 amott 1.1 AllowedRateDiff = Config.DefAllowRateDiff
69     CompareRunNum = ""
70     FindL1Zeros = False
71     FirstLS = 9999
72 amott 1.2 NumLS = -10
73 amott 1.1 IgnoreThreshold = Config.DefAllowIgnoreThresh
74     ListIgnoredPaths = False
75     PrintLumi = False
76     RefRunNum = int(Config.ReferenceRun)
77     ShowPSTriggers = True
78 amott 1.2 Force = False
79 amott 1.1
80 grchrist 1.23
81     ## if int(Config.ShifterMode):
82     ## print "ShifterMode!!"
83     ## else:
84     ## print "ExpertMode"
85 amott 1.1
86     if Config.LSWindow > 0:
87     NumLS = -1*Config.LSWindow
88    
89     for o,a in opt: # get options passed on the command line
90     if o=="--AllowedDiff":
91     AllowedRateDiff = float(a)/100.0
92     elif o=="--CompareRun":
93     CompareRunNum=int(a)
94     elif o=="--FindL1Zeros":
95     FindL1Zeros = True
96     elif o=="--FirstLS":
97     FirstLS = int(a)
98     elif o=="--NumberLS":
99     NumLS = int(a)
100     elif o=="--IgnoreLowRate":
101     IgnoreThreshold = float(a)
102     elif o=="--ListIgnoredPaths":
103     ListIgnoredPaths=True
104     elif o=="--PrintLumi":
105     PrintLumi = True
106     elif o=="--RefRun":
107     RefRunNum=int(a)
108     elif o=="--ShowPSTriggers":
109     ShowPSTriggers=True
110 amott 1.2 elif o=="--force":
111     Force = True
112 amott 1.1 elif o=="--help":
113     usage()
114     sys.exit(0)
115     else:
116     print "Invalid Option "+a
117     sys.exit(1)
118    
119 grchrist 1.23
120 amott 1.1 RefLumisExists = False
121    
122     """
123     if RefRunNum > 0:
124     RefRates = {}
125     for Iterator in range(1,100):
126     if RefLumisExists: ## Quits at the end of a run
127     if max(RefLumis[0]) <= (Iterator+1)*10:
128     break
129    
130     RefRunFile = RefRunNameTemplate % str( RefRunNum*100 + Iterator ) # place to save the reference run info
131     print "RefRunFile=",RefRunFile
132     if not os.path.exists(RefRunFile[:RefRunFile.rfind('/')]): # folder for ref run file must exist
133     print "Reference run folder does not exist, please create" # should probably create programmatically, but for now force user to create
134     print RefRunFile[:RefRunFile.rfind('/')]
135     sys.exit(0)
136    
137     if not os.path.exists(RefRunFile): # if the reference run is not saved, get it from wbm
138     print "Reference Run File for run "+str(RefRunNum)+" iterator "+str(Iterator)+" does not exist"
139     print "Creating ..."
140     try:
141     RefParser = GetRun(RefRunNum, RefRunFile, True, Iterator*10, (Iterator+1)*10)
142     print "parsing"
143     except:
144     print "GetRun failed from LS "+str(Iterator*10)+" to "+str((Iterator+1)*10)
145     continue
146    
147     else: # otherwise load it from the file
148     RefParser = pickle.load( open( RefRunFile ) )
149     print "loading"
150     if not RefLumisExists:
151     RefLumis = RefParser.LumiInfo
152     RefLumisExists = True
153    
154     try:
155     RefRates[Iterator] = RefParser.TriggerRates # get the trigger rates from the reference run
156     LastSuccessfulIterator = Iterator
157     except:
158     print "Failed to get rates from LS "+str(Iterator*10)+" to "+str((Iterator+1)*10)
159     """
160    
161     RefRunFile = RefRunNameTemplate % RefRunNum
162     RefParser = DatabaseParser()
163 grchrist 1.23 ##print "Reference Run: "+str(RefRunNum)
164 amott 1.1 if RefRunNum > 0:
165     if not os.path.exists(RefRunFile[:RefRunFile.rfind('/')]): # folder for ref run file must exist
166     print "Reference run folder does not exist, please create" # should probably create programmatically, but for now force user to create
167     print RefRunFile[:RefRunFile.rfind('/')]
168 grchrist 1.27 sys.exit(0)
169    
170 amott 1.1 return
171     if not os.path.exists(RefRunFile):
172     # create the reference run file
173     try:
174     RefParser.RunNumber = RefRunNum
175     RefParser.ParseRunSetup()
176     #RefParser.GetAllTriggerRatesByLS()
177     #RefParser.Save( RefRunFile )
178     except e:
179     print "PROBLEM GETTING REFERNCE RUN"
180     raise
181     else:
182     RefParser = pickle.load( open( RefRunFile ) )
183    
184     # OK, Got the Reference Run
185     # Now get the most recent run
186    
187     SaveRun = False
188     if CompareRunNum=="": # if no run # specified on the CL, get the most recent run
189 grchrist 1.22 CompareRunNum,isCol,isGood = GetLatestRunNumber()
190 grchrist 1.26
191    
192 grchrist 1.22 if not isGood:
193 grchrist 1.23 print "NO TRIGGER KEY FOUND for run ",CompareRunNum
194 grchrist 1.22
195 grchrist 1.23 ##sys.exit(0)
196 amott 1.1
197     if not isCol:
198     print "Most Recent run, "+str(CompareRunNum)+", is NOT collisions"
199 amott 1.16 print "Monitoring only stream A and Express"
200     #if not Force:
201     # sys.exit(0) # maybe we should walk back and try to find a collisions run, but for now just exit
202 grchrist 1.23
203     else:
204     print "Most Recent run is "+str(CompareRunNum)
205 amott 1.16 else:
206 grchrist 1.22 CompareRunNum,isCol,isGood = GetLatestRunNumber(CompareRunNum)
207     if not isGood:
208 grchrist 1.23 print "NO TRIGGER KEY FOUND for run ", CompareRunNum
209     ##sys.exit(0)
210 amott 1.17
211 grchrist 1.23
212 amott 1.17 HeadParser = DatabaseParser()
213     HeadParser.RunNumber = CompareRunNum
214 grchrist 1.23
215     try:
216     HeadParser.ParseRunSetup()
217     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,isCol)
218     LastGoodLS=HeadParser.GetLastLS(isCol)
219     CurrRun=CompareRunNum
220     except:
221     HeadLumiRange=[]
222     LastGoodLS=-1
223     CurrRun=CompareRunNum
224     isGood=0
225    
226     if len(HeadLumiRange) is 0:
227     print "No lumisections that are taking physics data"
228     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,False)
229     if len(HeadLumiRange)>0:
230     isGood=1
231     isCol=0
232     ##sys.exit(0)
233    
234    
235 amott 1.1 if PrintLumi:
236     for LS in HeadParser.LumiInfo[0]:
237     try:
238     if (LS < FirstLS or LS > LastLS) and not FirstLS==999999:
239     continue
240     print str(LS)+' '+str(round(HeadParser.LumiInfo[2][LS],1))+' '+str(round((HeadParser.LumiInfo[3][LS] - HeadParser.LumiInfo[3][LS-1])*1000/23.3,0))+' '+str(round((HeadParser.LumiInfo[4][LS] - HeadParser.LumiInfo[4][LS-1])*1000/23.3,0))
241     except:
242     print "Lumisection "+str(LS-1)+" was not parsed from the LumiSections page"
243    
244 grchrist 1.23 sys.exit(0)
245 amott 1.1
246     if RefRunNum == 0:
247     RefRates = 0
248     RefLumis = 0
249     LastSuccessfulIterator = 0
250    
251     ### Now actually compare the rates, make tables and look at L1. Loops for ShifterMode
252     #CheckTriggerList(HeadParser,RefRunNum,RefRates,RefLumis,LastSuccessfulIterator,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config)
253 grchrist 1.23
254     ###isGood=1##if there is a trigger key
255 amott 1.1 try:
256     while True:
257 grchrist 1.23
258     if isGood:
259     LastGoodLS=HeadParser.GetLastLS(isCol)
260     if not isCol:
261     ##clear()
262     MoreTableInfo(HeadParser,HeadLumiRange,Config,False)
263     else:
264 grchrist 1.25 if (len(HeadLumiRange)>0):
265     RunComparison(HeadParser,RefParser,HeadLumiRange,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config,ListIgnoredPaths)
266     if FindL1Zeros:
267     CheckL1Zeros(HeadParser,RefRunNum,RefRates,RefLumis,LastSuccessfulIterator,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config)
268     else:
269 grchrist 1.26 print "No lumisections that are taking physics data"
270 grchrist 1.23 if int(Config.ShifterMode):
271     #print "Shifter Mode. Continuing"
272     pass
273 amott 1.2 else:
274 grchrist 1.23 print "Expert Mode. Quitting."
275     sys.exit(0)
276 amott 1.2
277 amott 1.1
278     print "Sleeping for 1 minute before repeating "
279 amott 1.16 for iSleep in range(20):
280 amott 1.15 write(".")
281     sys.stdout.flush()
282 amott 1.16 time.sleep(3)
283 grchrist 1.23 write(" Updating\n")
284 amott 1.15 sys.stdout.flush()
285 grchrist 1.23
286     ##print "\nminLS=",min(HeadLumiRange),"Last LS=",HeadParser.GetLastLS(isCol),"run=",HeadParser.RunNumber
287     ###Get a new run if DAQ stops
288     ##print "\nLastGoodLS=",LastGoodLS
289    
290     ##### NEED PLACEHOLDER TO COMPARE CURRENT RUN TO LATEST RUN #####
291    
292     NewRun,isCol,isGood = GetLatestRunNumber(9999999) ## update to the latest run and lumi range
293    
294     try:
295     maxLumi=max(HeadLumiRange)
296     except:
297     maxLumi=0
298    
299     ##### THESE ARE CONDITIONS TO GET NEW RUN #####
300     if maxLumi>(LastGoodLS+1) or not isGood or NewRun!=CurrRun:
301     print "Trying to get new Run"
302     try:
303     HeadParser = DatabaseParser()
304     HeadParser.RunNumber = NewRun
305     HeadParser.ParseRunSetup()
306     CurrRun,isCol,isGood=GetLatestRunNumber(9999999)
307     FirstLS=9999
308     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,isCol)
309     if len(HeadLumiRange) is 0:
310     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,False)
311 grchrist 1.26 print "No lumisections that are taking physics data"
312 grchrist 1.23 if len(HeadLumiRange)>0:
313     isGood=1
314     isCol=0
315    
316 grchrist 1.26
317 grchrist 1.23 LastGoodLS=HeadParser.GetLastLS(isCol)
318 grchrist 1.25 ##print CurrRun, isCol, isGood
319 grchrist 1.23 except:
320     isGood=0
321     isCol=0
322     print "failed"
323    
324    
325    
326    
327     ##CurrRun,isCol,isGood = GetLatestRunNumber(CurrRun) ## update to the latest run and lumi range
328     else:
329     try:
330     HeadParser.ParseRunSetup()
331     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,isCol)
332     if len(HeadLumiRange) is 0:
333     HeadLumiRange = HeadParser.GetLSRange(FirstLS,NumLS,False)
334 grchrist 1.26 print "No lumisections that are taking physics data"
335 grchrist 1.23 if len(HeadLumiRange)>0:
336     isGood=1
337     isCol=0
338     LastGoodLS=HeadParser.GetLastLS(isCol)
339    
340     except:
341     isGood=0
342     isCol=0
343     clear()
344     print "NO TRIGGER KEY FOUND YET for run", NewRun ,"repeating search"
345    
346    
347     ## try:
348     ## HeadParser.GetLumiInfo()
349     ## if len(HeadParser.Active)>0:
350     ## isGood=1
351     ## ##print "setting to good"
352     ## except:
353     ## pass
354 grchrist 1.22
355 grchrist 1.23
356 amott 1.1 #end while True
357     #end try
358     except KeyboardInterrupt:
359     print "Quitting. Peace Out."
360    
361    
362 grchrist 1.12 def RunComparison(HeadParser,RefParser,HeadLumiRange,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config,ListIgnoredPaths):
363 amott 1.1
364     Header = ["Trigger Name","Actual","Expected","% Inc","Cur PS","Comments"]
365     Data = []
366     Warn = []
367     IgnoredRates=[]
368 grchrist 1.23
369 abrinke1 1.9 [HeadAvInstLumi,HeadAvLiveLumi,HeadAvDeliveredLumi,HeadAvDeadTime,HeadPSCols] = HeadParser.GetAvLumiInfo(HeadLumiRange)
370 abrinke1 1.3 ##[HeadUnprescaledRates, HeadTotalPrescales, HeadL1Prescales, HeadTriggerRates] = HeadParser.UpdateRun(HeadLumiRange)
371     HeadUnprescaledRates = HeadParser.UpdateRun(HeadLumiRange)
372 abrinke1 1.9 [PSColumnByLS,InstLumiByLS,DeliveredLumiByLS,LiveLumiByLS,DeadTimeByLS,PhysicsByLS,ActiveByLS] = HeadParser.LumiInfo
373 grchrist 1.30 deadtimebeamactive=HeadParser.GetDeadTimeBeamActive(HeadLumiRange)
374 grchrist 1.18 try:
375     pkl_file = open(Config.FitFileName, 'rb')
376     FitInput = pickle.load(pkl_file)
377     pkl_file.close()
378 grchrist 1.29 ##print "fit file name=",Config.FitFileName
379 grchrist 1.31
380 grchrist 1.18 except:
381 grchrist 1.27 print "No fit file specified"
382 grchrist 1.20 sys.exit(2)
383    
384 grchrist 1.23 try:
385     refrunfile="RefRuns/%s/Rates_HLT_10LS_JPAP.pkl" % (thisyear)
386     pkl_file = open(refrunfile, 'rb')
387     RefRatesInput = pickle.load(pkl_file)
388     pkl_file.close()
389     except:
390 grchrist 1.24 RefRatesInput={}
391 amott 1.1
392 grchrist 1.30
393     trig_list=Config.MonitorList
394    
395     if Config.NoVersion:
396     trig_list=[]
397     FitInputNoV={}
398    
399     for trigger in Config.MonitorList:
400     trig_list.append(StripVersion(trigger))
401     for trigger in FitInput.iterkeys():
402     FitInputNoV[StripVersion(trigger)]=FitInput[trigger]
403     FitInput=FitInputNoV
404 grchrist 1.31
405 grchrist 1.30
406     ##trig_list=Config.MonitorList
407 abrinke1 1.3 for HeadName in HeadUnprescaledRates:
408 grchrist 1.30
409     HeadNameNoV=StripVersion(HeadName)
410 grchrist 1.31
411 grchrist 1.30
412    
413 amott 1.1 ## SKIP triggers in the skip list
414 abrinke1 1.3 ## if not HeadTotalPrescales.has_key(HeadName): ## for whatever reason we have no prescale here, so skip (calibration paths)
415     ## continue
416     ## if not HeadTotalPrescales[HeadName]: ## prescale is thought to be 0
417     ## continue
418 grchrist 1.12
419     ## unless we are Listing Ignored paths only look at triggers in the .list file specifed in defaults.cfg
420 grchrist 1.19
421     #if StripVersion(HeadName) not in Config.MonitorList and not ListIgnoredPaths:
422 grchrist 1.24
423     #print "MonitorList=",Config.MonitorList
424     #print HeadName
425 grchrist 1.30 if Config.NoVersion:
426     if HeadNameNoV not in trig_list and not ListIgnoredPaths:
427     continue
428     if HeadNameNoV not in FitInput.keys():
429     continue
430     else:
431     if HeadName not in trig_list and not ListIgnoredPaths:
432     continue
433     if HeadName not in FitInput.keys():
434     continue
435 grchrist 1.24
436 grchrist 1.25 ##masked_triggers = ["AlCa_", "DST_", "HLT_L1", "HLT_L2", "HLT_Zero"]
437 grchrist 1.28 masked_triggers = ["AlCa_", "DST_", "HLT_L1", "HLT_Zero"]
438 abrinke1 1.9 masked_trig = False
439     for mask in masked_triggers:
440     if str(mask) in HeadName:
441     masked_trig = True
442     if masked_trig:
443     continue
444    
445 amott 1.1 skipTrig=False
446 abrinke1 1.3 TriggerRate = round(HeadUnprescaledRates[HeadName][2],2)
447 grchrist 1.30
448 amott 1.1 if RefParser.RunNumber == 0: ## Use rate prediction functions
449    
450 grchrist 1.30
451     PSCorrectedExpectedRate = Config.GetExpectedRate(HeadName,FitInput,RefRatesInput,HeadAvLiveLumi,HeadAvDeliveredLumi,deadtimebeamactive)
452    
453 abrinke1 1.9
454     if PSCorrectedExpectedRate[0] < 0: ##This means we don't have a prediction for this trigger
455 amott 1.1 continue
456 grchrist 1.30
457 abrinke1 1.9 ExpectedRate = round((PSCorrectedExpectedRate[0] / HeadUnprescaledRates[HeadName][1]),2)
458 grchrist 1.30
459 amott 1.1 PerDiff=0
460     if ExpectedRate>0:
461     PerDiff = int(round( (TriggerRate-ExpectedRate)/ExpectedRate,2 )*100)
462 grchrist 1.13 if abs(PerDiff) > max(AllowedRateDiff/max(sqrt(TriggerRate),sqrt(ExpectedRate)),AllowedRateDiff/2.0):
463 abrinke1 1.9 Warn.append(True)
464     else:
465     Warn.append(False)
466 amott 1.1 else:
467     Warn.append(False)
468    
469     if TriggerRate < IgnoreThreshold and ExpectedRate < IgnoreThreshold:
470     continue
471    
472     VC = ""
473    
474 abrinke1 1.3 Data.append([HeadName,TriggerRate,ExpectedRate,PerDiff,round(HeadUnprescaledRates[HeadName][1],1),VC])
475 amott 1.1
476     else: ## Use a reference run
477     ## cheap trick to only get triggers in list when in shifter mode
478     #print "shifter mode=",int(Config.ShifterMode)
479 grchrist 1.24 print "REfRun!!!"
480 amott 1.1 if int(Config.ShifterMode)==1:
481     if not HeadParser.AvgL1Prescales[HeadParser.HLTSeed[HeadName]]==1:
482     continue
483    
484     RefInstLumi = 0
485     RefIterator = 0
486    
487     RefStartIndex = ClosestIndex(HeadAvInstLumi,RefParser.GetAvLumiPerRange())
488     RefLen = -10
489    
490 abrinke1 1.3 ##[RefUnprescaledRates, RefTotalPrescales, RefL1Prescales, RefTriggerRates] = RefParser.UpdateRun(RefParser.GetLSRange(RefStartIndex,RefLen))
491     RefUnprescaledRates = RefParser.UpdateRun(RefParser.GetLSRange(RefStartIndex,RefLen))
492 amott 1.1 [RefAvInstLumi,RefAvLiveLumi,RefAvDeliveredLumi,RefAvDeadTime,RefPSCols] = RefParser.GetAvLumiInfo(RefParser.GetLSRange(RefStartIndex,RefLen))
493     RefRate = -1
494     for k,v in RefUnprescaledRates.iteritems():
495 grchrist 1.19 #if StripVersion(HeadName) == StripVersion(k): # versions may not match
496     RefRate = v
497 amott 1.1
498 abrinke1 1.3 ScaledRefRate = round( RefRate*HeadAvLiveLumi/RefAvLiveLumi/(HeadUnprescaledRates[HeadName][1]), 2 )
499 amott 1.1
500     if ScaledRefRate == 0:
501     PerDiff = 100
502     else:
503     PerDiff = int( round( (TriggerRate - ScaledRefRate)/ScaledRefRate , 2)*100)
504    
505     if TriggerRate < IgnoreThreshold and ScaledRefRate < IgnoreThreshold:
506     continue
507    
508     if abs(PerDiff) > AllowedRateDiff:
509     Warn.append(True)
510     else:
511     Warn.append(False)
512     VC = ""
513 amott 1.15 Data.append([HeadName,TriggerRate,ScaledRefRate,PerDiff,round((HeadUnprescaledRates[HeadName][1]),1),VC])
514 amott 1.1
515 grchrist 1.18
516 amott 1.1 PrettyPrintTable(Header,Data,[80,10,10,10,10,20],Warn)
517    
518 amott 1.4 MoreTableInfo(HeadParser,HeadLumiRange,Config)
519 amott 1.1
520     def CheckTriggerList(HeadParser,RefRunNum,RefRates,RefLumis,LastSuccessfulIterator,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config):
521     print "checking trigger list"
522    
523     def CheckL1Zeros(HeadParser,RefRunNum,RefRates,RefLumis,LastSuccessfulIterator,ShowPSTriggers,AllowedRateDiff,IgnoreThreshold,Config):
524     L1Zeros=[]
525     IgnoreBits = ["L1_PreCollisions","L1_InterBunch_Bsc","L1_BeamHalo","L1_BeamGas_Hf"]
526     for key in HeadParser.TriggerRates:
527     ## Skip events in the skip list
528     skipTrig=False
529     ##for trig in Config.ExcludeList:
530     ##if not trigN.find(trig) == -1:
531     ##skipTrig=True
532     ##break
533     if skipTrig:
534     continue
535     ## if no events pass the L1, add it to the L1Zeros list if not already there
536     if HeadParser.TriggerRates[key][1]==0 and not HeadParser.TriggerRates[key][4] in L1Zeros:
537     if HeadParser.TriggerRates[key][4].find('L1_BeamHalo')==-1 and HeadParser.TriggerRates[key][4].find('L1_PreCollisions')==-1 and HeadParser.TriggerRates[key][4].find('L1_InterBunch_Bsc')==-1:
538    
539     L1Zeros.append(HeadParser.TriggerRates[key][4])
540     print "L1Zeros=", L1Zeros
541    
542     if len(L1Zeros) == 0:
543     #print "It looks like no masked L1 bits seed trigger paths"
544     pass
545     else:
546     print "The following seeds are used to seed HLT bits but accept 0 events:"
547     #print "The average lumi of this run is: "+str(round(HeadParser.LumiInfo[6],1))+"e30"
548     for Seed in L1Zeros:
549     print Seed
550    
551     if __name__=='__main__':
552 grchrist 1.20 global thisyear
553 amott 1.1 main()