Example #1
0
    hfdataidmap=revisionDML.dataIdsByTagId(session.nominalSchema(),hf_tagid,runlist,withcomment=False,lumitype='HF')
    beamstatusdata=dataDML.beamstatusByIds(session.nominalSchema(),hfdataidmap)
    #print 'beamstatusdata ',beamstatusdata
    lumirundata=dataDML.lumiRunByIds(session.nominalSchema(),hfdataidmap,lumitype='HF')#{runnum: (nominalegev(0),ncollidingbunches(1),starttime(2),stoptime(3),nls(4)}
    session.transaction().commit()
    #print 'lumirundata ', lumirundata
    alllumirundata=generateLumiRundata(inputfilename,lumirundata,runlist)
    alllumilsdata={}
    for runnum,perrundata in parseresult.items():
        pixellumidataid=0
        session.transaction().start(False)
        #session.transaction().start(True)
        hfdataidinfo=hfdataidmap[runnum]
        hflumidataid=hfdataidinfo[0]
        trgdataid=hfdataidinfo[1]
        hltdataid=hfdataidinfo[2]
        beamsta={}
        if runnum in beamstatusdata:
            beamsta=beamstatusdata[runnum]
        alllumilsdata[runnum]=generateLumiLSdataForRun(perrundata,alllumirundata[runnum],beamsta)#lumirundata [datasource,nominalenergy,ncollidingbunches,starttime,stoptime,nls]
        pixellumirundata=alllumirundata[runnum]
        (pixellumirevid,pixellumientryid,pixellumidataid)=dataDML.addLumiRunDataToBranch(session.nominalSchema(),runnum,pixellumirundata,pixellumibranchinfo,nameDealer.pixellumidataTableName())
        pixellumilsdata=alllumilsdata[runnum]
        revisionDML.addRunToCurrentDataTag(session.nominalSchema(),runnum,pixellumidataid,trgdataid,hltdataid,lumitype='PIXEL')
        session.transaction().commit()
        dataDML.bulkInsertLumiLSSummary(session,runnum,pixellumidataid,pixellumilsdata,nameDealer.pixellumisummaryv2TableName(),withDetails=False)

       
    del session
    del svc
Example #2
0
           hfdataidmap[int(options.runnum)])
     destsession.transaction().start(False)
     [destlumidataid, desttrgdataid,
      desthltdataid] = hfdataidmap[int(options.runnum)]
     (lumirevid, lumientryid, lumidataid) = dataDML.addLumiRunDataToBranch(
         destsession.nominalSchema(), int(options.runnum), rundat,
         branchinfo, nameDealer.lumidataTableName())
     dataDML.bulkInsertLumiLSSummary(destsession, int(options.runnum),
                                     lumidataid, lsdat,
                                     nameDealer.lumisummaryv2TableName())
     destsession.transaction().commit()
     destsession.transaction().start(False)
     revisionDML.addRunToCurrentDataTag(destsession.nominalSchema(),
                                        int(options.runnum),
                                        lumidataid,
                                        desttrgdataid,
                                        desthltdataid,
                                        lumitype='HF',
                                        comment=options.comment)
     destsession.transaction().commit()
 else:
     print('non-existing old hf data in destdb of run ',
           int(options.runnum))
     destsession.transaction().start(False)
     (lumirevid, lumientryid, lumidataid) = dataDML.addLumiRunDataToBranch(
         destsession.nominalSchema(), int(options.runnum), rundat,
         branchinfo, nameDealer.lumidataTableName())
     print((lumirevid, lumientryid, lumidataid))
     dataDML.bulkInsertLumiLSSummary(destsession, int(options.runnum),
                                     lumidataid, lsdat,
                                     nameDealer.lumisummaryv2TableName())
Example #3
0
        hltdataid = hfdataidinfo[2]
        beamsta = {}
        if beamstatusdata.has_key(runnum):
            beamsta = beamstatusdata[runnum]
        alllumilsdata[runnum] = generateLumiLSdataForRun(
            perrundata, alllumirundata[runnum], beamsta
        )  #lumirundata [datasource,nominalenergy,ncollidingbunches,starttime,stoptime,nls]
        pixellumirundata = alllumirundata[runnum]
        (pixellumirevid, pixellumientryid,
         pixellumidataid) = dataDML.addLumiRunDataToBranch(
             session.nominalSchema(), runnum, pixellumirundata,
             pixellumibranchinfo, nameDealer.pixellumidataTableName())
        pixellumilsdata = alllumilsdata[runnum]
        revisionDML.addRunToCurrentDataTag(session.nominalSchema(),
                                           runnum,
                                           pixellumidataid,
                                           trgdataid,
                                           hltdataid,
                                           lumitype='PIXEL')
        session.transaction().commit()
        dataDML.bulkInsertLumiLSSummary(
            session,
            runnum,
            pixellumidataid,
            pixellumilsdata,
            nameDealer.pixellumisummaryv2TableName(),
            withDetails=False)

    del session
    del svc
Example #4
0
 
 (hf_tagid,hf_tagname)=revisionDML.currentDataTag(destsession.nominalSchema(),lumitype='HF')
 print('(hf_tagid,hf_tagname) ',(hf_tagid,hf_tagname))
 hfdataidmap=revisionDML.dataIdsByTagId(destsession.nominalSchema(),hf_tagid,[int(options.runnum)],withcomment=False,lumitype='HF')
 destsession.transaction().commit()
 print('dest hfdataidmap ',hfdataidmap)
 
 if int(options.runnum) in hfdataidmap:
     print('existing old hf data in destdb of run ',options.runnum,hfdataidmap[int(options.runnum)])
     destsession.transaction().start(False)
     [destlumidataid,desttrgdataid,desthltdataid]=hfdataidmap[int(options.runnum)]
     (lumirevid,lumientryid,lumidataid)=dataDML.addLumiRunDataToBranch(destsession.nominalSchema(),int(options.runnum),rundat,branchinfo,nameDealer.lumidataTableName())
     dataDML.bulkInsertLumiLSSummary(destsession,int(options.runnum),lumidataid,lsdat,nameDealer.lumisummaryv2TableName())
     destsession.transaction().commit()
     destsession.transaction().start(False)
     revisionDML.addRunToCurrentDataTag(destsession.nominalSchema(),int(options.runnum),lumidataid,desttrgdataid,desthltdataid,lumitype='HF',comment=options.comment)
     destsession.transaction().commit()
 else:
     print('non-existing old hf data in destdb of run ',int(options.runnum))
     destsession.transaction().start(False)
     (lumirevid,lumientryid,lumidataid)=dataDML.addLumiRunDataToBranch(destsession.nominalSchema(),int(options.runnum),rundat,branchinfo,nameDealer.lumidataTableName())
     print((lumirevid,lumientryid,lumidataid))
     dataDML.bulkInsertLumiLSSummary(destsession,int(options.runnum),lumidataid,lsdat,nameDealer.lumisummaryv2TableName())
     destsession.transaction().commit()
     destsession.transaction().start(False)
     revisionDML.addRunToCurrentDataTag(destsession.nominalSchema(),int(options.runnum),lumidataid,0,0,lumitype='HF',comment=options.comment)
     destsession.transaction().commit()
 
 del sourcesession
 del sourcesvc
 del destsession