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


Python LumiList.writeJSON方法代码示例

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


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

示例1: testWrite

# 需要导入模块: from WMCore.DataStructs.LumiList import LumiList [as 别名]
# 或者: from WMCore.DataStructs.LumiList.LumiList import writeJSON [as 别名]
 def testWrite(self):
     alumis = {'1' : range(2,20) + range(31,39) + range(45,49),
               '2' : range(6,20) + range (30,40),
               '3' : range(10,20) + range (30,40) + range(50,60),
               '4' : range(1,100),
              }
     a = LumiList(runsAndLumis = alumis)
     a.writeJSON('newFile.json')
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:LumiList_t.py

示例2: testWrite

# 需要导入模块: from WMCore.DataStructs.LumiList import LumiList [as 别名]
# 或者: from WMCore.DataStructs.LumiList.LumiList import writeJSON [as 别名]
 def testWrite(self):
     alumis = {
         "1": range(2, 20) + range(31, 39) + range(45, 49),
         "2": range(6, 20) + range(30, 40),
         "3": range(10, 20) + range(30, 40) + range(50, 60),
         "4": range(1, 100),
     }
     a = LumiList(runsAndLumis=alumis)
     a.writeJSON("newFile.json")
开发者ID:bbockelm,项目名称:WMCore,代码行数:11,代码来源:LumiList_t.py

示例3: enumerate

# 需要导入模块: from WMCore.DataStructs.LumiList import LumiList [as 别名]
# 或者: from WMCore.DataStructs.LumiList.LumiList import writeJSON [as 别名]
# for now, we simply pass a list of the processed lumi JSONs on the command line
lumiLists = []
#print sys.argv
for i,json in enumerate(sys.argv):
  if i==0:
    # this is the name of this script
    continue
  print 'INFO: Add lumi json:',json,'to unionLumiList'
  lumiLists.append(LumiList(filename=json))

# Union
unionLumiJSONFilename = 'calcDataPileup_allProcessedLumis.json'
unionLumiList = LumiList()
for ll in lumiLists:
  unionLumiList = unionLumiList | ll
unionLumiList.writeJSON(unionLumiJSONFilename)
print
print 'INFO: unionLumiList saved in:',unionLumiJSONFilename

## Difference
#nov17LumiList = goldenJsonLumiList - unionLumiList


# generate the pileup files
processedLumis=unionLumiJSONFilename
pileupJSON='/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/PileUp/pileup_latest.txt'
minBiasXsec=69000
minBiasXsecUncert = 0.05 #5%
pileupHistoRootFile='Pileup_SingleElectron__Run2015D_all_XXX.root'

# if minBiasXsecUncert < 0, just do central xsec pileup file only
开发者ID:CMSLQ,项目名称:rootNtupleAnalyzerV2,代码行数:33,代码来源:calcDataPileup.py


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