def getPlotter(blind=True,datadriven=False,control=False):
     plotter = Plotter('Hpp4l')
     plotter.setSelectionMap(sampleCuts)
     
     if datadriven: plotter.addHistogramToStack('datadriven',datadrivenSamples)

     mcSamples = samples if datadriven else allsamples
     signalMap = sigMapDD if datadriven else sigMap
     for s in mcSamples:
         plotter.addHistogramToStack(s,signalMap[s])
     
     if not control:
         for signal in signals:
             plotter.addHistogram(signal,signalMap[signal],signal=True)
     
     if not blind: plotter.addHistogram('data',signalMap['data'])
     return plotter
Esempio n. 2
0
def getPlotter(blind=True, datadriven=False, control=False):
    plotter = Plotter('Hpp4l')
    plotter.setSelectionMap(sampleCuts)

    if datadriven: plotter.addHistogramToStack('datadriven', datadrivenSamples)

    mcSamples = samples if datadriven else allsamples
    signalMap = sigMapDD if datadriven else sigMap
    for s in mcSamples:
        plotter.addHistogramToStack(s, signalMap[s])

    if not control:
        for signal in signals:
            plotter.addHistogram(signal, signalMap[signal], signal=True)

    if not blind: plotter.addHistogram('data', signalMap['data'])
    return plotter
    # z
    'zMass'                 : {'xaxis': 'm^{#mu#mu} (GeV)', 'yaxis': 'Events / 0.5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': map(lambda x: x*0.5, range(120,240,1)), 'logy': False, 'overflow': True},
    'z1Pt'                  : {'xaxis': 'm^{#mu#mu} #mu_{1} p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(0,150,5), 'logy': False, 'overflow': True},
    'z2Pt'                  : {'xaxis': 'm^{#mu#mu} #mu_{2} p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(0,150,5), 'logy': False, 'overflow': True},
    # t
    'mPt'                   : {'xaxis': '#mu p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(0,150,5), 'logy': True, 'overflow': True},
    # event
    #'numVertices'           : {'xaxis': 'Reconstructed Vertices', 'yaxis': 'Events'},
    #'met'                   : {'xaxis': 'E_{T}^{miss} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': range(0,320,20), 'numcol': 2, 'logy': False, 'overflow': True},
}

############################
### MC based BG estimate ###
############################
for s in samples:
    plotter.addHistogramToStack(s,sigMap[s])

if not blind: plotter.addHistogram('data',sigMap['data'])


for plot in plots:
    for sel in sels:
        kwargs = deepcopy(plots[plot])
        plotname = '{0}/{1}'.format(sel,plot)
        savename = '{0}/mc/{1}'.format(sel,plot)
        plotter.plot(plotname,savename,**kwargs)


# ratios of tight/loose as func of pt/eta
plotter.clearHistograms()
plotter.addHistogram('MC',sigMap['BG'])
Esempio n. 4
0
if toPlot:
    for p in plots.keys():
        if p not in toPlot: plots.pop(p)
    for s in special.keys():
        for p in special[s].keys():
            if p not in toPlot: special[s].pop(p)

############################
### MC based BG estimate ###
############################
if doMC:
    for sel in sels:
        plotter.clearHistograms()

        for s in samples:
            plotter.addHistogramToStack(s, sigMap[s])

        if 'lowmass' not in sel and 'highmass' not in sel:
            for signal in signals:
                plotter.addHistogram(signal, sigMap[signal], signal=True)

        if not blind or 'regionD' in sel or 'lowmass' in sel or 'highmass' in sel:
            plotter.addHistogram('data', sigMap['data'])

        for plot in plots:
            kwargs = deepcopy(plots[plot])
            plotname = '{0}/{1}'.format(sel, plot)
            savename = '{0}/mc/{1}'.format(sel, plot)
            plotter.plot(plotname, savename, **kwargs)

        if blind and 'regionD' not in sel and 'lowmass' not in sel and 'highmass' not in sel:
Esempio n. 5
0
    'numVertices'           : {'xaxis': 'Reconstructed Vertices', 'yaxis': 'Events'},
    'met'                   : {'xaxis': 'E_{T}^{miss} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': 2},
    'metPhi'                : {'xaxis': '#phi(E_{T}^{miss})', 'yaxis': 'Events', 'rebin': 5},
    'mass'                  : {'xaxis': 'm_{4l} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': 2, 'rangex': [0,1000]},
    'st'                    : {'xaxis': '#Sigma p_{T}^{l} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': 2, 'rangex': [0,1000]},
    'nJets'                 : {'xaxis': 'Number of jets (p_{T} > 30 GeV)', 'yaxis': 'Events'},
}



############################
### MC based BG estimate ###
############################
if plotMC:
    for s in allsamples:
        zzPlotter.addHistogramToStack(s,sigMap[s])
    
    zzPlotter.addHistogram('data',sigMap['data'])
    
    if plotCount: plotCounts(zzPlotter,baseDir='default',saveDir='mc')
    if plotCount: plotCounts(zzPlotter,baseDir='zWindow',saveDir='mc-zWindow')
    
    for plot in plots:
        kwargs = deepcopy(plots[plot])
        plotWithChannels(zzPlotter,plot,baseDir='default',saveDir='mc',**kwargs)
        plotWithChannels(zzPlotter,plot,baseDir='zWindow',saveDir='mc-zWindow',**kwargs)
    
##############################
### datadriven backgrounds ###
##############################
if plotDatadriven:
Esempio n. 6
0
             'QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8',
             'QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8',
             'QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8',
            ],
    'data': [
             'SingleMuon',
             'SingleElectron',
            ],
}

