test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
lumiData2 Namespace Reference

Functions

def listRemoveDuplicate
 
def main
 

Variables

string VERSION = '2.00'
 

Function Documentation

def lumiData2.listRemoveDuplicate (   inlist)

Definition at line 7 of file lumiData2.py.

Referenced by main().

7 
8 def listRemoveDuplicate(inlist):
9  d={}
10  for x in inlist:
11  d[x]=x
12  return d.values()
def listRemoveDuplicate
Definition: lumiData2.py:7
def lumiData2.main ( )

Definition at line 13 of file lumiData2.py.

References listRemoveDuplicate(), and lumiCalcAPI.runList().

13 
14 def main():
15  parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description="list lumi data availability")
16  # add required arguments
17  parser.add_argument('-c',dest='connect',action='store',required=True,help='connect string to lumiDB')
18  # add optional arguments
19  parser.add_argument('-P',dest='authpath',action='store',help='path to authentication file')
20  parser.add_argument('-siteconfpath',dest='siteconfpath',action='store',
21  default=None,
22  required=False,
23  help='specific path to site-local-config.xml file, optional. If path undefined, fallback to cern proxy&server')
24  parser.add_argument('action',choices=['listrun'],help='command actions')
25  parser.add_argument('--minrun',
26  dest='minrun',
27  action='store',
28  type=int,
29  help='min run number')
30  parser.add_argument('--maxrun',
31  dest='maxrun',
32  action='store',
33  type=int,
34  help='max run number')
35  parser.add_argument('--minfill',
36  dest='minfill',
37  type=int,
38  action='store',
39  help='min fill number')
40  parser.add_argument('--maxfill',
41  dest='maxfill',
42  type=int,
43  action='store',
44  help='max fill number')
45  parser.add_argument('--verbose',
46  dest='verbose',
47  action='store_true',
48  help='verbose mode for printing' )
49  parser.add_argument('--debug',dest='debug',action='store_true',help='debug')
50  # parse arguments
51  options=parser.parse_args()
52  if options.authpath:
53  os.environ['CORAL_AUTH_PATH'] = options.authpath
54  svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
55  session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
56  reqTrg=True
57  reqHLT=False
58  session.transaction().start(True)
59  schema=session.nominalSchema()
60  runlist=lumiCalcAPI.runList(schema,None,runmin=options.minrun,runmax=options.maxrun,startT=None,stopT=None,l1keyPattern=None,hltkeyPattern=None,amodetag=None,nominalEnergy=None,energyFlut=None,requiretrg=reqTrg,requirehlt=reqHLT)
61  session.transaction().commit()
62  if options.action == 'listrun':
63  if not runlist:
64  print '[]'
65  sys.exit(0)
66  singlelist=listRemoveDuplicate(runlist)
67  singlelist.sort()
68  print singlelist
69  del session
del svc
Definition: start.py:1
def main
Definition: lumiData2.py:13
def listRemoveDuplicate
Definition: lumiData2.py:7

Variable Documentation

string lumiData2.VERSION = '2.00'

Definition at line 2 of file lumiData2.py.