Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:50

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 from __future__ import print_function
0005 import sys
0006 #print "Opening logfile %s"%sys.argv[1]
0007 log=open(sys.argv[1])
0008 #log=open("CheckAllIOVs_11_12_122009_2033_800.log","r")
0009 HVOff=0
0010 LVOff=0
0011 for line in log:
0012     if "start" in line:
0013         print("%s modules with HV off"%HVOff)
0014         print("%s modules with LV off\n"%LVOff) 
0015         print(line)
0016         HVOff=0
0017         LVOff=0
0018     else:
0019         try:
0020             (HVStatus,LVStatus)=line.rstrip().split()[1:]
0021             if HVStatus=="OFF":
0022                 HVOff=HVOff+1
0023             if LVStatus=="OFF":
0024                 LVOff=LVOff+1
0025         except:
0026             print("Line read did not contain the IOV or the Voltage status:\n%s"%line)
0027 if HVOff or LVOff: #Catch the case of the last IOV when there are no exception lines ;)
0028     print("%s modules with HV off"%HVOff)
0029     print("%s modules with LV off"%LVOff)