Example #1
0
        dbsession = svc.openSession(isReadOnly=True,
                                    cpp2sqltype=[
                                        ('unsigned int', 'NUMBER(10)'),
                                        ('unsigned long long', 'NUMBER(20)')
                                    ])
        dbsession.transaction().start(True)
        if options.normname:
            norminfo = normDML.normInfoByName(dbsession.nominalSchema(),
                                              options.normname)
            normdataid = norminfo[0]
            normvalues = normDML.normValueById(dbsession.nominalSchema(),
                                               normdataid)
            lumiReport.toScreenNormDetail(options.normname, norminfo,
                                          normvalues)
        elif options.lumitype:
            luminormidmap = normDML.normIdByType(dbsession.nominalSchema(),
                                                 lumitype=options.lumitype,
                                                 defaultonly=False)
            for normname, normid in luminormidmap.items():
                norminfo = normDML.normInfoByName(dbsession.nominalSchema(),
                                                  normname)
                normvalues = normDML.normValueById(dbsession.nominalSchema(),
                                                   normid)
                lumiReport.toScreenNormDetail(normname, norminfo, normvalues)
        else:
            allnorms = normDML.allNorms(dbsession.nominalSchema())
            lumiReport.toScreenNormSummary(allnorms)
        dbsession.transaction().commit()
    del dbsession
    del svc
Example #2
0
        for selectedrun in irunlsdict.keys():#if there's further filter on the runlist,clean input dict
            if selectedrun not in rruns:
                del irunlsdict[selectedrun]
    if not irunlsdict:
        print '[INFO] No qualified run found, do nothing'
        sys.exit(13)
    ###############################################################
    # check normtag and get norm values if required
    ###############################################################
    normname='NONE'
    normid=0
    normvalueDict={}
    if not options.withoutNorm:
        normname=options.normtag
        if not normname:
            normmap=normDML.normIdByType(session.nominalSchema(),lumitype='PIXEL',defaultonly=True)
            if len(normmap):
                normname=normmap.keys()[0]
                normid=normmap[normname]
        else:
            normid=normDML.normIdByName(session.nominalSchema(),normname)
        if not normid:
            raise RuntimeError('[ERROR] cannot resolve norm/correction')
            sys.exit(12)
        normvalueDict=normDML.normValueById(session.nominalSchema(),normid) #{since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]}
    session.transaction().commit()
    lumiReport.toScreenHeader(thiscmmd,datatagname,normname,workingversion,updateversion,'PIXEL',toFile=options.headerfile)

    ##################
    # ls level       #
    ##################
Example #3
0
        (datatagid,datatagname)=revisionDML.currentDataTag(session.nominalSchema())
        dataidmap=revisionDML.dataIdsByTagId(session.nominalSchema(),datatagid,runlist=runlist,withcomment=False)
        #{run:(lumidataid,trgdataid,hltdataid,())}
    else:
        dataidmap=revisionDML.dataIdsByTagName(session.nominalSchema(),datatagname,runlist=runlist,withcomment=False)

    #
    # check normtag and get norm values if required
    #
    normname='NONE'
    normid=0
    normvalueDict={}
    if not options.withoutNorm:
        normname=options.normtag
        if not normname:
            normmap=normDML.normIdByType(session.nominalSchema(),lumitype='HF',defaultonly=True)
            if len(normmap):
                normname=normmap.keys()[0]
                normid=normmap[normname]
        else:
            normid=normDML.normIdByName(session.nominalSchema(),normname)
        if not normid:
            raise RuntimeError('[ERROR] cannot resolve norm/correction')
            sys.exit(-1)
        normvalueDict=normDML.normValueById(session.nominalSchema(),normid) #{since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]}
    session.transaction().commit()
    for fillnum in fillstoprocess:# process per fill
        session.transaction().start(True)
        filldata=getSpecificLumi(session.nominalSchema(),fillnum,options.inputdir,dataidmap,normvalueDict,xingMinLum=options.xingMinLum,amodetag=options.amodetag,bxAlgo=options.bxAlgo)
        specificlumiTofile(fillnum,filldata,options.outputdir)
        session.transaction().commit()
Example #4
0
        dbsession=svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])
        dbsession.transaction().start(False)      
        if options.action=='setdefault':
            normDML.promoteNormToTypeDefault(dbsession.nominalSchema(),options.normname,options.lumitype)
        if options.action=='unsetdefault':
            normDML.demoteNormFromTypeDefault(dbsession.nominalSchema(),options.normname,options.lumitype)
        dbsession.transaction().commit()        
     ##############################
     #  list
     ##############################
    if options.action=='list':
        dbsession=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])      
        dbsession.transaction().start(True)
        if options.normname:
            norminfo=normDML.normInfoByName(dbsession.nominalSchema(),options.normname)
            normdataid=norminfo[0]
            normvalues=normDML.normValueById(dbsession.nominalSchema(),normdataid)
            lumiReport.toScreenNormDetail(options.normname,norminfo,normvalues)
        elif options.lumitype:
            luminormidmap=normDML.normIdByType(dbsession.nominalSchema(),lumitype=options.lumitype,defaultonly=False)
            for normname,normid in luminormidmap.items():
                norminfo=normDML.normInfoByName(dbsession.nominalSchema(),normname)
                normvalues=normDML.normValueById(dbsession.nominalSchema(),normid)
                lumiReport.toScreenNormDetail(normname,norminfo,normvalues)
        else:
            allnorms=normDML.allNorms(dbsession.nominalSchema())
            lumiReport.toScreenNormSummary(allnorms)
        dbsession.transaction().commit()
    del dbsession
    del svc