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 18 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 45 of file LumiList.py.

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

Member Function Documentation

def LumiList.LumiList.__add__ (   self,
  other 
)

Definition at line 167 of file LumiList.py.

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

Definition at line 119 of file LumiList.py.

References LumiList.LumiList.compactList.

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

Definition at line 325 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().

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

References LumiList.LumiList.compactList.

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

Definition at line 150 of file LumiList.py.

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

Definition at line 191 of file LumiList.py.

References LumiList.LumiList.compactList.

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

Definition at line 91 of file LumiList.py.

References LumiList.LumiList.compactList.

91 
92  def __sub__(self, other): # Things from self not in other
93  result = {}
94  for run in sorted(self.compactList.keys()):
95  alumis = sorted(self.compactList[run])
96  blumis = sorted(other.compactList.get(run, []))
97  alist = [] # verified part
98  for alumi in alumis:
99  tmplist = [alumi[0], alumi[1]] # may be part
100  for blumi in blumis:
101  if blumi[0] <= tmplist[0] and blumi[1] >= tmplist[1]: # blumi has all of alumi
102  tmplist = []
103  break # blumi is has all of alumi
104  if blumi[0] > tmplist[0] and blumi[1] < tmplist[1]: # blumi is part of alumi
105  alist.append([tmplist[0], blumi[0]-1])
106  tmplist = [blumi[1]+1, tmplist[1]]
107  elif blumi[0] <= tmplist[0] and blumi[1] < tmplist[1] and blumi[1]>=tmplist[0]: # overlaps start
108  tmplist = [blumi[1]+1, tmplist[1]]
109  elif blumi[0] > tmplist[0] and blumi[1] >= tmplist[1] and blumi[0]<=tmplist[1]: # overlaps end
110  alist.append([tmplist[0], blumi[0]-1])
111  tmplist = []
112  break
113  if tmplist:
114  alist.append(tmplist)
115  result[run] = alist
116 
117  return LumiList(compactList = result)
118 
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 227 of file LumiList.py.

References LumiList.LumiList.compactList.

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

228  def _getLumiParts(self):
229  """
230  Turn compactList into a list of the format
231  [ 'R1:L1', 'R2:L2-R2:L3' ] which is used by getCMSSWString and getVLuminosityBlockRange
232  """
233 
234  parts = []
235  runs = self.compactList.keys()
236  runs.sort(key=int)
237  for run in runs:
238  lumis = self.compactList[run]
239  for lumiPair in sorted(lumis):
240  if lumiPair[0] == lumiPair[1]:
241  parts.append("%s:%s" % (run, lumiPair[0]))
242  else:
243  parts.append("%s:%s-%s:%s" %
244  (run, lumiPair[0], run, lumiPair[1]))
245  return parts
246 
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 290 of file LumiList.py.

Referenced by LumiList.LumiList.__contains__().

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

176  def filterLumis(self, lumiList):
177  """
178  Return a list of lumis that are in compactList.
179  lumilist is of the simple form
180  [(run1,lumi1),(run1,lumi2),(run2,lumi1)]
181  """
182  filteredList = []
183  for (run, lumi) in lumiList:
184  runsInLumi = self.compactList.get(str(run), [[0, -1]])
185  for (first, last) in runsInLumi:
186  if lumi >= first and lumi <= last:
187  filteredList.append((run, lumi))
188  break
189  return filteredList
190 
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 247 of file LumiList.py.

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

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

Definition at line 197 of file LumiList.py.

References LumiList.LumiList.compactList.

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

Definition at line 204 of file LumiList.py.

References LumiList.LumiList.compactList.

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

Definition at line 220 of file LumiList.py.

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

Definition at line 258 of file LumiList.py.

References LumiList.LumiList._getLumiParts().

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

Definition at line 280 of file LumiList.py.

References LumiList.LumiList.compactList.

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

Definition at line 271 of file LumiList.py.

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

Member Data Documentation

LumiList.LumiList.compactList

Definition at line 50 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 52 of file LumiList.py.

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