chans = ['me','em','mm','ee']

samples = ['W','T','TT','Z','WW']

for s in samples:
    fakeratePlotter.addHistogramToStack(s,sigMap[s])

fakeratePlotter.addHistogram('data',sigMap['data'])

plots = {
    # z cand
    'zMass'                 : {'xaxis': 'm_{l^{+}l^{-}} (GeV)', 'yaxis': 'Events / 10 GeV', 'rebin': 10},
    # m cand
    'wtMt'                  : {'xaxis': 'm_{T}^{tag} (GeV)', 'yaxis': 'Events / 10 GeV', 'rebin': 10},
    'tPt'                   : {'xaxis': 'p_{T}^{tag} (GeV)', 'yaxis': 'Events / 10 GeV', 'rebin': 10},
    'tEta'                  : {'xaxis': '#eta^{tag}', 'yaxis': 'Events', 'rebin': 10},
    # t cand
    'wlMt'                  : {'xaxis': 'm_{T}^{l} (GeV)', 'yaxis': 'Events / 10 GeV', 'rebin': 10},
    'lPt'                   : {'xaxis': 'p_{T}^{l} (GeV)', 'yaxis': 'Events / 10 GeV', 'rebin': 10},
    'lEta'                  : {'xaxis': '#eta^{l}', 'yaxis': 'Events', 'rebin': 10},
    # event
Esempio n. 7
0
        for s in samples3P1F + ['data']: histMap[s] += ['/'.join(['3P1F']+plotdirs)]
        histMap['ZX'] += ['/'.join(['for3P1F','2P2F']+plotdirs)]
    return histMap

############################
### MC based BG estimate ###
############################
if doMC:
    for sel in selections:
        for region in regions:
            plotter.clearHistograms()
    
            thisblind = blind and sel in ['4P0F'] and region in ['','hzz4l']
    
            for s in ['ZX']+samples:
                plotter.addHistogramToStack(s,sigMap[s])
            
            if not thisblind: plotter.addHistogram('data',sigMap['data'])
    
            for plot in plots:
                kwargs = deepcopy(plots[plot])
                plotname = '{}/{}/{}'.format(sel,region,plot) if region else '{}/{}'.format(sel,plot)
                savename = '{}/{}/mc/{}'.format(sel,region,plot) if region else '{}/mc/{}'.format(sel,plot)
                plotChannels(plotter,plotname,savename,**kwargs)
            
                for alt in alt_plots.get(plot,[]):
                    kwargs = deepcopy(plots[plot])
                    kwargs.update(alt_plots[plot][alt])
                    savename = '{}/{}/mc/{}'.format(sel,region,alt) if region else '{}/mc/{}'.format(sel,alt)
                    plotChannels(plotter,plotname,savename,**kwargs)
            
Esempio n. 8
0
        'ZZTo2L2Nu_13TeV_powheg_pythia8',
        'ZZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8'
    ],
    'VVV': ['WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8'],
    'TTV': ['TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8'],
    'ZG': ['ZGTo2LG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'],
    'WW': ['WWTo2L2Nu_13TeV-powheg'],
    'Z': [
        'DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8',
        'DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'
    ],
    'TT': ['TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'],
    'data':
    ['DoubleMuon', 'DoubleEG', 'MuonEG', 'SingleMuon', 'SingleElectron'],
}

