Definition at line 11 of file LumiGRLParser.py.
◆ __init__()
def python.LumiGRLParser.LumiGRLParser.__init__ |
( |
|
self, |
|
|
|
grlfile = None |
|
) |
| |
Definition at line 13 of file LumiGRLParser.py.
19 self.lumiRangeName =
None
32 if grlfile
is not None:
33 self.parseFile(grlfile)
◆ lumiBlockList()
def python.LumiGRLParser.LumiGRLParser.lumiBlockList |
( |
|
self, |
|
|
|
runnum |
|
) |
| |
Definition at line 128 of file LumiGRLParser.py.
128 def lumiBlockList(self, runnum):
131 for iov
in self.iovDict.
get(runnum, []):
132 lbList.extend(
range(iov[0], iov[1]))
◆ parseFile()
def python.LumiGRLParser.LumiGRLParser.parseFile |
( |
|
self, |
|
|
|
filename |
|
) |
| |
Definition at line 36 of file LumiGRLParser.py.
36 def parseFile(self, filename):
38 self.tree = ET.parse(filename)
45 if not self.selectRange():
46 print(
'LumiGRLParser.parseFile(%s) - Error selecting valid range!' % filename)
50 for lbc
in self.lumiRange.findall(
'LumiBlockCollection'):
51 runnum =
int(lbc.findtext(
'Run',
'-1'))
53 print(
"LumiGRLParser.parseFile(%s) - Couldn't find Run in valid LumiBlockCollection!" % filename)
56 self.runList.
append(runnum)
57 self.iovDict[runnum] = []
59 for lbr
in lbc.findall(
'LBRange'):
60 lbstart =
int(lbr.get(
'Start',
'-1'))
61 lbend =
int(lbr.get(
'End',
'-1'))
63 if lbstart < 0
or lbend < 0:
64 print(
"LumiGRLParser.parseFile(%s) - Couldn't find LBRange attributes for run %d!" % (filename, runnum))
69 self.iovDict[runnum].
append((lbstart, lbend))
71 iovstart = (runnum<<32)+lbstart
72 iovend = (runnum<<32)+lbend
73 self.iovList.
append((iovstart, iovend))
◆ selectRange()
def python.LumiGRLParser.LumiGRLParser.selectRange |
( |
|
self | ) |
|
Definition at line 79 of file LumiGRLParser.py.
79 def selectRange(self):
84 print(
'LumiGRLParser.selectRange() - no tree found!')
87 lumiRangeList = self.tree.findall(
'NamedLumiRange')
88 if len(lumiRangeList) == 1:
90 if self.lumiRangeName
is not None:
91 name = lumiRangeList[0].findtext(
'Name',
'')
93 if name != self.lumiRangeName:
94 print(
"LumiGRLParser.selectRange() - Can't find %s in GRL, only %s!" % (self.lumiRangeName, name))
97 self.lumiRange = lumiRangeList[0]
100 elif len(lumiRangeList) == 0:
102 print(
'LumiGRLParser.selectRange() - No NamedLumiRange object found!')
106 if self.lumiRangeName
is None:
107 print(
'LumiGRLParser.selectRange() - %d NamedLumiRange objects found, but no lumiRangeName specified!' % len(lumiRangeList))
113 for lbr
in lumiRangeList:
114 name = lbr.findtext(
'Name',
'')
116 if self.lumiRangeName == name:
122 print(
"LumiGRLParser.selectRange() - Couldn't find %s in available NamedLumiRange objects!" % self.lumiRangeName)
◆ iovDict
python.LumiGRLParser.LumiGRLParser.iovDict |
◆ iovList
python.LumiGRLParser.LumiGRLParser.iovList |
◆ lumiRange
python.LumiGRLParser.LumiGRLParser.lumiRange |
◆ lumiRangeName
python.LumiGRLParser.LumiGRLParser.lumiRangeName |
◆ runList
python.LumiGRLParser.LumiGRLParser.runList |
◆ tree
python.LumiGRLParser.LumiGRLParser.tree |
The documentation for this class was generated from the following file: