CMS 3D CMS Logo

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

Public Member Functions

def __add__
 
def __and__
 
def __contains__
 
def __init__
 
def __len__
 
def __or__
 
def __str__
 
def __sub__
 
def contains
 
def filterLumis
 
def getCMSSWString
 
def getCompactList
 
def getLumis
 
def getRuns
 
def getVLuminosityBlockRange
 
def removeRuns
 
def writeJSON
 

Public Attributes

 compactList
 
 filename
 

Private Member Functions

def _getLumiParts
 

Detailed Description

Deal with lists of lumis in several different forms:
Compact list:
    {
    '1': [[1, 33], [35, 35], [37, 47], [49, 75], [77, 130], [133, 136]],
    '2':[[1,45],[50,80]]
    }
    where the first key is the run number, subsequent pairs are
    ranges of lumis within that run that are desired
Runs and lumis:
    {
    '1': [1,2,3,4,6,7,8,9,10],
    '2': [1,4,5,20]
    }
    where the first key is the run number and the list is a list of
    individual lumi sections
Run  lumi pairs:
    [[1,1], [1,2],[1,4], [2,1], [2,5], [1,10]]
    where each pair in the list is an individual run&lumi
CMSSW representation:
    '1:1-1:33,1:35,1:37-1:47,2:1-2:45,2:50-2:80'
    The string used by CMSSW in lumisToProcess or lumisToSkip
    is a subset of the compactList example above

Definition at line 16 of file LumiList.py.

Constructor & Destructor Documentation

def LumiList.LumiList.__init__ (   self,
  filename = None,
  lumis = None,
  runsAndLumis = None,
  runs = None,
  compactList = None 
)
Constructor takes filename (JSON), a list of run/lumi pairs,
or a dict with run #'s as the keys and a list of lumis as the values, or just a list of runs

Definition at line 43 of file LumiList.py.

43 
44  def __init__(self, filename = None, lumis = None, runsAndLumis = None, runs = None, compactList = None):
45  """
46  Constructor takes filename (JSON), a list of run/lumi pairs,
47  or a dict with run #'s as the keys and a list of lumis as the values, or just a list of runs
48  """
49  self.compactList = {}
50  if filename:
51  self.filename = filename
52  jsonFile = open(self.filename,'r')
53  self.compactList = json.load(jsonFile)
54  elif lumis:
55  runsAndLumis = {}
56  for (run, lumi) in lumis:
57  run = str(run)
58  if not runsAndLumis.has_key(run):
59  runsAndLumis[run] = []
60  runsAndLumis[run].append(lumi)
61 
62  if runsAndLumis:
63  for run in runsAndLumis.keys():
64  runString = str(run)
65  lastLumi = -1000
66  lumiList = runsAndLumis[run]
67  if lumiList:
68  self.compactList[runString] = []
69  for lumi in sorted(lumiList):
70  if lumi == lastLumi:
71  pass # Skip duplicates
72  elif lumi != lastLumi + 1: # Break in lumi sequence
73  self.compactList[runString].append([lumi, lumi])
74  else:
75  nRange = len(self.compactList[runString])
76  self.compactList[runString][nRange-1][1] = lumi
77  lastLumi = lumi
78  if runs:
79  for run in runs:
80  runString = str(run)
81  self.compactList[runString] = [[1, 0xFFFFFFF]]
82 
83  if compactList:
84  for run in compactList.keys():
85  runString = str(run)
86  if compactList[run]:
87  self.compactList[runString] = compactList[run]
88 

Member Function Documentation

def LumiList.LumiList.__add__ (   self,
  other 
)

Definition at line 165 of file LumiList.py.

166  def __add__(self, other):
167  # + is the same as |
168  return self|other
def LumiList.LumiList.__and__ (   self,
  other 
)

Definition at line 117 of file LumiList.py.

References LumiList.LumiList.compactList.

