本文整理汇总了Python中stack.Stack.addGroup方法的典型用法代码示例。如果您正苦于以下问题:Python Stack.addGroup方法的具体用法?Python Stack.addGroup怎么用?Python Stack.addGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stack.Stack
的用法示例。
在下文中一共展示了Stack.addGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeStack
# 需要导入模块: from stack import Stack [as 别名]
# 或者: from stack.Stack import addGroup [as 别名]
def makeStack(config, source, plotsDir):
ROOT.gErrorIgnoreLevel = 2000
keys = source.GetDirectory('components').GetListOfKeys()
for key in keys:
if key.GetName().startswith('L = '):
integratedLumi = float(key.GetName().split()[2])
if integratedLumi > 0.:
title = 'CMS Preliminary 2014 L = %.1f fb^{-1}' % (integratedLumi / 1000.)
else:
title = 'CMS Simulation 2014'
for group in config.groups:
group.loadHistograms(config.hdefs, source.GetDirectory('groups'))
for hdef in config.hdefs:
stack = Stack(hdef)
stack.stackSignal = config.stackSignal
for group in config.groups:
stack.addGroup(group)
print stack.name
stack.draw(plotsDir, title = title, arbitraryUnit = integratedLumi <= 0., maskObserved = plotflags.HIDESENSITIVE, drawEmpty = plotflags.DRAWEMPTY)
示例2: makeStack
# 需要导入模块: from stack import Stack [as 别名]
# 或者: from stack.Stack import addGroup [as 别名]
def makeStack(config, source, plotsDir):
ROOT.gErrorIgnoreLevel = 2000
keys = source.GetDirectory('components').GetListOfKeys()
for key in keys:
if key.GetName().startswith('L = '):
integratedLumi = float(key.GetName().split()[2])
paves = []
cmsPave = ROOT.TPaveText()
cmsPave.SetY2NDC(0.045)
cmsPave.SetTextFont(62)
cmsPave.SetTextSize(0.03)
cmsPave.SetTextAlign(12)
cmsPave.SetBorderSize(0)
cmsPave.SetFillStyle(0)
paves.append(cmsPave)
if integratedLumi > 0.:
cmsPave.AddText('CMS Preliminary 2014')
lumiPave = ROOT.TPaveText()
lumiPave.SetY2NDC(0.045)
lumiPave.SetTextFont(62)
lumiPave.SetTextSize(0.03)
lumiPave.SetTextAlign(12)
lumiPave.SetBorderSize(0)
lumiPave.SetFillStyle(0)
lumiPave.AddText('L = %.1f fb^{-1}' % (integratedLumi / 1000.))
paves.append(lumiPave)
arbitraryUnit = False
else:
cmsPave.AddText('CMS Simulation 2014')
arbitraryUnit = True
for group in config.groups:
group.loadHistograms(config.hdefs, source.GetDirectory('groups'))
for hdef in config.hdefs:
stack = Stack(hdef)
for group in config.groups:
stack.addGroup(group)
print stack.name
stack.draw(plotsDir, texts = paves, arbitraryUnit = arbitraryUnit, maskObserved = plotflags.HIDESENSITIVE, drawEmpty = plotflags.DRAWEMPTY)