CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
csvLumibyLSParser.csvLumibyLSParser Class Reference
Inheritance diagram for csvLumibyLSParser.csvLumibyLSParser:

Public Member Functions

def __init__ (self, filename, RunX)
 
def numls (self, run)
 
def numruns (self)
 
def runs (self)
 
def runsandls (self)
 

Private Attributes

 __filename
 
 __result
 
 __RunX
 
 __strresult
 

Detailed Description

Definition at line 13 of file csvLumibyLSParser.py.

Constructor & Destructor Documentation

◆ __init__()

def csvLumibyLSParser.csvLumibyLSParser.__init__ (   self,
  filename,
  RunX 
)

Definition at line 14 of file csvLumibyLSParser.py.

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

Member Function Documentation

◆ numls()

def csvLumibyLSParser.csvLumibyLSParser.numls (   self,
  run 
)

Definition at line 94 of file csvLumibyLSParser.py.

94  def numls(self,run):
95  return len(self.__result[run])
96 

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

◆ numruns()

def csvLumibyLSParser.csvLumibyLSParser.numruns (   self)

◆ runs()

def csvLumibyLSParser.csvLumibyLSParser.runs (   self)

◆ runsandls()

def csvLumibyLSParser.csvLumibyLSParser.runsandls (   self)
return {run:lslist}

Definition at line 84 of file csvLumibyLSParser.py.

84  def runsandls(self):
85  '''return {run:lslist}
86  '''
87  return self.__result
88 # def runsandlsStr(self):
89 # '''return {'run':lslist}
90 # '''
91 # return self.__strresult

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

Member Data Documentation

◆ __filename

csvLumibyLSParser.csvLumibyLSParser.__filename
private

Definition at line 17 of file csvLumibyLSParser.py.

◆ __result

csvLumibyLSParser.csvLumibyLSParser.__result
private

◆ __RunX

csvLumibyLSParser.csvLumibyLSParser.__RunX
private

Definition at line 18 of file csvLumibyLSParser.py.

◆ __strresult

csvLumibyLSParser.csvLumibyLSParser.__strresult
private
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
csvLumibyLSParser.is_intstr
def is_intstr(s)
Definition: csvLumibyLSParser.py:7
str
#define str(s)
Definition: TestProcessor.cc:48
createfilelist.int
int
Definition: createfilelist.py:10
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66