118  def __and__(self, other): # Things in both
119  result = {}
120  aruns = set(self.compactList.keys())
121  bruns = set(other.compactList.keys())
122  for run in aruns & bruns:
123  lumiList = [] # List for this run
124  unique = [] # List for this run
125  for alumi in self.compactList[run]:
126  for blumi in other.compactList[run]:
127  if blumi[0] <= alumi[0] and blumi[1] >= alumi[1]: # blumi has all of alumi
128  lumiList.append(alumi)
129  if blumi[0] > alumi[0] and blumi[1] < alumi[1]: # blumi is part of alumi
130  lumiList.append(blumi)
131  elif blumi[0] <= alumi[0] and blumi[1] < alumi[1] and blumi[1] >= alumi[0]: # overlaps start
132  lumiList.append([alumi[0], blumi[1]])
133  elif blumi[0] > alumi[0] and blumi[1] >= alumi[1] and blumi[0] <= alumi[1]: # overlaps end
134  lumiList.append([blumi[0], alumi[1]])
135 
136 
137  if lumiList:
138  unique = [lumiList[0]]
139  for pair in lumiList[1:]:
140  if pair[0] == unique[-1][1]+1:
141  unique[-1][1] = pair[1]
142  else:
143  unique.append(pair)
144 
145  result[run] = unique
146  return LumiList(compactList = result)
147 
def LumiList.LumiList.__contains__ (   self,
  runTuple 
)

Definition at line 323 of file LumiList.py.

References edm::Association< C >.contains(), edm::helper::IndexRangeAssociation.contains(), FWGeometry.contains(), edm::ValueMap< T >.contains(), edm::MultiAssociation< C >.contains(), and LumiList.LumiList.contains().

