本文整理汇总了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')
示例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")
示例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