Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:11

0001 #! /usr/bin/env python
0002 #Quick and dirty script to "analyze" the log of the CheckAllIOVs.py to validate
0003 #plotting macro ExtractTrends.C
0004 import sys
0005 #print "Opening logfile %s"%sys.argv[1]
0006 log=open(sys.argv[1])
0007 #log=open("CheckAllIOVs_11_12_122009_2033_800.log","r")
0008 HVOff=0
0009 LVOff=0
0010 for line in log:
0011     if "start" in line:
0012         print("%s modules with HV off"%HVOff)
0013         print("%s modules with LV off\n"%LVOff) 
0014         print(line)
0015         HVOff=0
0016         LVOff=0
0017     else:
0018         try:
0019             (HVStatus,LVStatus)=line.rstrip().split()[1:]
0020             if HVStatus=="OFF":
0021                 HVOff=HVOff+1
0022             if LVStatus=="OFF":
0023                 LVOff=LVOff+1
0024         except:
0025             print("Line read did not contain the IOV or the Voltage status:\n%s"%line)
0026 if HVOff or LVOff: #Catch the case of the last IOV when there are no exception lines ;)
0027     print("%s modules with HV off"%HVOff)
0028     print("%s modules with LV off"%LVOff)