CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
GenerateHcalLaserBadRunList Namespace Reference

Functions

def MakePair
 
def ReadNewList
 

Variables

tuple defaultDict = MakePair(defaultList)
 
 defaultList = hcalLaserEventFilter.BadRunEventNumbers
 
tuple keys = sorted(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 18 of file GenerateHcalLaserBadRunList.py.

References sistrip::SpyUtilities.range().

Referenced by ReadNewList().

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

References MakePair(), and print().

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

Variable Documentation

tuple GenerateHcalLaserBadRunList.defaultDict = MakePair(defaultList)

Definition at line 68 of file GenerateHcalLaserBadRunList.py.

GenerateHcalLaserBadRunList.defaultList = hcalLaserEventFilter.BadRunEventNumbers

Definition at line 67 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList.keys = sorted(defaultDict.keys())

Definition at line 69 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList.lines = open(i,'r')

Definition at line 81 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList.newBadDict = ReadNewList(newlines)

Definition at line 84 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList.newkeys = newBadDict.keys()

Definition at line 88 of file GenerateHcalLaserBadRunList.py.

list GenerateHcalLaserBadRunList.newlines = []

Definition at line 76 of file GenerateHcalLaserBadRunList.py.

dictionary GenerateHcalLaserBadRunList.notInNew = {}

Definition at line 91 of file GenerateHcalLaserBadRunList.py.

dictionary GenerateHcalLaserBadRunList.notInOld = {}

Definition at line 90 of file GenerateHcalLaserBadRunList.py.

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

Definition at line 93 of file GenerateHcalLaserBadRunList.py.

tuple GenerateHcalLaserBadRunList.thistime = time.time()

Definition at line 95 of file GenerateHcalLaserBadRunList.py.