CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
csvLumibyLSParser.csvLumibyLSParser Class Reference
Inheritance diagram for csvLumibyLSParser.csvLumibyLSParser:

Public Member Functions

def __init__
 
def numls
 
def numruns
 
def runs
 
def runsandls
 

Private Attributes

 __filename
 
 __result
 
 __strresult
 

Detailed Description

Definition at line 12 of file csvLumibyLSParser.py.

Constructor & Destructor Documentation

def csvLumibyLSParser.csvLumibyLSParser.__init__ (   self,
  filename 
)

Definition at line 13 of file csvLumibyLSParser.py.

13 
14  def __init__(self,filename):
15  self.__result={}
16  self.__strresult={}
17  self.__filename=filename
18  csvReader=csv.reader(open(filename),delimiter=',')
19  oldRun=0
20  runnumber=0
21  ldict = {}
22  llist = []
23  NonValidLumi = 0
24  lastLumi = 0
25  for row in csvReader:
26  field0=str(row[0]).strip()
27  fieldsplit=re.split(':',field0)
28  runstring = fieldsplit[0]
29  try:
30  field1=str(row[1]).strip()
31  fieldsplit=re.split(':',field1)
32  lsstring = fieldsplit[0]
33  except Exception,e:
34  lsstring='1' # for list with run number only, fake lsnum
35  if not is_intstr(runstring) or not is_intstr(lsstring):
36  continue
37  runnumber=int(runstring)
38  lsnumber=int(lsstring)
39 
40  if runnumber != oldRun:
41  if oldRun>0:
42  self.__result[oldRun]=ldict
43  ldict = {}
44  oldRun = runnumber
45  lastLumi = 0
46  NonValidLumi = 0
47  else:
48  oldRun = runnumber
49 
50  try:
51  delivered, recorded = float( row[5] ), float( row[6] )
52  except:
53  print 'Record not parsed, Run = %d, LS = %d' % (runnumber, lsnumber)
54 
55 # Commented out... If there is no value, there is no interpolation now...
56 # if recorded>0 :
57 # lastLumi = recorded
58 # if NonValidLumi>0:
59 # # have to put real values in lumi list
60 # for lnum in llist:
61 # elems = [delivered, recorded]
62 # ldict[lnum] = elems
63 # NonValidLumi=0
64 # llist = []
65 # else:
66 # if lastLumi>0:
67 # recorded = lastLumi
68 # else:
69 # # have to save lumi sections to fill once we get a non-zero lumi value
70 # llist.append(lsnumber)
71 # NonValidLumi=1
72 
73  elems = [ delivered,recorded ]
74  ldict[lsnumber]=elems
75 
76  self.__result[runnumber]=ldict #catch the last one

Member Function Documentation

def csvLumibyLSParser.csvLumibyLSParser.numls (   self,
  run 
)

Definition at line 89 of file csvLumibyLSParser.py.

References csvLumibyLSParser.csvLumibyLSParser.__result, EgammaHLTValidationUtils.EgammaDQMModuleMaker.__result, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__result, and SequenceTypes._MutatingSequenceVisitor.__result.

89 
90  def numls(self,run):
91  return len(self.__result[run])
def csvLumibyLSParser.csvLumibyLSParser.numruns (   self)

Definition at line 87 of file csvLumibyLSParser.py.

87 
88  def numruns(self):
return len(self.__result.keys())
def csvLumibyLSParser.csvLumibyLSParser.runs (   self)

Definition at line 77 of file csvLumibyLSParser.py.

Referenced by inputFilesetParser.inputFilesetParser.selectedRunsWithoutresult(), and inputFilesetParser.inputFilesetParser.selectedRunsWithresult().

77 
78  def runs(self):
return self.__result.keys()
def csvLumibyLSParser.csvLumibyLSParser.runsandls (   self)
return {run:lslist}

Definition at line 79 of file csvLumibyLSParser.py.

References csvLumibyLSParser.csvLumibyLSParser.__result, EgammaHLTValidationUtils.EgammaDQMModuleMaker.__result, SequenceTypes._CopyAndExcludeSequenceVisitorOld.__result, and SequenceTypes._MutatingSequenceVisitor.__result.

79 
80  def runsandls(self):
81  '''return {run:lslist}
82  '''
83  return self.__result
84 # def runsandlsStr(self):
85 # '''return {'run':lslist}
86 # '''
# return self.__strresult

Member Data Documentation

csvLumibyLSParser.csvLumibyLSParser.__filename
private

Definition at line 16 of file csvLumibyLSParser.py.

Referenced by csvReporter.csvReporter.writeRow(), and csvReporter.csvReporter.writeRows().

csvLumibyLSParser.csvLumibyLSParser.__result
private

Definition at line 14 of file csvLumibyLSParser.py.

Referenced by selectionParser.selectionParser.numls(), csvSelectionParser.csvSelectionParser.numls(), pileupParser.pileupParser.numls(), csvLumibyLSParser.csvLumibyLSParser.numls(), selectionParser.selectionParser.runsandls(), csvSelectionParser.csvSelectionParser.runsandls(), pileupParser.pileupParser.runsandls(), and csvLumibyLSParser.csvLumibyLSParser.runsandls().

csvLumibyLSParser.csvLumibyLSParser.__strresult
private

Definition at line 15 of file csvLumibyLSParser.py.

Referenced by selectionParser.selectionParser.runsandlsStr(), csvSelectionParser.csvSelectionParser.runsandlsStr(), and pileupParser.pileupParser.runsandlsStr().