Beispiel #1
0
def main(*args):
    parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description = "Lumi fake",formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-c',dest='connect',action='store',
                        required=True,
                        help='connect string to lumiDB,optional',
                        default=None)
    parser.add_argument('-P',dest='authpath',action='store',
                        required=True,
                        help='path to authentication file')
    parser.add_argument('-r',dest='runnumber',action='store',
                        type=int,
                        required=True,
                        help='run number')
    parser.add_argument('-isummary',dest='summaryfile',action='store',
                        required=True,
                        help='lumi summary file ')
    parser.add_argument('-idetail',dest='detailfile',action='store',
                        required=False,
                        help='lumi detail file ')
    parser.add_argument('--delivered-only',dest='deliveredonly',action='store_true',
                        help='without trigger' )
    #
    parser.add_argument('--debug',dest='debug',action='store_true',
                        help='debug')
    options=parser.parse_args()
    os.environ['CORAL_AUTH_PATH'] = options.authpath
        
    perlsrawdata=parseLSFile(options.summaryfile)
    
    #print perlsrawdata
    perbunchrawdata={}
    bxdistribution={}
    msg=coral.MessageStream('')
    msg.setMsgVerbosity(coral.message_Level_Error)
    svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
    dbsession=svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
    dbsession.transaction().start(True)
    oldlumidataid=dataDML.guessLumiDataIdByRunInBranch(dbsession.nominalSchema(),options.runnumber,'LUMIDATA','DATA')
    if oldlumidataid:
        perbunchrawdata=fetchOldData(dbsession.nominalSchema(),oldlumidataid)
    elif options.detailfile:
        bxdistribution=parsebunchFile(options.detailfile)
    dbsession.transaction().commit()
    #print perlsrawdata
    #print perbunchrawdata
    insertLumischemaV2(dbsession,options.runnumber,options.summaryfile,perlsrawdata,perbunchrawdata,bxdistribution,deliveredonly=options.deliveredonly)
    del dbsession
    del svc
Beispiel #2
0
def main(*args):
    parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description = "Lumi fake",formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('-c',dest='connect',action='store',
                        required=True,
                        help='connect string to lumiDB,optional',
                        default=None)
    parser.add_argument('-P',dest='authpath',action='store',
                        required=True,
                        help='path to authentication file')
    parser.add_argument('-r',dest='runnumber',action='store',
                        type=int,
                        required=True,
                        help='run number')
    parser.add_argument('-isummary',dest='summaryfile',action='store',
                        required=True,
                        help='lumi summary file ')
    parser.add_argument('-idetail',dest='detailfile',action='store',
                        required=False,
                        help='lumi detail file ')
    parser.add_argument('--delivered-only',dest='deliveredonly',action='store_true',
                        help='without trigger' )
    #
    parser.add_argument('--debug',dest='debug',action='store_true',
                        help='debug')
    options=parser.parse_args()
    os.environ['CORAL_AUTH_PATH'] = options.authpath
        
    perlsrawdata=parseLSFile(options.summaryfile)
    
    #print perlsrawdata
    perbunchrawdata={}
    bxdistribution={}
    msg=coral.MessageStream('')
    msg.setMsgVerbosity(coral.message_Level_Error)
    svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,debugON=options.debug)
    dbsession=svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
    dbsession.transaction().start(True)
    oldlumidataid=dataDML.guessLumiDataIdByRunInBranch(dbsession.nominalSchema(),options.runnumber,'LUMIDATA','DATA')
    if oldlumidataid:
        perbunchrawdata=fetchOldData(dbsession.nominalSchema(),oldlumidataid)
    elif options.detailfile:
        bxdistribution=parsebunchFile(options.detailfile)
    dbsession.transaction().commit()
    #print perlsrawdata
    #print perbunchrawdata
    insertLumischemaV2(dbsession,options.runnumber,options.summaryfile,perlsrawdata,perbunchrawdata,bxdistribution,deliveredonly=options.deliveredonly)
    del dbsession
    del svc
Beispiel #3
0
    parser.add_argument('-c',dest='connect',action='store',
                        required=True,
                        help='connect string to lumiDB (required)',
                        )
    parser.add_argument('-P',dest='authpath',action='store',
                        required=True,
                        help='path to authentication file (required)'
                        )
    parser.add_argument('-r',dest='runnum',action='store',
                        type=int,
                        required=True,
                        help='run number'
                        )
    parser.add_argument('--debug',dest='debug',action='store_true',
                        help='debug'
                        )
    
    options=parser.parse_args()
    svc=sessionManager.sessionManager(options.connect,
                                      authpath=options.authpath,
                                      debugON=options.debug)
    session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
    session.transaction().start(True)
    lumiIdInDATA=dataDML.guessLumiDataIdByRunInBranch(session.nominalSchema(),options.runnum,nameDealer.lumidataTableName(),branchName='DATA')
    print lumiIdInDATA
    lumiIdInPIXELLUMI=dataDML.guessLumiDataIdByRunInBranch(session.nominalSchema(),options.runnum,nameDealer.lumidataTableName(),branchName='PIXELLUMI')
    print lumiIdInPIXELLUMI
    session.transaction().commit()
    del session
    del svc