'WUp': {
        'W': 1.1,
    },
    'WDown': {
        'W': 0.9,
    },
    ## TT up/down
    'TTUp': {
        'TT': 1.1,
    },
    'TTDown': {
        'TT': 0.9,
    },
}

plotInfo = PlotInfo()
plotInfo.xTitle = 'm_{vis} [GeV]'
plotInfo.yTitle = 'm_{T} [GeV]'

# Loop on variables
for variable in variables:
    # Loop on global selections
    for global_selection in global_selections:
        outputFile = ROOT.TFile.Open(
            'results/backgroundFraction_{SEL}_{VAR}.root'.format(
                SEL=global_selection.format(SIGN='SS_'), VAR=variable.name),
            'RECREATE')
        # Loop on systematic shifts
        for shiftname, shift in shifts.items():
            print '>>>>>>>>>>>>>>>>>>>>>>>>>>'
            print '  Shift ' + shiftname
names2.append("Iso_Medium_Vs_InvertIso_Medium")

variables = ["tau_pt_vs_decayMode"]
variableNames = {}
variableNames["tau_pt_vs_eta"] = ["p_{T}^{#tau} [GeV]", "#eta^{#tau}"]
variableNames["tau_pt_vs_decayMode"] = ["p_{T}^{#tau} [GeV]", "decay mode"]
variableNames["tau_pt_vs_pdgId"] = [
    "p_{T}^{#tau} [GeV]", "pdg ID#times sign-flip"
]
variableNames["tau_pt_vs_mergedPdgId"] = [
    "p_{T}^{#tau} [GeV]", "pdg ID#times sign-flip"
]
variableNames["tau_jet_pt_vs_decayMode"] = ["p_{T}^{jet} [GeV]", "decay mode"]
variableNames["tau_jet_pt_vs_pt"] = ["p_{T}^{jet} [GeV]", "p_{T}^{#tau} [GeV]"]

plotInfo = PlotInfo()

if not os.path.exists(plotDir + "/" + name):
    os.makedirs(plotDir + "/" + name)
outputFile = ROOT.TFile.Open(plotDir + "/" + name + "/" + name + ".root",
                             "RECREATE")

efficiencyPlots = []

effPlots = Efficiency2DPlots()
effPlots.name = name
effPlots.histoBaseName = "hFakeRate"
effPlots.inputFileNames = [inputFileName]
effPlots.selectionLevels = selectionLevels2
effPlots.plotInfo = plotInfo
effPlots.referenceLevels = referenceLevels2
    {
        'W':0.9,
    },
    ## TT up/down
    'TTUp':
    {
        'TT':1.1,
    },
    'TTDown':
    {
        'TT':0.9,
    },
}


plotInfo = PlotInfo()
plotInfo.xTitle = 'm_{vis} [GeV]'
plotInfo.yTitle = 'm_{T} [GeV]'


# Loop on variables
for variable in variables:
    # Loop on global selections
    for global_selection in global_selections:
        outputFile = ROOT.TFile.Open('results/backgroundFraction_{SEL}_{VAR}.root'.format(SEL=global_selection.format(SIGN='SS_'),VAR=variable.name), 'RECREATE')
        # Loop on systematic shifts
        for shiftname, shift in shifts.items():
            print '>>>>>>>>>>>>>>>>>>>>>>>>>>'
            print '  Shift '+shiftname
            plots = []
            histos = None