本文整理汇总了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