324  def __contains__ (self, runTuple):
325  return self.contains (runTuple)
326 
327 
328 
329 '''
330 # Unit test code
331 import unittest
332 import FWCore.ParameterSet.Config as cms
333 
334 class LumiListTest(unittest.TestCase):
335  """
336  _LumiListTest_
337 
338  """
339 
340  def testRead(self):
341  """
342  Test reading from JSON
343  """
344  exString = "1:1-1:33,1:35,1:37-1:47,2:49-2:75,2:77-2:130,2:133-2:136"
345  exDict = {'1': [[1, 33], [35, 35], [37, 47]],
346  '2': [[49, 75], [77, 130], [133, 136]]}
347  exVLBR = cms.VLuminosityBlockRange('1:1-1:33', '1:35', '1:37-1:47', '2:49-2:75', '2:77-2:130', '2:133-2:136')
348 
349  jsonList = LumiList(filename = 'lumiTest.json')
350  lumiString = jsonList.getCMSSWString()
351  lumiList = jsonList.getCompactList()
352  lumiVLBR = jsonList.getVLuminosityBlockRange(True)
353 
354  self.assertTrue(lumiString == exString)
355  self.assertTrue(lumiList == exDict)
356  self.assertTrue(lumiVLBR == exVLBR)
357 
358  def testList(self):
359  """
360  Test constucting from list of pairs
361  """
362 
363  listLs1 = range(1, 34) + [35] + range(37, 48)
364  listLs2 = range(49, 76) + range(77, 131) + range(133, 137)
365  lumis = zip([1]*100, listLs1) + zip([2]*100, listLs2)
366 
367  jsonLister = LumiList(filename = 'lumiTest.json')
368  jsonString = jsonLister.getCMSSWString()
369  jsonList = jsonLister.getCompactList()
370 
371  pairLister = LumiList(lumis = lumis)
372  pairString = pairLister.getCMSSWString()
373  pairList = pairLister.getCompactList()
374 
375  self.assertTrue(jsonString == pairString)
376  self.assertTrue(jsonList == pairList)
377 
378 
379  def testRuns(self):
380  """
381  Test constucting from run and list of lumis
382  """
383  runsAndLumis = {
384  1: range(1, 34) + [35] + range(37, 48),
385  2: range(49, 76) + range(77, 131) + range(133, 137)
386  }
387  runsAndLumis2 = {
388  '1': range(1, 34) + [35] + range(37, 48),
389  '2': range(49, 76) + range(77, 131) + range(133, 137)
390  }
391  blank = {
392  '1': [],
393  '2': []
394  }
395 
396  jsonLister = LumiList(filename = 'lumiTest.json')
397  jsonString = jsonLister.getCMSSWString()
398  jsonList = jsonLister.getCompactList()
399 
400  runLister = LumiList(runsAndLumis = runsAndLumis)
401  runString = runLister.getCMSSWString()
402  runList = runLister.getCompactList()
403 
404  runLister2 = LumiList(runsAndLumis = runsAndLumis2)
405  runList2 = runLister2.getCompactList()
406 
407  runLister3 = LumiList(runsAndLumis = blank)
408 
409 
410  self.assertTrue(jsonString == runString)
411  self.assertTrue(jsonList == runList)
412  self.assertTrue(runList2 == runList)
413  self.assertTrue(len(runLister3) == 0)
414 
415  def testFilter(self):
416  """
417  Test filtering of a list of lumis
418  """
419  runsAndLumis = {
420  1: range(1, 34) + [35] + range(37, 48),
421  2: range(49, 76) + range(77, 131) + range(133, 137)
422  }
423 
424  completeList = zip([1]*150, range(1, 150)) + \
425  zip([2]*150, range(1, 150)) + \
426  zip([3]*150, range(1, 150))
427 
428  smallList = zip([1]*50, range(1, 10)) + zip([2]*50, range(50, 70))
429  overlapList = zip([1]*150, range(30, 40)) + \
430  zip([2]*150, range(60, 80))
431  overlapRes = zip([1]*9, range(30, 34)) + [(1, 35)] + \
432  zip([1]*9, range(37, 40)) + \
433  zip([2]*30, range(60, 76)) + \
434  zip([2]*9, range(77, 80))
435 
436  runLister = LumiList(runsAndLumis = runsAndLumis)
437 
438  # Test a list to be filtered which is a superset of constructed list
439  filterComplete = runLister.filterLumis(completeList)
440  # Test a list to be filtered which is a subset of constructed list
441  filterSmall = runLister.filterLumis(smallList)
442  # Test a list to be filtered which is neither
443  filterOverlap = runLister.filterLumis(overlapList)
444 
445  self.assertTrue(filterComplete == runLister.getLumis())
446  self.assertTrue(filterSmall == smallList)
447  self.assertTrue(filterOverlap == overlapRes)
448 
449  def testDuplicates(self):
450  """
451  Test a list with lots of duplicates
452  """
453  result = zip([1]*100, range(1, 34) + range(37, 48))
454  lumis = zip([1]*100, range(1, 34) + range(37, 48) + range(5, 25))
455 
456  lister = LumiList(lumis = lumis)
457  self.assertTrue(lister.getLumis() == result)
458 
459  def testNull(self):
460  """
461  Test a null list
462  """
463 
464  runLister = LumiList(lumis = None)
465 
466  self.assertTrue(runLister.getCMSSWString() == '')
467  self.assertTrue(runLister.getLumis() == [])
468  self.assertTrue(runLister.getCompactList() == {})
469 
470  def testSubtract(self):
471  """
472  a-b for lots of cases
473  """
474 
475  alumis = {'1' : range(2,20) + range(31,39) + range(45,49),
476  '2' : range(6,20) + range (30,40),
477  '3' : range(10,20) + range (30,40) + range(50,60),
478  }
479  blumis = {'1' : range(1,6) + range(12,13) + range(16,30) + range(40,50) + range(33,36),
480  '2' : range(10,35),
481  '3' : range(10,15) + range(35,40) + range(45,51) + range(59,70),
482  }
483  clumis = {'1' : range(1,6) + range(12,13) + range(16,30) + range(40,50) + range(33,36),
484  '2' : range(10,35),
485  }
486  result = {'1' : range(6,12) + range(13,16) + range(31,33) + range(36,39),
487  '2' : range(6,10) + range(35,40),
488  '3' : range(15,20) + range(30,35) + range(51,59),
489  }
490  result2 = {'1' : range(6,12) + range(13,16) + range(31,33) + range(36,39),
491  '2' : range(6,10) + range(35,40),
492  '3' : range(10,20) + range (30,40) + range(50,60),
493  }
494  a = LumiList(runsAndLumis = alumis)
495  b = LumiList(runsAndLumis = blumis)
496  c = LumiList(runsAndLumis = clumis)
497  r = LumiList(runsAndLumis = result)
498  r2 = LumiList(runsAndLumis = result2)
499 
500  self.assertTrue((a-b).getCMSSWString() == r.getCMSSWString())
501  self.assertTrue((a-b).getCMSSWString() != (b-a).getCMSSWString())
502  # Test where c is missing runs from a
503  self.assertTrue((a-c).getCMSSWString() == r2.getCMSSWString())
504  self.assertTrue((a-c).getCMSSWString() != (c-a).getCMSSWString())
505  # Test empty lists
506  self.assertTrue(str(a-a) == '{}')
507  self.assertTrue(len(a-a) == 0)
508 
509  def testOr(self):
510  """
511  a|b for lots of cases
512  """
513 
514  alumis = {'1' : range(2,20) + range(31,39) + range(45,49),
515  '2' : range(6,20) + range (30,40),
516  '3' : range(10,20) + range (30,40) + range(50,60),
517  }
518  blumis = {'1' : range(1,6) + range(12,13) + range(16,30) + range(40,50) + range(39,80),
519  '2' : range(10,35),
520  '3' : range(10,15) + range(35,40) + range(45,51) + range(59,70),
521  }
522  clumis = {'1' : range(1,6) + range(12,13) + range(16,30) + range(40,50) + range(39,80),
523  '2' : range(10,35),
524  }
525  result = {'1' : range(2,20) + range(31,39) + range(45,49) + range(1,6) + range(12,13) + range(16,30) + range(40,50) + range(39,80),
526  '2' : range(6,20) + range (30,40) + range(10,35),
527  '3' : range(10,20) + range (30,40) + range(50,60) + range(10,15) + range(35,40) + range(45,51) + range(59,70),
528  }
529  a = LumiList(runsAndLumis = alumis)
530  b = LumiList(runsAndLumis = blumis)
531  c = LumiList(runsAndLumis = blumis)
532  r = LumiList(runsAndLumis = result)
533  self.assertTrue((a|b).getCMSSWString() == r.getCMSSWString())
534  self.assertTrue((a|b).getCMSSWString() == (b|a).getCMSSWString())
535  self.assertTrue((a|b).getCMSSWString() == (a+b).getCMSSWString())
536 
537 
538  def testAnd(self):
539  """
540  a&b for lots of cases
541  """
542 
543  alumis = {'1' : range(2,20) + range(31,39) + range(45,49),
544  '2' : range(6,20) + range (30,40),
545  '3' : range(10,20) + range (30,40) + range(50,60),
546  '4' : range(1,100),
547  }
548  blumis = {'1' : range(1,6) + range(12,13) + range(16,25) + range(25,40) + range(40,50) + range(33,36),
549  '2' : range(10,35),
550  '3' : range(10,15) + range(35,40) + range(45,51) + range(59,70),
551  '5' : range(1,100),
552  }
553  result = {'1' : range(2,6) + range(12,13) + range(16,20) + range(31,39) + range(45,49),
554  '2' : range(10,20) + range(30,35),
555  '3' : range(10,15) + range(35,40) + range(50,51)+ range(59,60),
556  }
557  a = LumiList(runsAndLumis = alumis)
558  b = LumiList(runsAndLumis = blumis)
559  r = LumiList(runsAndLumis = result)
560  self.assertTrue((a&b).getCMSSWString() == r.getCMSSWString())
561  self.assertTrue((a&b).getCMSSWString() == (b&a).getCMSSWString())
562  self.assertTrue((a|b).getCMSSWString() != r.getCMSSWString())
563 
564  def testWrite(self):
565  alumis = {'1' : range(2,20) + range(31,39) + range(45,49),
566  '2' : range(6,20) + range (30,40),
567  '3' : range(10,20) + range (30,40) + range(50,60),
568  '4' : range(1,100),
569  }
570  a = LumiList(runsAndLumis = alumis)
571  a.writeJSON('newFile.json')
572 
573 
574 if __name__ == '__main__':
575  jsonFile = open('lumiTest.json','w')
576  jsonFile.write('{"1": [[1, 33], [35, 35], [37, 47]], "2": [[49, 75], [77, 130], [133, 136]]}')
577  jsonFile.close()
578  unittest.main()
579 '''
580 # Test JSON file
581 
582 #{"1": [[1, 33], [35, 35], [37, 47]], "2": [[49, 75], [77, 130], [133, 136]]}
def LumiList.LumiList.__len__ (   self)
Returns number of runs in list