for s in ['TT', 'TTV', 'Z', 'ZG', 'WW', 'VVV', 'ZZ', 'WZ']:
    wzPlotter.addHistogramToStack(s, sigMap[s])

wzPlotter.addHistogram('data', sigMap['data'])

plotStyles = {
    'zMass': {
        'xaxis': 'm_{l^{+}l^{#font[122]{\55}}}',
        'yaxis': 'Events/1 GeV'
    },
}

for plot in ['zMass']:
    wzPlotter.plot(plot, plot, **plotStyles[plot])
Esempio n. 9
0
             'TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8',
             'TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8',
            ],
    'data': [
             'DoubleMuon',
             'DoubleEG',
             'SingleMuon',
             'SingleElectron',
            ],
}

#samples = ['WW','TT','Z']
samples = ['TT','Z']

for s in samples:
    chargePlotter.addHistogramToStack(s,sigMap[s])

chargePlotter.addHistogram('data',sigMap['data'])

# plot definitions
plots = {
    # z cand
    'zMass'                 : {'xaxis': 'm_{l^{+}l^{-}} (GeV)', 'yaxis': 'Events / 1 GeV', 'rebin': range(81,101,1)},
    'zLeadingLeptonPt'      : {'xaxis': 'p_{T}^{Z_{lead}} (GeV)', 'yaxis': 'Events / 1 GeV', 'rebin': range(0,150,1)},
    'zLeadingLeptonEta'     : {'xaxis': '|#eta^{Z_{lead}}|', 'yaxis': 'Events',},
    'zSubLeadingLeptonPt'   : {'xaxis': 'p_{T}^{Z_{sublead}} (GeV)', 'yaxis': 'Events / 1 GeV', 'rebin': range(0,150,1)},
    'zSubLeadingLeptonEta'  : {'xaxis': '|#eta^{Z_{sublead}}|', 'yaxis': 'Events',},
}

# signal region
for plot in plots:
        'numcol': 3,
        'lumipos': 11,
        'legendpos': 34,
        'logy': False,
        'yscale': 1.5,
        'binlabels': ['']
    },
    #'numVertices'           : {'xaxis': 'Reconstructed Vertices', 'yaxis': 'Events'},
    #'met'                   : {'xaxis': 'E_{T}^{miss} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': range(0,320,20), 'numcol': 2, 'logy': False, 'overflow': True},
}

############################
### MC based BG estimate ###
############################
for s in samples:
    plotter.addHistogramToStack(s, sigMap[s])

if not blind: plotter.addHistogram('data', sigMap['data'])

for plot in plots:
    for sel in sels:
        kwargs = deepcopy(plots[plot])
        plotname = '{0}/{1}'.format(sel, plot)
        savename = '{0}/mc/{1}'.format(sel, plot)
        plotter.plot(plotname, savename, **kwargs)

plotter.clearHistograms()
plotter.addHistogramToStack('W', sigMap['W'])
plotter.addHistogramToStack('TT', sigMap['TT'])
plotter.addHistogramToStack('VV', sigMap['WW'] + sigMap['WZ'] + sigMap['ZZ'])
plotter.addHistogramToStack('DYB', sigMap['Z'])
Esempio n. 11
0
        'numcol': 1
    },
    'mllMinusZ': {
        'yaxis': '|m_{l^{+}l^{-}}-m_{Z}| (GeV)',
        'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)',
        'legendpos': 13,
        'numcol': 1
    },
}

