示例#1
0
    filldata={}
    #
    # check datatag
    #
    reqfillmin=min(fillstoprocess)
    reqfillmax=max(fillstoprocess)
    session.transaction().start(True)
    runlist=lumiCalcAPI.runList(session.nominalSchema(),options.fillnum,runmin=None,runmax=None,fillmin=reqfillmin,fillmax=reqfillmax,startT=None,stopT=None,l1keyPattern=None,hltkeyPattern=None,amodetag=options.amodetag,nominalEnergy=None,energyFlut=None,requiretrg=False,requirehlt=False)
    
    datatagname=options.datatag
    if not datatagname:
        (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:
         rruns = irunlsdict.keys()
 ##############################################################
 # check datatag
 # #############################################################
 datatagname = options.datatag
 if not datatagname:
     (datatagid,
      datatagname) = revisionDML.currentDataTag(session.nominalSchema())
     dataidmap = revisionDML.dataIdsByTagId(session.nominalSchema(),
                                            datatagid,
                                            runlist=rruns,
                                            withcomment=False)
     #{run:(lumidataid,trgdataid,hltdataid,())}
 else:
     dataidmap = revisionDML.dataIdsByTagName(session.nominalSchema(),
                                              datatagname,
                                              runlist=rruns,
                                              withcomment=False)
     #{run:(lumidataid,trgdataid,hltdataid,())}
 ###############################################################
 # 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):
示例#3
0
                    del irunlsdict[selectedrun]
        else:
            for run in runlist:
                irunlsdict[run]=None
            rruns=irunlsdict.keys()

    ###############################################################
    # check datatag
    ###############################################################
    datatagname=options.datatag
    if not datatagname:
        (datatagid,datatagname)=revisionDML.currentDataTag(session.nominalSchema(),lumitype='PIXEL')
        dataidmap=revisionDML.dataIdsByTagId(session.nominalSchema(),datatagid,runlist=rruns,lumitype='PIXEL',withcomment=False)
        #{run:(lumidataid,trgdataid,hltdataid,())}
    else:
        dataidmap=revisionDML.dataIdsByTagName(session.nominalSchema(),datatagname,runlist=rruns,lumitype='PIXEL',withcomment=False)
        #{run:(lumidataid,trgdataid,hltdataid,())}
    #
    # 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:
示例#4
0
文件: lumiTag.py 项目: Moanwar/cmssw
                        action='store_true',
                        help='debug'
                        )
    options=parser.parse_args()

    if options.authpath:
        os.environ['CORAL_AUTH_PATH']=options.authpath 
    svc=sessionManager.sessionManager(options.connect,authpath=options.authpath,siteconfpath=options.siteconfpath)
    session=None
    if options.action=='create':
        if not options.name:
            print('--name option is required')
            sys.exit(0)
        session=svc.openSession(isReadOnly=False,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])               
        session.transaction().start(False)
        schema=session.nominalSchema()
        revisionDML.createDataTag(schema,options.name,lumitype=options.lumitype)
        session.transaction().commit()
    if options.action=='list':
        session=svc.openSession(isReadOnly=True,cpp2sqltype=[('unsigned int','NUMBER(10)'),('unsigned long long','NUMBER(20)')])               
        session.transaction().start(True)
        if not options.name:
            alltags=revisionDML.alldataTags(session.nominalSchema(),lumitype=options.lumitype)
            lumiReport.toScreenTags(alltags)
        else:
            taginfo=revisionDML.dataIdsByTagName(session.nominalSchema(),options.name,runlist=None,lumitype=options.lumitype,withcomment=True)
            lumiReport.toScreenSingleTag(taginfo)
        session.transaction().commit()
    del session
    del svc
示例#5
0
        session = svc.openSession(isReadOnly=False,
                                  cpp2sqltype=[('unsigned int', 'NUMBER(10)'),
                                               ('unsigned long long',
                                                'NUMBER(20)')])
        session.transaction().start(False)
        schema = session.nominalSchema()
        revisionDML.createDataTag(schema,
                                  options.name,
                                  lumitype=options.lumitype)
        session.transaction().commit()
    if options.action == 'list':
        session = svc.openSession(isReadOnly=True,
                                  cpp2sqltype=[('unsigned int', 'NUMBER(10)'),
                                               ('unsigned long long',
                                                'NUMBER(20)')])
        session.transaction().start(True)
        if not options.name:
            alltags = revisionDML.alldataTags(session.nominalSchema(),
                                              lumitype=options.lumitype)
            lumiReport.toScreenTags(alltags)
        else:
            taginfo = revisionDML.dataIdsByTagName(session.nominalSchema(),
                                                   options.name,
                                                   runlist=None,
                                                   lumitype=options.lumitype,
                                                   withcomment=True)
            lumiReport.toScreenSingleTag(taginfo)
        session.transaction().commit()
    del session
    del svc