Definition at line 169 of file LumiList.py.

References LumiList.LumiList.compactList.

170  def __len__(self):
171  '''Returns number of runs in list'''
172  return len(self.compactList)
def LumiList.LumiList.__or__ (   self,
  other 
)

Definition at line 148 of file LumiList.py.

149  def __or__(self, other):
150  result = {}
151  aruns = self.compactList.keys()
152  bruns = other.compactList.keys()
153  runs = set(aruns + bruns)
154  for run in runs:
155  overlap = sorted(self.compactList.get(run, []) + other.compactList.get(run, []))
156  unique = [overlap[0]]
157  for pair in overlap[1:]:
158  if pair[0] >= unique[-1][0] and pair[0] <= unique[-1][1]+1 and pair[1] > unique[-1][1]:
159  unique[-1][1] = pair[1]
160  elif pair[0] > unique[-1][1]:
161  unique.append(pair)
162  result[run] = unique
163  return LumiList(compactList = result)
164 
def LumiList.LumiList.__str__ (   self)

Definition at line 189 of file LumiList.py.

References LumiList.LumiList.compactList.

190  def __str__ (self):
191  doubleBracketRE = re.compile (r']],')
192  return doubleBracketRE.sub (']],\n',
193  json.dumps (self.compactList,
194  sort_keys=True))
def LumiList.LumiList.__sub__ (   self,
  other 
)

