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

◆ MakePair()

def GenerateHcalLaserBadRunList.MakePair (   startlist)

Definition at line 18 of file GenerateHcalLaserBadRunList.py.

References isotrackApplyRegressor.range.

Referenced by ReadNewList().

18 def MakePair(startlist):
19  dict={}
20  for i in range(0,len(startlist),2):
21  key1=startlist[i]
22  key2=startlist[i+1]
23  runevent=(key1,key2)
24  dict[runevent]="%s,%s,"%(key1,key2)
25  return dict
26 

◆ ReadNewList()

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

Variable Documentation

◆ defaultDict

GenerateHcalLaserBadRunList.defaultDict

Definition at line 68 of file GenerateHcalLaserBadRunList.py.

◆ defaultList

GenerateHcalLaserBadRunList.defaultList

Definition at line 67 of file GenerateHcalLaserBadRunList.py.

◆ keys

GenerateHcalLaserBadRunList.keys

Definition at line 69 of file GenerateHcalLaserBadRunList.py.

◆ lines

GenerateHcalLaserBadRunList.lines

Definition at line 81 of file GenerateHcalLaserBadRunList.py.

◆ newBadDict

GenerateHcalLaserBadRunList.newBadDict

Definition at line 84 of file GenerateHcalLaserBadRunList.py.

◆ newkeys

GenerateHcalLaserBadRunList.newkeys

Definition at line 88 of file GenerateHcalLaserBadRunList.py.

◆ newlines

GenerateHcalLaserBadRunList.newlines

Definition at line 76 of file GenerateHcalLaserBadRunList.py.

◆ notInNew

GenerateHcalLaserBadRunList.notInNew

Definition at line 91 of file GenerateHcalLaserBadRunList.py.

◆ notInOld

GenerateHcalLaserBadRunList.notInOld

Definition at line 90 of file GenerateHcalLaserBadRunList.py.

◆ out

GenerateHcalLaserBadRunList.out

Definition at line 93 of file GenerateHcalLaserBadRunList.py.

◆ thistime

GenerateHcalLaserBadRunList.thistime

Definition at line 95 of file GenerateHcalLaserBadRunList.py.