CMS 3D CMS Logo

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.

00008                                :
00009     d={}
00010     for x in inlist:
00011         d[x]=x
00012     return d.values()

def lumiData2::main ( )

Definition at line 13 of file lumiData2.py.

00014           :
00015     parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description="list lumi data availability")
00016     # add required arguments
00017     parser.add_argument('-c',dest='connect',action='store',required=True,help='connect string to lumiDB')
00018     # add optional arguments
00019     parser.add_argument('-P',dest='authpath',action='store',help='path to authentication file')
00020     parser.add_argument('-siteconfpath',dest='siteconfpath',action='store',
00021                         default=None,
00022                         required=False,
00023                         help='specific path to site-local-config.xml file, optional. If path undefined, fallback to cern proxy&server')
00024     parser.add_argument('action',choices=['listrun'],help='command actions')
00025     parser.add_argument('--minrun',
00026                         dest='minrun',
00027                         action='store',
00028                         type=int,
00029                         help='min run number')
00030     parser.add_argument('--maxrun',
00031                         dest='maxrun',
00032                         action='store',
00033                         type=int,
00034                         help='max run number')
00035     parser.add_argument('--minfill',
00036                         dest='minfill',
00037                         type=int,
00038                         action='store',
00039                         help='min fill number')
00040     parser.add_argument('--maxfill',
00041                         dest='maxfill',
00042                         type=int,
00043                         action='store',
00044                         help='max fill number')
00045     parser.add_argument('--verbose',
00046                         dest='verbose',
00047                         action='store_true',
00048                         help='verbose mode for printing' )
00049     parser.add_argument('--debug',dest='debug',action='store_true',help='debug')
00050     # parse arguments
00051     options=parser.parse_args()
00052     if options.authpath:
00053         os.environ['CORAL_AUTH_PATH'] = options.authpath
00054     svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
00055     session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
00056     reqTrg=True
00057     reqHLT=False
00058     session.transaction().start(True)
00059     schema=session.nominalSchema()
00060     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)
00061     session.transaction().commit()
00062     if options.action == 'listrun':
00063             if not runlist:
00064                 print '[]'
00065                 sys.exit(0)
00066             singlelist=listRemoveDuplicate(runlist)
00067             singlelist.sort()
00068             print singlelist
00069     del session
    del svc

Variable Documentation

string lumiData2::VERSION = '2.00'

Definition at line 2 of file lumiData2.py.