CMS 3D CMS Logo

Functions
util.rrClient Namespace Reference

Functions

def getRunsNewer (run, minLumis)
 

Function Documentation

def util.rrClient.getRunsNewer (   run,
  minLumis 
)

Definition at line 7 of file rrClient.py.

References indexGen.date, and createfilelist.int.

7 def getRunsNewer(run, minLumis):
8  try:
9  api = RRApi(URL)
10 
11  if api.app == "user":
12  result = api.data(workspace = 'GLOBAL',
13  table = 'runsummary',
14  template = 'json',
15  columns = [
16  'number',
17  'lsCount',
18  'startTime', 'duration',
19  'hltkey', 'gtKey', 'l1Menu', 'tscKey', 'triggerMode',
20  'triggers',
21  'runClassName',
22  ],
23  query = "{number} > %d and {lsCount} > %d and {triggers} > 0" % (run, minLumis),
24  )
25  runs = {}
26  for runDict in result :
27  runNo = int(runDict['number'])
28  runDict['date'] = datetime.datetime.strptime(runDict['startTime'], "%a %d-%m-%y %H:%M:%S").date().strftime('%Y%m%d')
29  runs[runNo] = runDict
30  return runs
31 
32  else :
33  print "RunRegistry API 'app' != user, who knows why... :<"
34 
35  except RRApiError as e:
36  print e
37 
def getRunsNewer(run, minLumis)
Definition: rrClient.py:7