CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
printJSON.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 
3 import sys
4 from argparse import ArgumentParser
5 from FWCore.PythonUtilities.LumiList import LumiList
6 
7 if __name__ == '__main__':
8 
9  parser = ArgumentParser()
10  parser.add_argument('--range', dest='range', default=False, action='store_true',
11  help='Print out run range only')
12  parser.add_argument("alpha_json", metavar="alpha.json", type=str)
13  options = parser.parse_args()
14 
15  alphaList = LumiList (filename = options.alpha_json) # Read in first JSON file
16  if options.range:
17  keys = alphaList.compactList.keys()
18  minRun = min (keys)
19  maxRun = max (keys)
20  print("runs %s - %s" % (minRun, maxRun))
21  sys.exit()
22  print(alphaList)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47