CMS 3D CMS Logo

Functions | Variables

GenerateHcalLaserBadRunList Namespace Reference

Functions

def MakePair
def ReadNewList

Variables

tuple defaultDict = MakePair(defaultList)
 defaultList = hcalLaserEventFilter.BadRunEventNumbers
tuple keys = defaultDict.keys()
tuple lines = open(i,'r')
tuple newBadDict = ReadNewList(newlines)
tuple newkeys = newBadDict.keys()
list newlines = []
dictionary notInNew = {}
dictionary notInOld = {}
tuple out = open("badEvents.py",'w')
tuple thistime = time.time()

Function Documentation

def GenerateHcalLaserBadRunList::MakePair (   startlist)

Definition at line 15 of file GenerateHcalLaserBadRunList.py.

00016                        :
00017     dict={}
00018     for i in range(0,len(startlist),2):
00019         key1=startlist[i]
00020         key2=startlist[i+1]
00021         runevent=(key1,key2)
00022         dict[runevent]="%s,%s,"%(key1,key2)
00023     return dict

def GenerateHcalLaserBadRunList::ReadNewList (   newlist)
Read a new list of bad runs from an input file, and
    creates a new list of output keys for the bad run/events.
    

Definition at line 24 of file GenerateHcalLaserBadRunList.py.

00025                         :
00026     ''' Read a new list of bad runs from an input file, and
00027         creates a new list of output keys for the bad run/events.
00028         '''
00029     outlist=[]
00030     for i in newlist:
00031         temp=string.strip(i)
00032         # Input is comma-separated
00033         if temp.find(",")>-1:
00034             temp=string.split(temp,",")
00035         # Input is space-separated
00036         else:
00037             temp=string.split(temp)
00038 
00039         # Case 1:  new input presented as "run lumi event" list
00040         if len(temp)==3:
00041             try:
00042                 run=string.atoi(temp[0])
00043                 evt=string.atoi(temp[2])
00044             except:
00045                 print "Could not parse line '%s'"%i
00046         # Case 2:  new input presented as "run event" list
00047         elif len(temp)==2:
00048             try:
00049                 run=string.atoi(temp[0])
00050                 evt=string.atoi(temp[1])
00051             except:
00052                 print "Could not parse line '%s'"%i
00053         else:
00054             print "Cannot parse line! ('%s')"%i
00055             continue
00056         outlist.append(run)
00057         outlist.append(evt)
00058     outDict=MakePair(outlist)
00059     return outDict
00060 


Variable Documentation

Definition at line 65 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList::defaultList = hcalLaserEventFilter.BadRunEventNumbers

Definition at line 64 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList::keys = defaultDict.keys()

Definition at line 66 of file GenerateHcalLaserBadRunList.py.

Definition at line 79 of file GenerateHcalLaserBadRunList.py.

Definition at line 82 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList::newkeys = newBadDict.keys()

Definition at line 86 of file GenerateHcalLaserBadRunList.py.

Definition at line 74 of file GenerateHcalLaserBadRunList.py.

Definition at line 89 of file GenerateHcalLaserBadRunList.py.

Definition at line 88 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList::out = open("badEvents.py",'w')

Definition at line 91 of file GenerateHcalLaserBadRunList.py.

Definition at line 93 of file GenerateHcalLaserBadRunList.py.