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 16 of file GenerateHcalLaserBadRunList.py.

Referenced by ReadNewList().

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

References MakePair(), and edm.print().

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

Variable Documentation

GenerateHcalLaserBadRunList.defaultDict

Definition at line 66 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.defaultList

Definition at line 65 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.keys

Definition at line 67 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.