result=lumiCalcAPI.lumiForRange(session.nominalSchema(),irunlsdict,amodetag=None,egev=None,beamstatus=None,norm=1.0,finecorrections=finecorrections,driftcorrections=None,usecorrectionv2=False,lumitype='PIXEL',branchName='DATA')
        session.transaction().commit()
        if not options.outputfile:
            lumiReport.toScreenLumiByLS(result,iresults,options.scalefactor,options.verbose)
        else:
            lumiReport.toCSVLumiByLS(result,options.outputfile,iresults,options.scalefactor,options.verbose)
    else:
        hltname=options.hltpath
        hltpat=None
        if hltname=='*' or hltname=='all':
            hltname=None
        elif 1 in [c in hltname for c in '*?[]']: #is a fnmatch pattern
           hltpat=hltname
           hltname=None
        session.transaction().start(True)
        result=lumiCalcAPI.effectiveLumiForRange(session.nominalSchema(),irunlsdict,hltpathname=hltname,hltpathpattern=hltpat,amodetag=None,egev=None,beamstatus=None,norm=1.0,finecorrections=finecorrections,driftcorrections=None,usecorrectionv2=False,lumitype='PIXEL',branchName='DATA')
        session.transaction().commit()
        if not options.outputfile:
            lumiReport.toScreenLSEffective(result,iresults,options.scalefactor,options.verbose)
        else:
            lumiReport.toCSVLSEffective(result,options.outputfile,iresults,options.scalefactor,options.verbose)
 if options.action == 'recorded':#recorded actually means effective because it needs to show all the hltpaths...
    session.transaction().start(True)
    hltname=options.hltpath
    hltpat=None
    if hltname is not None:
       if hltname=='*' or hltname=='all':
           hltname=None
       elif 1 in [c in hltname for c in '*?[]']: #is a fnmatch pattern
           hltpat=hltname
           hltname=None
     finecorrections=lumiCorrections.correctionsForRangeV2(schema,rruns,cterms)#constant+nonlinear corrections
     driftcorrections=lumiCorrections.driftcorrectionsForRange(schema,rruns,cterms)
     session.transaction().commit()
 session.transaction().start(True)
 if not options.hltpath:
     lumibyls=lumiCalcAPI.lumiForRange(session.nominalSchema(),runlsfromDB,amodetag=options.amodetag,egev=options.beamenergy,beamstatus=pbeammode,norm=normfactor,finecorrections=finecorrections,driftcorrections=driftcorrections,usecorrectionv2=True)
 else:
     referenceLabel='Recorded'
     hltname=options.hltpath
     hltpat=None
     if hltname=='*' or hltname=='all':
         hltname=None
     elif 1 in [c in hltname for c in '*?[]']: #is a fnmatch pattern
         hltpat=hltname
         hltname=None
     lumibyls=lumiCalcAPI.effectiveLumiForRange(session.nominalSchema(),runlsfromDB,hltpathname=hltname,hltpathpattern=hltpat,amodetag=options.amodetag,egev=options.beamenergy,beamstatus=pbeammode,norm=normfactor,finecorrections=finecorrections,driftcorrections=driftcorrections,usecorrectionv2=True)
 session.transaction().commit()
 rawdata={}
 #
 # start to plot
 #
 if options.action=='run':
     for run in sorted(lumibyls):
         rundata=lumibyls[run]
         if not options.hltpath:
             if len(rundata)!=0:
                 rawdata.setdefault('Delivered',[]).append((run,sum([t[5] for t in rundata])))
                 rawdata.setdefault('Recorded',[]).append((run,sum([t[6] for t in rundata])))
         else:
             labels=['Recorded']
             if len(rundata)!=0:
Exemple #3
0
        result=lumiCalcAPI.lumiForRange(session.nominalSchema(),irunlsdict,amodetag=options.amodetag,egev=options.beamenergy,beamstatus=pbeammode,norm=normfactor,finecorrections=finecorrections)
        session.transaction().commit()
        if not options.outputfile:
            lumiReport.toScreenLumiByLS(result,iresults,options.scalefactor,options.verbose)
        else:
            lumiReport.toCSVLumiByLS(result,options.outputfile,iresults,options.scalefactor,options.verbose)
    else:
        hltname=options.hltpath
        hltpat=None
        if hltname=='*' or hltname=='all':
            hltname=None
        elif 1 in [c in hltname for c in '*?[]']: #is a fnmatch pattern
           hltpat=hltname
           hltname=None
        session.transaction().start(True)
        result=lumiCalcAPI.effectiveLumiForRange(session.nominalSchema(),irunlsdict,hltpathname=hltname,hltpathpattern=hltpat,amodetag=options.amodetag,egev=options.beamenergy,beamstatus=pbeammode,norm=normfactor,finecorrections=finecorrections)
        session.transaction().commit()
        if not options.outputfile:
            lumiReport.toScreenLSEffective(result,iresults,options.scalefactor,options.verbose)
        else:
            lumiReport.toCSVLSEffective(result,options.outputfile,iresults,options.scalefactor,options.verbose)
 if options.action == 'recorded':#recorded actually means effective because it needs to show all the hltpaths...
    session.transaction().start(True)
    hltname=options.hltpath
    hltpat=None
    if hltname is not None:
       if hltname=='*' or hltname=='all':
           hltname=None
       elif 1 in [c in hltname for c in '*?[]']: #is a fnmatch pattern
           hltpat=hltname
           hltname=None