def lumi_context(action, runs_lumis):
    svc = sessionManager.sessionManager('frontier://LumiCalc/CMS_LUMI_PROD')
    session = svc.openSession(isReadOnly=True, cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
    session.transaction().start(True)

    datatagid, datatagname = revisionDML.currentDataTag(session.nominalSchema())
    dataidmap = revisionDML.dataIdsByTagId(session.nominalSchema(), datatagid, runlist=runs_lumis.keys(), withcomment=False)
    assert dataidmap

    session.transaction().commit()

    if action == 'trgbyls':
        session.transaction().start(True)
        result = lumiCalcAPI.trgForIds(session.nominalSchema(), runs_lumis, dataidmap, trgbitname=None, trgbitnamepattern='*', withL1Count=False, withPrescale=True)
        session.transaction().commit()
    elif action == 'hltbyls':
        session.transaction().start(True)
        result = lumiCalcAPI.hltForIds(session.nominalSchema(), runs_lumis, dataidmap, hltpathname=None, hltpathpattern='*', withL1Pass=False, withHLTAccept=False)
        session.transaction().commit()
    elif action == 'hltmenu':
        session.transaction().start(True)
        result = lumiCalcAPI.hltpathsForRange(session.nominalSchema(), runs_lumis, hltpathname=None, hltpathpattern='*')
        session.transaction().commit()
    del session
    del svc

    return result
def lumi_context(action, runs_lumis):
    svc = sessionManager.sessionManager('frontier://LumiCalc/CMS_LUMI_PROD')
    session = svc.openSession(isReadOnly=True,
                              cpp2sqltype=[('unsigned int', 'NUMBER(10)'),
                                           ('unsigned long long', 'NUMBER(20)')
                                           ])
    session.transaction().start(True)

    datatagid, datatagname = revisionDML.currentDataTag(
        session.nominalSchema())
    dataidmap = revisionDML.dataIdsByTagId(session.nominalSchema(),
                                           datatagid,
                                           runlist=runs_lumis.keys(),
                                           withcomment=False)
    assert dataidmap

    session.transaction().commit()

    if action == 'trgbyls':
        session.transaction().start(True)
        result = lumiCalcAPI.trgForIds(session.nominalSchema(),
                                       runs_lumis,
                                       dataidmap,
                                       trgbitname=None,
                                       trgbitnamepattern='*',
                                       withL1Count=False,
                                       withPrescale=True)
        session.transaction().commit()
    elif action == 'hltbyls':
        session.transaction().start(True)
        result = lumiCalcAPI.hltForIds(session.nominalSchema(),
                                       runs_lumis,
                                       dataidmap,
                                       hltpathname=None,
                                       hltpathpattern='*',
                                       withL1Pass=False,
                                       withHLTAccept=False)
        session.transaction().commit()
    elif action == 'hltmenu':
        session.transaction().start(True)
        result = lumiCalcAPI.hltpathsForRange(session.nominalSchema(),
                                              runs_lumis,
                                              hltpathname=None,
                                              hltpathpattern='*')
        session.transaction().commit()
    del session
    del svc

    return result
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSHlt(result,iresults=iresults,isverbose=options.verbose)
     else:
         lumiReport.toCSVLSHlt(result,options.outputfile,iresults,options.verbose)
 if options.action == 'trgconf':
     session.transaction().start(True)
     result=lumiCalcAPI.trgbitsForRange(session.nominalSchema(),irunlsdict,datatag=None)        
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenConfTrg(result,iresults,options.verbose)
     else:
         lumiReport.toCSVConfTrg(result,options.outputfile,iresults,options.verbose)
 if options.action == 'hltconf':
     session.transaction().start(True)
     result=lumiCalcAPI.hltpathsForRange(session.nominalSchema(),irunlsdict,hltpathname=sname,hltpathpattern=spattern)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenConfHlt(result,iresults,options.verbose)
     else:
         lumiReport.toCSVConfHlt(result,options.outputfile,iresults,options.verbose)
 if options.action == 'beambyls':
     session.transaction().start(True)
     dumpbeamintensity=False
     if options.outputfile and options.verbose:
         dumpbeamintensity=True
     result=lumiCalcAPI.beamForRange(session.nominalSchema(),irunlsdict,withBeamIntensity=options.withbeamintensity,minIntensity=options.minintensity)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSBeam(result,iresults=iresults,dumpIntensity=False)
     else:
Beispiel #4
0
                                    dataidmap,
                                    hltpathname=sname,
                                    hltpathpattern=spattern,
                                    withL1Pass=withL1Pass,
                                    withHLTAccept=withHLTAccept)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSHlt(result, iresults=iresults)
     else:
         lumiReport.toScreenLSHlt(result,
                                  iresults=iresults,
                                  toFile=options.outputfile)
 if options.action == 'hltmenu':
     session.transaction().start(True)
     result = lumiCalcAPI.hltpathsForRange(session.nominalSchema(),
                                           irunlsdict,
                                           hltpathname=sname,
                                           hltpathpattern=spattern)
     session.transaction().commit()
     #print result
     if not options.outputfile:
         lumiReport.toScreenConfHlt(result, iresults)
     else:
         lumiReport.toScreenConfHlt(result,
                                    iresults,
                                    toFile=options.outputfile)
 if options.action == 'beambyls':
     session.transaction().start(True)
     dumpbeamintensity = False
     if options.outputfile and options.verbose:
         dumpbeamintensity = True
     result = lumiCalcAPI.beamForIds(