Beispiel #1
0
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)
Beispiel #2
0
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)