示例#1
0
                              'n/a')

    if options.action == 'trgbyls':
        session.transaction().start(True)
        result = lumiCalcAPI.trgForIds(session.nominalSchema(),
                                       irunlsdict,
                                       dataidmap,
                                       trgbitname=sname,
                                       trgbitnamepattern=spattern,
                                       withL1Count=True,
                                       withPrescale=True)
        session.transaction().commit()
        if not options.outputfile:
            lumiReport.toScreenLSTrg(result,
                                     iresults=iresults,
                                     irunlsdict=irunlsdict,
                                     noWarning=options.nowarning,
                                     withoutmask=options.withoutmask)
        else:
            lumiReport.toScreenLSTrg(result,
                                     iresults=iresults,
                                     irunlsdict=irunlsdict,
                                     noWarning=options.nowarning,
                                     toFile=options.outputfile,
                                     withoutmask=options.withoutmask)
    #print result
        sys.exit(0)
    if options.action == 'hltbyls':
        if not options.name:
            print '[ERROR] --name option is required by hltbyls, do nothing'
            sys.exit(0)
     else:
         for run in runlist:
             irunlsdict[run]=None
 if options.verbose:  
     print 'Selected run:ls'
     for run in sorted(irunlsdict):
         if irunlsdict[run] is not None:
             print '\t%d : %s'%(run,','.join([str(ls) for ls in irunlsdict[run]]))
         else:
             print '\t%d : all'%run
 if options.action == 'trgbyls':
     session.transaction().start(True)
     result=lumiCalcAPI.trgForRange(session.nominalSchema(),irunlsdict,trgbitname=sname,trgbitnamepattern=spattern,withL1Count=True,withPrescale=True)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSTrg(result,iresults=iresults,isverbose=isdetail)
     else:
         lumiReport.toCSVLSTrg(result,options.outputfile,iresults=iresults,isverbose=isdetail)
 if options.action == 'hltbyls':
     withL1Pass=False
     withHLTAccept=False
     if options.verbose:
         withL1Pass=True
         withHLTAccept=True
     session.transaction().start(True)
     result=lumiCalcAPI.hltForRange(session.nominalSchema(),irunlsdict,hltpathname=sname,hltpathpattern=spattern,withL1Pass=withL1Pass,withHLTAccept=withHLTAccept)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSHlt(result,iresults=iresults,isverbose=options.verbose)
     else:
         lumiReport.toCSVLSHlt(result,options.outputfile,iresults,options.verbose)
示例#3
0
         if selectedrun not in rruns:
             del irunlsdict[selectedrun]
 if not irunlsdict:
     print('[INFO] No qualified run found, do nothing')
     sys.exit(13)
     
 session.transaction().commit()
 thiscmmd=sys.argv[0]
 lumiReport.toScreenHeader(thiscmmd,datatagname,'n/a','n/a','n/a','n/a')
 
 if options.action == 'trgbyls':
     session.transaction().start(True)
     result=lumiCalcAPI.trgForIds(session.nominalSchema(),irunlsdict,dataidmap,trgbitname=sname,trgbitnamepattern=spattern,withL1Count=True,withPrescale=True)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSTrg(result,iresults=iresults,irunlsdict=irunlsdict,noWarning=options.nowarning,withoutmask=options.withoutmask)
     else:
         lumiReport.toScreenLSTrg(result,iresults=iresults,irunlsdict=irunlsdict,noWarning=options.nowarning,toFile=options.outputfile,withoutmask=options.withoutmask)
 #print result
     sys.exit(0)
 if options.action == 'hltbyls':
     if not options.name:
         print('[ERROR] --name option is required by hltbyls, do nothing')
         sys.exit(0)
     withL1Pass=True
     withHLTAccept=True
     session.transaction().start(True)
     result=lumiCalcAPI.hltForIds(session.nominalSchema(),irunlsdict,dataidmap,hltpathname=sname,hltpathpattern=spattern,withL1Pass=withL1Pass,withHLTAccept=withHLTAccept)
     session.transaction().commit()
     if not options.outputfile:
         lumiReport.toScreenLSHlt(result,iresults=iresults)