Definition at line 89 of file LumiList.py.

References LumiList.LumiList.compactList.

89 
90  def __sub__(self, other): # Things from self not in other
91  result = {}
92  for run in sorted(self.compactList.keys()):
93  alumis = sorted(self.compactList[run])
94  blumis = sorted(other.compactList.get(run, []))
95  alist = [] # verified part
96  for alumi in alumis:
97  tmplist = [alumi[0], alumi[1]] # may be part
98  for blumi in blumis:
99  if blumi[0] <= tmplist[0] and blumi[1] >= tmplist[1]: # blumi has all of alumi
100  tmplist = []
101  break # blumi is has all of alumi
102  if blumi[0] > tmplist[0] and blumi[1] < tmplist[1]: # blumi is part of alumi
103  alist.append([tmplist[0], blumi[0]-1])
104  tmplist = [blumi[1]+1, tmplist[1]]
105  elif blumi[0] <= tmplist[0] and blumi[1] < tmplist[1] and blumi[1]>=tmplist[0]: # overlaps start
106  tmplist = [blumi[1]+1, tmplist[1]]
107  elif blumi[0] > tmplist[0] and blumi[1] >= tmplist[1] and blumi[0]<=tmplist[1]: # overlaps end
108  alist.append([tmplist[0], blumi[0]-1])
109  tmplist = []
110  break
111  if tmplist:
112  alist.append(tmplist)
113  result[run] = alist
114 
115  return LumiList(compactList = result)
116 
def LumiList.LumiList._getLumiParts (   self)
private
Turn compactList into a list of the format
[ 'R1:L1', 'R2:L2-R2:L3' ] which is used by getCMSSWString and getVLuminosityBlockRange