############################
### MC based BG estimate ###
############################
if plotMC:
    for s in allsamples:
        hpp4lPlotter.addHistogramToStack(s, sigMap[s])

    for signal in signals:
        hpp4lPlotter.addHistogram(signal, sigMap[signal], signal=True)

    if not blind: hpp4lPlotter.addHistogram('data', sigMap['data'])

    if plotCount: plotCounts(hpp4lPlotter, baseDir='default', saveDir='mc')

    for plot in plots:
        kwargs = deepcopy(plots[plot])
        plotWithCategories(hpp4lPlotter,
                           plot,
                           baseDir='default',
                           saveDir='mc',
                           perCatBins=True,
Esempio n. 12
0
samples = ['TTV', 'ZG', 'VVV', 'ZZ', 'WZ']
allsamples = ['W', 'TT', 'Z', 'WW', 'TTV', 'VVV', 'ZZall', 'WZall']


def addUncertainties(plotter, datadriven=False):
    if datadriven:
        plotter.addUncertainty('datadriven', nonprompt=0.3)


#################
### MC driven ###
#################
for s in allsamples:
    name = s.replace('all', '')
    wzPlotter.addHistogramToStack(name, sigMap[s])

wzPlotter.addHistogram('data', sigMap['data'])

addUncertainties(wzPlotter)

if doCounts and doMC:
    plotCounts(wzPlotter, saveDir='mc', baseDir='default')
    if doVBS: plotCounts(wzPlotter, saveDir='vbs', baseDir='default-vbs')
    for cut in nMinusOneCuts:
        if doNMinusOne:
            plotCounts(wzPlotter,
                       baseDir='default/{0}'.format(cut),
                       saveDir='nMinusOne/{0}'.format(cut))
    for cut in vbsNMinusOneCuts:
        if doNMinusOne and doVBS:
    for p in plots.keys():
        if p not in toPlot: plots.pop(p)
    for s in special.keys():
        for p in special[s].keys():
            if p not in toPlot: special[s].pop(p)


############################
### MC based BG estimate ###
############################
if doMC:
    for sel in sels:
        plotter.clearHistograms()

        for s in samples:
            plotter.addHistogramToStack(s,sigMap[s])
        
        if 'lowmass' not in sel and 'highmass' not in sel:
            for signal in signals:
                plotter.addHistogram(signal,sigMap[signal],signal=True)
        
        if not blind or 'regionA' not in sel or 'lowmass' in sel or 'highmass' in sel: plotter.addHistogram('data',sigMap['data'])
        
        for plot in plots:
            kwargs = deepcopy(plots[plot])
            plotname = '{0}/{1}'.format(sel,plot)
            savename = '{0}/mc/{1}'.format(sel,plot)
            plotter.plot(plotname,savename,**kwargs)
        
        if blind and 'regionA' in sel and 'lowmass' not in sel and 'highmass' not in sel: plotter.addHistogram('data',sigMap['data'])
        
Esempio n. 14
0
        'TTJets_SingleLeptFromT_TuneCUETP8M1_13TeV-madgraphMLM-pythia8',
        'TTJets_SingleLeptFromTbar_TuneCUETP8M1_13TeV-madgraphMLM-pythia8',
    ],
    'data': [
        'DoubleMuon',
        'DoubleEG',
        'SingleMuon',
        'SingleElectron',
    ],
}

#samples = ['WW','TT','Z']
samples = ['TT', 'Z']

for s in samples:
    chargePlotter.addHistogramToStack(s, sigMap[s])

chargePlotter.addHistogram('data', sigMap['data'])

