当前位置: 首页>>代码示例>>Python>>正文


Python CommonUtil.count_dups方法代码示例

本文整理汇总了Python中RecoLuminosity.LumiDB.CommonUtil.count_dups方法的典型用法代码示例。如果您正苦于以下问题:Python CommonUtil.count_dups方法的具体用法?Python CommonUtil.count_dups怎么用?Python CommonUtil.count_dups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecoLuminosity.LumiDB.CommonUtil的用法示例。


在下文中一共展示了CommonUtil.count_dups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getInstLumiPerLS

# 需要导入模块: from RecoLuminosity.LumiDB import CommonUtil [as 别名]
# 或者: from RecoLuminosity.LumiDB.CommonUtil import count_dups [as 别名]
def getInstLumiPerLS(dbsession,c,runList,selectionDict,beamstatus=None,beamenergy=None,beamenergyfluctuation=0.09,finecorrections=None):
    '''
    input: runList[runnum], selectionDict{runnum:[ls]}
    output:[[runnumber,lsnumber,deliveredInst,recordedInst,norbit,startorbit,runstarttime,runstoptime]]
    '''
    result=[]
    selectedRunlist=runList
    if len(selectionDict)!=0:
        selectedRunlist=[]
        allruns=runlist+selectionDict.keys()
        dups=CommonUtil.count_dups(allruns)
        for runnum,dupcount in dups:
            if dupcount==2:
                selectedRunlist.append(runnum)
    dbsession.transaction().start(True)
    for run in selectedRunlist:
        q=dbsession.nominalSchema().newQuery()
        runsummary=lumiQueryAPI.runsummaryByrun(q,run)
        del q
        runstarttime=runsummary[3]
        runstoptime=runsummary[4]
        q=dbsession.nominalSchema().newQuery()
        if finecorrections and finecorrections[run]:            
            lumiperrun=lumiQueryAPI.lumisummaryByrun(q,run,c.LUMIVERSION,beamstatus,beamenergy,beamenergyfluctuation,finecorrections=finecorrections[run])
        else:
            lumiperrun=lumiQueryAPI.lumisummaryByrun(q,run,c.LUMIVERSION,beamstatus,beamenergy,beamenergyfluctuation)
        del q
        if len(lumiperrun)==0: #no result for this run
            result.append([run,1,0.0,0.0,0,0,runstarttime,runstoptime])
        else:
            for lumiperls in lumiperrun:
                cmslsnum=lumiperls[0]
                instlumi=lumiperls[1]
                recordedlumi=0.0
                numorbit=lumiperls[2]
                startorbit=lumiperls[3]
                deadcount=0
                bitzero=0
                result.append([run,cmslsnum,instlumi,recordedlumi,numorbit,startorbit,runstarttime,runstoptime])
    dbsession.transaction().commit()
    if c.VERBOSE:
        print result
    return result              
开发者ID:fabozzi,项目名称:ST_44,代码行数:45,代码来源:lumiInstPlot.py


注:本文中的RecoLuminosity.LumiDB.CommonUtil.count_dups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。