Definition at line 225 of file LumiList.py.

References LumiList.LumiList.compactList.

Referenced by LumiList.LumiList.getCMSSWString(), and LumiList.LumiList.getVLuminosityBlockRange().

226  def _getLumiParts(self):
227  """
228  Turn compactList into a list of the format
229  [ 'R1:L1', 'R2:L2-R2:L3' ] which is used by getCMSSWString and getVLuminosityBlockRange
230  """
231 
232  parts = []
233  runs = self.compactList.keys()
234  runs.sort(key=int)
235  for run in runs:
236  lumis = self.compactList[run]
237  for lumiPair in sorted(lumis):
238  if lumiPair[0] == lumiPair[1]:
239  parts.append("%s:%s" % (run, lumiPair[0]))
240  else:
241  parts.append("%s:%s-%s:%s" %
242  (run, lumiPair[0], run, lumiPair[1]))
243  return parts
244 
def LumiList.LumiList.contains (   self,
  run,
  lumiSection = None 
)
returns true if the run, lumi section passed in is contained
in this lumiList.  Input can be either:
- a single tuple of (run, lumi),
- separate run and lumi numbers
- a single run number (returns true if any lumi sections exist)

Definition at line 288 of file LumiList.py.

Referenced by LumiList.LumiList.__contains__().

289  def contains (self, run, lumiSection = None):
290  '''
291  returns true if the run, lumi section passed in is contained
292  in this lumiList. Input can be either:
293  - a single tuple of (run, lumi),
294  - separate run and lumi numbers
295  - a single run number (returns true if any lumi sections exist)
296  '''
297  if lumiSection is None:
298  # if this is an integer or a string, see if the run exists
299  if isinstance (run, int) or isinstance (run, str):
300  return self.compactList.has_key( str(run) )
301  # if we're here, then run better be a tuple or list
302  try:
303  lumiSection = run[1]
304  run = run[0]
305  except:
306  raise RuntimeError, "Improper format for run '%s'" % run
307  lumiRangeList = self.compactList.get( str(run) )
308  if not lumiRangeList:
309  # the run isn't there, so no need to look any further
310  return False
311  for lumiRange in lumiRangeList:
312  # we want to make this as found if either the lumiSection
313  # is inside the range OR if the lumi section is greater
314  # than or equal to the lower bound of the lumi range and
315  # the upper bound is 0 (which means extends to the end of
316  # the run)
317  if lumiRange[0] <= lumiSection and \
318  (0 == lumiRange[1] or lumiSection <= lumiRange[1]):
319  # got it
320  return True
321  return False
322 
def LumiList.LumiList.filterLumis (   self,
  lumiList 
)
Return a list of lumis that are in compactList.
lumilist is of the simple form
[(run1,lumi1),(run1,lumi2),(run2,lumi1)]

Definition at line 173 of file LumiList.py.

174  def filterLumis(self, lumiList):
175  """
176  Return a list of lumis that are in compactList.
177  lumilist is of the simple form
178  [(run1,lumi1),(run1,lumi2),(run2,lumi1)]
179  """
180  filteredList = []
181  for (run, lumi) in lumiList:
182  runsInLumi = self.compactList.get(str(run), [[0, -1]])
183  for (first, last) in runsInLumi:
184  if lumi >= first and lumi <= last:
185  filteredList.append((run, lumi))
186  break
187  return filteredList
188 
def LumiList.LumiList.getCMSSWString (   self)
Turn compactList into a list of the format
R1:L1,R2:L2-R2:L3 which is acceptable to CMSSW LumiBlockRange variable