# plot definitions
plots = {
    # z cand
    'zMass': {
        'xaxis': 'm_{l^{+}l^{-}} (GeV)',
        'yaxis': 'Events / 1 GeV',
        'rebin': range(81, 101, 1)
    },
    'zLeadingLeptonPt': {
        'xaxis': 'p_{T}^{Z_{lead}} (GeV)',
        'yaxis': 'Events / 1 GeV',
        'rebin': range(0, 150, 1)
Esempio n. 15
0
        histMap['ZX'] += ['/'.join(['for3P1F', '2P2F'] + plotdirs)]
    return histMap


############################
### MC based BG estimate ###
############################
if doMC:
    for sel in selections:
        for region in regions:
            plotter.clearHistograms()

            thisblind = blind and sel in ['4P0F'] and region in ['', 'hzz4l']

            for s in ['ZX'] + samples:
                plotter.addHistogramToStack(s, sigMap[s])

            if not thisblind: plotter.addHistogram('data', sigMap['data'])

            for plot in plots:
                kwargs = deepcopy(plots[plot])
                plotname = '{}/{}/{}'.format(
                    sel, region, plot) if region else '{}/{}'.format(
                        sel, plot)
                savename = '{}/{}/mc/{}'.format(
                    sel, region, plot) if region else '{}/mc/{}'.format(
                        sel, plot)
                plotChannels(plotter, plotname, savename, **kwargs)

                for alt in alt_plots.get(plot, []):
                    kwargs = deepcopy(plots[plot])
Esempio n. 16
0
    # hpp
    #'hppMass'               : {'yaxis': 'm_{l^{#pm}l^{#pm}} (GeV)',     'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    #'st'                    : {'yaxis': '#Sigma p_{T}^{l} (GeV)',       'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    #'hppDeltaR'             : {'yaxis': '#DeltaR(l^{+}l^{+})',          'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    #'met'                   : {'yaxis': 'E_{T}^{miss} (GeV)',           'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    #'mllMinusZ'             : {'yaxis': '|m_{l^{+}l^{-}}-m_{Z}| (GeV)', 'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
}



############################
### MC based BG estimate ###
############################
if plotMC:
    for s in allsamples:
        hpp4lPlotter.addHistogramToStack(s,sigMap[s])
    
    for signal in signals:
        hpp4lPlotter.addHistogram(signal,sigMap[signal],signal=True)
    
    if not blind: hpp4lPlotter.addHistogram('data',sigMap['data'])
    
    if plotCount: plotCounts(hpp4lPlotter,baseDir='default',saveDir='mc')
    
    for plot in plots:
        kwargs = deepcopy(plots[plot])
        plotWithCategories(hpp4lPlotter,plot,baseDir='default',saveDir='mc',perCatBins=True,**kwargs)
        if plot=='hppMass' or plotAllChannels: plotChannels(hpp4lPlotter,plot,baseDir='default',saveDir='mc',**kwargs)
    
    # selection assuming 500
    if plotSig500:
    'z1Pt'                  : {'xaxis': 'm^{#mu#mu} #mu_{1} p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(25,150,5), 'logy': False, 'overflow': True},
    'z2Pt'                  : {'xaxis': 'm^{#mu#mu} #mu_{2} p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(10,150,5), 'logy': False, 'overflow': True},
    # t
    'tPt'                   : {'xaxis': '#tau p_{T} (GeV)', 'yaxis': 'Events / 5 GeV', 'numcol': 2, 'lumipos': 11, 'legendpos':34, 'rebin': range(10,150,5), 'logy': False, 'overflow': True},
    'tDM'                   : {'xaxis': '#tau Decay Mode', 'yaxis': 'Events', 'numcol': 3, 'lumipos': 11, 'legendpos':34, 'logy': False, 'yscale': 1.5,},
    # event
    'count'                 : {'xaxis': '', 'yaxis': 'Events', 'numcol': 3, 'lumipos': 11, 'legendpos':34, 'logy': False, 'yscale': 1.5,'binlabels': ['']},
    #'numVertices'           : {'xaxis': 'Reconstructed Vertices', 'yaxis': 'Events'},
    #'met'                   : {'xaxis': 'E_{T}^{miss} (GeV)', 'yaxis': 'Events / 20 GeV', 'rebin': range(0,320,20), 'numcol': 2, 'logy': False, 'overflow': True},
}

############################
### MC based BG estimate ###
############################
for s in samples:
    plotter.addHistogramToStack(s,sigMap[s])

if not blind: plotter.addHistogram('data',sigMap['data'])


for plot in plots:
    for sel in sels:
        kwargs = deepcopy(plots[plot])
        plotname = '{0}/{1}'.format(sel,plot)
        savename = '{0}/mc/{1}'.format(sel,plot)
        plotter.plot(plotname,savename,**kwargs)

plotter.clearHistograms()
plotter.addHistogramToStack('W',sigMap['W'])
plotter.addHistogramToStack('TT',sigMap['TT'])
plotter.addHistogramToStack('VV',sigMap['WW']+sigMap['WZ']+sigMap['ZZ'])
Esempio n. 18
0
envelope_cust = {
    # hpp
    'hppMass'               : {'yaxis': 'm_{l^{#pm}l^{#pm}} (GeV)',     'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    'st'                    : {'yaxis': '#Sigma p_{T}^{l} (GeV)',       'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    'hppDeltaR'             : {'yaxis': '#DeltaR(l^{+}l^{+})',          'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    'met'                   : {'yaxis': 'E_{T}^{miss} (GeV)',           'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
    #'mllMinusZ'             : {'yaxis': '|m_{l^{+}l^{-}}-m_{Z}| (GeV)', 'xaxis': 'm_{#Phi^{#pm#pm}} (GeV)', 'legendpos':13, 'numcol': 1},
}

############################
### MC based BG estimate ###
############################
if plotMC:
    for s in allsamples:
        hpp3lPlotter.addHistogramToStack(s,sigMap[s])

    for signal in signals:
        hpp3lPlotter.addHistogram(signal,sigMap[signal],signal=True)

    if not blind: hpp3lPlotter.addHistogram('data',sigMap['data'])

    if plotCount: plotCounts(hpp3lPlotter,saveDir='mc',baseDir='default')

    for plot in plots:
        kwargs = deepcopy(plots[plot])
        plotWithCategories(hpp3lPlotter,plot,saveDir='mc',baseDir='default',perCatBins=True,**kwargs)
        if plot=='hppMass': plotChannels(hpp3lPlotter,plot,saveDir='mc',baseDir='default',**kwargs)

    # selection assuming mass 500
    if plotSig500:
Esempio n. 19
0
             'GluGluToContinToZZTo4e_13TeV_MCFM701_pythia8',
             'GluGluToContinToZZTo4mu_13TeV_MCFM701_pythia8',
             'GluGluToContinToZZTo4tau_13TeV_MCFM701_pythia8',
             'ZZTo2L2Nu_13TeV_powheg_pythia8',
             'ZZTo2L2Q_13TeV_amcatnloFXFX_madspin_pythia8'],
    'VVV' : ['WZZ_TuneCUETP8M1_13TeV-amcatnlo-pythia8'],
    'TTV' : ['TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8'],
    'ZG'  : ['ZGTo2LG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'],
    'WW'  : ['WWTo2L2Nu_13TeV-powheg'],
    'Z'   : ['DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8',
             'DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'],
    'TT'  : ['TTJets_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8'],
    'data': ['DoubleMuon',
             'DoubleEG',
             'MuonEG',
             'SingleMuon',
             'SingleElectron'],
    'HppHmm500GeV' : ['HPlusPlusHMinusMinusHTo4L_M-500_13TeV-pythia8'],
}

for s in ['TT','TTV','Z','ZG','WW','VVV','ZZ','WZ']:
    hpp4lPlotter.addHistogramToStack(s,sigMap[s])

hpp4lPlotter.addHistogram('HppHmm500GeV',sigMap['HppHmm500GeV'])

if not blind:
    hpp4lPlotter.addHistogram('data',sigMap['data'])

for plot in ['hppMass']:
    hpp4lPlotter.plot(plot,plot,logy=True,numcol=2,legendpos=34)
             'DoubleMuon',
             'DoubleEG',
            ],
}

