CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
util.rrClient Namespace Reference

Functions

def getRunsNewer
 

Variables

string URL = "http://runregistry.web.cern.ch/runregistry/"
 

Function Documentation

def util.rrClient.getRunsNewer (   run,
  minLumis 
)

Definition at line 8 of file rrClient.py.

References print().

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

Variable Documentation

string util.rrClient.URL = "http://runregistry.web.cern.ch/runregistry/"

Definition at line 6 of file rrClient.py.