Definition at line 245 of file LumiList.py.

References LumiList.LumiList._getLumiParts(), and join().

246  def getCMSSWString(self):
247  """
248  Turn compactList into a list of the format
249  R1:L1,R2:L2-R2:L3 which is acceptable to CMSSW LumiBlockRange variable
250  """
251 
252  parts = self._getLumiParts()
253  output = ','.join(parts)
254  return str(output)
255 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def LumiList.LumiList.getCompactList (   self)
Return the compact list representation

Definition at line 195 of file LumiList.py.

References LumiList.LumiList.compactList.

196  def getCompactList(self):
197  """
198  Return the compact list representation
199  """
200  return self.compactList
201 
def LumiList.LumiList.getLumis (   self)
Return the list of pairs representation

Definition at line 202 of file LumiList.py.

References LumiList.LumiList.compactList.

203  def getLumis(self):
204  """
205  Return the list of pairs representation
206  """
207  theList = []
208  runs = self.compactList.keys()
209  runs.sort(key=int)
210  for run in runs:
211  lumis = self.compactList[run]
212  for lumiPair in sorted(lumis):
213  for lumi in range(lumiPair[0], lumiPair[1]+1):
214  theList.append((int(run), lumi))
215 
216  return theList
217 
def LumiList.LumiList.getRuns (   self)
return the sorted list of runs contained

Definition at line 218 of file LumiList.py.

219  def getRuns(self):
220  '''
221  return the sorted list of runs contained
222  '''
223  return sorted (self.compactList.keys())
224 
def LumiList.LumiList.getVLuminosityBlockRange (   self,
  tracked = False 
)
Turn compactList into an (optionally tracked) VLuminosityBlockRange

Definition at line 256 of file LumiList.py.

References LumiList.LumiList._getLumiParts().

257  def getVLuminosityBlockRange(self, tracked = False):
258  """
259  Turn compactList into an (optionally tracked) VLuminosityBlockRange
260  """
261 
262  import FWCore.ParameterSet.Config as cms
263  parts = self._getLumiParts()
264  if tracked:
265  return cms.VLuminosityBlockRange(parts)
266  else:
267  return cms.untracked.VLuminosityBlockRange(parts)
268 
def getVLuminosityBlockRange
Definition: LumiList.py:256
def LumiList.LumiList.removeRuns (   self,
  runList 
)
removes runs from runList from collection

Definition at line 278 of file LumiList.py.

References LumiList.LumiList.compactList.

279  def removeRuns (self, runList):
280  '''
281  removes runs from runList from collection
282  '''
283  for run in runList:
284  run = str(run)
285  if self.compactList.has_key (run):
286  del self.compactList[run]
287 
def LumiList.LumiList.writeJSON (   self,
  fileName 
)
Write out a JSON file representation of the object

Definition at line 269 of file LumiList.py.

270  def writeJSON(self, fileName):
271  """
272  Write out a JSON file representation of the object
273  """
274  jsonFile = open(fileName,'w')
275  jsonFile.write("%s\n" % self)
276  jsonFile.close()
277 

Member Data Documentation

LumiList.LumiList.compactList

Definition at line 48 of file LumiList.py.

Referenced by LumiList.LumiList.__and__(), LumiList.LumiList.__len__(), LumiList.LumiList.__str__(), LumiList.LumiList.__sub__(), LumiList.LumiList._getLumiParts(), LumiList.LumiList.getCompactList(), LumiList.LumiList.getLumis(), and LumiList.LumiList.removeRuns().

LumiList.LumiList.filename

Definition at line 50 of file LumiList.py.

Referenced by cuy.ValElement.__init__(), python.rootplot.rootmath.Target.__repr__(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.properties(), and utils.unpickler.run().