Example #1
0
estimators = EstimatorList(setup, processes=["QCD-DD"])
estimate = getattr(estimators, "QCD-DD")
estimate.initCache(setup.defaultCacheDir())

# Accounting for
leptonPtCutVar = "LeptonTightInvIsoNoSieie0_pt"
leptonEtaCutVar = "abs(LeptonTightInvIsoNoSieie0_eta+LeptonTightInvIsoNoSieie0_deltaEtaSC)"
QCDTF_updates_2J = copy.deepcopy(QCDTF_updates)

key = (data_sample.name, "AR", args.variable, "_".join(map(str, args.binning)),
       data_sample.weightString, data_sample.selectionString, selection)
if dirDB.contains(key) and not args.overwrite:
    dataHist = dirDB.get(key).Clone("data")
else:
    dataHist = data_sample.get1DHistoFromDraw(args.variable,
                                              binning=args.binning,
                                              selectionString=selection)
    dirDB.add(key, dataHist.Clone("data"), overwrite=True)

dataHist_SB = dataHist.Clone("data_SB")
dataHist_SB.Scale(0)

genCat = [None]
if args.photonCat:
    hists = {}
    genCat = [
        "noChgIsoNoSieiephotoncat0", "noChgIsoNoSieiephotoncat1",
        "noChgIsoNoSieiephotoncat2", "noChgIsoNoSieiephotoncat3",
        "noChgIsoNoSieiephotoncat4"
    ]
    catSettings = {
Example #2
0
    "cos(JetGoodInvLepIso0_phi-JetGoodInvLepIso1_phi)",
}

invVariable = replaceVariable[
    args.variable] if args.variable in replaceVariable.keys(
    ) else args.variable

# histos
key = (data_sample.name, "Binv", args.variable,
       "_".join(map(str, args.binning)), data_sample.weightString,
       data_sample.selectionString, preSelection)
if dirDB.contains(key) and not args.overwrite:
    dataHist_SB = dirDB.get(key)
else:
    dataHist_SB = data_sample.get1DHistoFromDraw(invVariable,
                                                 binning=args.binning,
                                                 selectionString=preSelection,
                                                 addOverFlowBin="upper")
    dirDB.add(key, dataHist_SB, overwrite=True)

key = (data_sample.name, "AR", args.variable, "_".join(map(str, args.binning)),
       data_sample.weightString, data_sample.selectionString, selection)
if dirDB.contains(key) and not args.overwrite:
    dataHist = dirDB.get(key)
else:
    dataHist = data_sample.get1DHistoFromDraw(args.variable,
                                              binning=args.binning,
                                              selectionString=selection,
                                              addOverFlowBin="upper")
    dirDB.add(key, dataHist, overwrite=True)

dataHist_SB.style = styles.errorStyle(ROOT.kBlack)
Example #3
0
        if addSel:
            addSel = cutInterpreter.cutString( addSel )
            print addSel
            for iso, invIso in replaceSelection.iteritems():
                addSel = addSel.replace(iso,invIso)
            print preSelection
            print addSel
            preSelection += "&&" + addSel
else:
    raise Exception("Region not implemented")

key = (data_sample.name, "mTinv", "_".join(map(str,binning)), data_sample.weightString, data_sample.selectionString, preSelection)
if dirDB.contains(key) and not args.overwrite:
    dataHist_SB = dirDB.get(key).Clone("mTinv")
else:
    dataHist_SB = data_sample.get1DHistoFromDraw( mTinv, binning=binning, selectionString=preSelection, addOverFlowBin="upper" )
    dirDB.add(key, dataHist_SB.Clone("mTinv"), overwrite=True)

key = (data_sample.name, "mT", "_".join(map(str,binning)), data_sample.weightString, data_sample.selectionString, selection)
if dirDB.contains(key) and not args.overwrite:
    dataHist = dirDB.get(key).Clone("mT")
else:
    dataHist = data_sample.get1DHistoFromDraw( "mT",    binning=binning, selectionString=selection,    addOverFlowBin="upper" )
    dirDB.add(key, dataHist.Clone("mT"), overwrite=True)

qcdHist     = dataHist_SB.Clone("QCD")

dataHist_SB.style      = styles.errorStyle( ROOT.kBlack )
dataHist_SB.legendText = "Observed (%s)"%args.mode.replace("mu","#mu")
dataHist.style         = styles.errorStyle( ROOT.kBlack )
dataHist.legendText    = "Observed (%s)"%args.mode.replace("mu","#mu")
Example #4
0
    estimate.initCache(setup.defaultCacheDir())

# Accounting for 
leptonPtCutVar = "LeptonTightInvIso0_pt"
if args.mode == "e":
    leptonEtaCutVar = "abs(LeptonTightInvIso0_eta+LeptonTightInvIso0_deltaEtaSC)"
else:
    leptonEtaCutVar = "abs(LeptonTightInvIso0_eta)"

QCDTF_updates_2J = copy.deepcopy(QCDTF_updates)

key = (data_sample.name, "AR", args.variable, "_".join(map(str,args.binning)), data_sample.weightString, data_sample.selectionString, selection)
if dirDB.contains(key) and not args.overwrite:
    dataHist = dirDB.get(key).Clone("dataAR")
else:
    dataHist = data_sample.get1DHistoFromDraw( args.variable, binning=args.binning, selectionString=selection, addOverFlowBin="upper" )
    dirDB.add(key, dataHist.Clone("dataAR"), overwrite=True)

dataHist_SB  = dataHist.Clone("data_SB")
dataHist_SB.Scale(0)

genCat = [None]
if args.photonCat:
    hists = {}
    genCat = ["noChgIsoNoSieiephotoncat0","noChgIsoNoSieiephotoncat2","noChgIsoNoSieiephotoncat1","noChgIsoNoSieiephotoncat3","noChgIsoNoSieiephotoncat4"]
    catSettings = { "noChgIsoNoSieiephotoncat0":{"texName":"Genuine #gamma",  "color":color.gen  },
                    "noChgIsoNoSieiephotoncat2":{"texName":"Misid. e",     "color":color.misID},
                    "noChgIsoNoSieiephotoncat134":{"texName":"Hadronic #gamma/fake",  "color":color.had  }, }
#                    "noChgIsoNoSieiephotoncat1":{"texName":"had #gamma",  "color":color.had  },
#                    "noChgIsoNoSieiephotoncat3":{"texName":"fake #gamma", "color":color.fakes},
#                    "noChgIsoNoSieiephotoncat4":{"texName":"PU #gamma",   "color":color.PU}  }