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


Python Stack.draw方法代码示例

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


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

示例1: makeStack

# 需要导入模块: from stack import Stack [as 别名]
# 或者: from stack.Stack import draw [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)
开发者ID:yiiyama,项目名称:plotstack,代码行数:27,代码来源:makeStack.py

示例2: makeStack

# 需要导入模块: from stack import Stack [as 别名]
# 或者: from stack.Stack import draw [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)
开发者ID:iamaris,项目名称:plotstack,代码行数:46,代码来源:makeStack.py


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