CMS 3D CMS Logo

Functions | Variables
GenerateHcalLaserBadRunList Namespace Reference

Functions

def MakePair (startlist)
 
def ReadNewList (newlist)
 

Variables

 defaultDict
 
 defaultList
 
 keys
 
 lines
 
 newBadDict
 
 newkeys
 
 newlines
 
 notInNew
 
 notInOld
 
 out
 
 thistime
 

Function Documentation

def GenerateHcalLaserBadRunList.MakePair (   startlist)

Definition at line 15 of file GenerateHcalLaserBadRunList.py.

Referenced by ReadNewList().

15 def MakePair(startlist):
16  dict={}
17  for i in range(0,len(startlist),2):
18  key1=startlist[i]
19  key2=startlist[i+1]
20  runevent=(key1,key2)
21  dict[runevent]="%s,%s,"%(key1,key2)
22  return dict
23 
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.

References MakePair().

24 def ReadNewList(newlist):
25  ''' Read a new list of bad runs from an input file, and
26  creates a new list of output keys for the bad run/events.
27  '''
28  outlist=[]
29  for i in newlist:
30  temp=string.strip(i)
31  # Input is comma-separated
32  if temp.find(",")>-1:
33  temp=string.split(temp,",")
34  # Input is space-separated
35  else:
36  temp=string.split(temp)
37 
38  # Case 1: new input presented as "run lumi event" list
39  if len(temp)==3:
40  try:
41  run=string.atoi(temp[0])
42  evt=string.atoi(temp[2])
43  except:
44  print "Could not parse line '%s'"%i
45  # Case 2: new input presented as "run event" list
46  elif len(temp)==2:
47  try:
48  run=string.atoi(temp[0])
49  evt=string.atoi(temp[1])
50  except:
51  print "Could not parse line '%s'"%i
52  else:
53  print "Cannot parse line! ('%s')"%i
54  continue
55  outlist.append(run)
56  outlist.append(evt)
57  outDict=MakePair(outlist)
58  return outDict
59 
60 

Variable Documentation

GenerateHcalLaserBadRunList.defaultDict

Definition at line 65 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.defaultList

Definition at line 64 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.keys

Definition at line 66 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.lines

Definition at line 79 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.newBadDict

Definition at line 82 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.newkeys

Definition at line 86 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.newlines

Definition at line 74 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.notInNew

Definition at line 89 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.notInOld

Definition at line 88 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.out

Definition at line 91 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.thistime

Definition at line 93 of file GenerateHcalLaserBadRunList.py.