#samples = ['TT','Z','W','T','WW','QCD']
samples = ['TT','Z','W','T','WW']

allSamplesDict = {'MC':[]}

for s in samples:
    if s=='QCD': continue
    allSamplesDict['MC'] += sigMap[s]

for s in samples:
    dijetFakeRatePlotter.addHistogramToStack(s,sigMap[s])

dijetFakeRatePlotter.addHistogram('data',sigMap['data'])

# plot definitions
plots = {
    'pt'      : {'xaxis': 'p_{T} (GeV)', 'yaxis': 'Events/0.5 GeV', 'rebin': 5, 'rangex': [0,150]},
    'eta'     : {'xaxis': '#eta', 'yaxis': 'Events', 'rebin': 5, 'rangex': [-2.5,2.5]},
    #'met'     : {'xaxis': 'E_{T}^{miss} (GeV)', 'yaxis': 'Events/0.2 GeV', 'rebin': 2, 'rangex': [0,200]},
    'wMass'   : {'xaxis': 'm_{T}^{l^{+},MET} (GeV)', 'yaxis': 'Events/0.5 GeV', 'rebin': 5, 'rangex': [0,200]},
}

# signal region
for plot in plots:
    for lepton in ['loose','medium','tight']:
        for chan in chans:
Esempio n. 21
0
controls = ['dy','tt']


samples = ['TTV','ZG','VVV','ZZ','WZ']
allsamples = ['W','TT','Z','WW','TTV','VVV','ZZall','WZall']

def addUncertainties(plotter,datadriven=False):
    if datadriven:
        plotter.addUncertainty('datadriven',nonprompt=0.3)

#################
### MC driven ###
#################
for s in allsamples:
    name = s.replace('all','')
    wzPlotter.addHistogramToStack(name,sigMap[s])

wzPlotter.addHistogram('data',sigMap['data'])

addUncertainties(wzPlotter)

if doCounts and doMC:
    plotCounts(wzPlotter,saveDir='mc',baseDir='default')
    if doVBS: plotCounts(wzPlotter,saveDir='vbs',baseDir='default-vbs')
    for cut in nMinusOneCuts:
        if doNMinusOne: plotCounts(wzPlotter,baseDir='default/{0}'.format(cut),saveDir='nMinusOne/{0}'.format(cut))
    for cut in vbsNMinusOneCuts:
        if doNMinusOne and doVBS: plotCounts(wzPlotter,baseDir='default-vbs/{0}'.format(cut),saveDir='vbsNMinusOne/{0}'.format(cut))
    for control in controls:
        if doControls: plotCounts(wzPlotter,saveDir=control,baseDir=control)
        if doVBS and doControls: plotCounts(wzPlotter,saveDir=control+'-vbs',baseDir=control+'-vbs')