Esempio n. 1
0
def createAnalyzer(dataVersion, era):
    a = Analyzer(
        "TriggerEfficiency",
        name=era,
        Trigger=PSet(triggerOR=[], triggerOR2=[]),
        usePileupWeights=True,
        offlineSelection=leg,
        MuonSelection=PSet(
            #            discriminators = ["muIDMedium"],
            #            discriminators = ["TrgMatch_IsoMu20_eta2p1"],
            discriminators=["Muons_TrgMatch_IsoMu16_eta2p1"], ),
        TauSelection=PSet(discriminators=[
            "byLooseCombinedIsolationDeltaBetaCorr3Hits", "againstMuonTight3",
            "againstElectronMediumMVA5"
        ], ),
        binning=binning,
        xLabel=xLabel,
        yLabel=yLabel,
    )

    if isData(dataVersion):
        a.Trigger.triggerOR = [
            "HLT_IsoMu15_eta2p1_L1ETM20_v3", "HLT_IsoMu15_eta2p1_L1ETM20_v4",
            "HLT_IsoMu15_eta2p1_L1ETM20_v5", "HLT_IsoMu15_eta2p1_L1ETM20_v6",
            "HLT_IsoMu15_eta2p1_L1ETM20_v7"
        ]
        a.Trigger.triggerOR2 = [
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v2",
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v4",
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v6",
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v7",
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v9",
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v10"
        ]
        if era == "2015C":
            #            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_CaloMET30_v1",
            #                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1"]
            #            a.Trigger.triggerOR2 = ["HLT_IsoMu16_eta2p1_CaloMET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
            #                                    "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1"]
            a.Trigger.triggerOR = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx"
            ]
#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v2"]
#            a.Trigger.triggerOR2 = ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v2"]
        if era == "2015D":
            a.Trigger.triggerOR = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v2",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v3",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx",
                "HLT_IsoMu16_eta2p1_MET30_v1", "HLT_IsoMu16_eta2p1_MET30_vx"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v2",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v3",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx",
                "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_vx"
            ]
        if era == "2015CD":
            a.Trigger.triggerOR = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v2",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v3",
                "HLT_IsoMu16_eta2p1_MET30_v1"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v2",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v3",
                "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_v1"
            ]
#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v1",
#                                   "HLT_IsoMu20_eta2p1_v2",
#                                   "HLT_IsoMu17_eta2p1_v2"]
#            a.Trigger.triggerOR2= ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v1",
#                                   "HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v2"]

        lumi, runmin, runmax = runRange(era)
        a.lumi = lumi
        a.runMin = runmin
        a.runMax = runmax
    else:
        a.Trigger.triggerOR = ["HLT_IsoMu15_eta2p1_L1ETM20_v5"]
        a.Trigger.triggerOR2 = [
            "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v6"
        ]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = [
                "HLT_IsoMu16_eta2p1_CaloMET30_v1",
                "HLT_IsoMu16_eta2p1_MET30_vx",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_IsoMu16_eta2p1_CaloMET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_vx",
                "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx"
            ]


#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v1"]
#            a.Trigger.triggerOR2 = ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v1"]

#print "check triggerOR",a.Trigger.triggerOR
    return a
Esempio n. 2
0
def createAnalyzer(dataVersion,era,onlineSelection = "MET80"):
    useCaloMET = False
    if "CaloMET" in era:
        useCaloMET = True
        era = era[:-8]

    a = Analyzer("TriggerEfficiency",
        name = era,
        Trigger = PSet(
            triggerOR  = [],
            triggerOR2 = []
        ),
        usePileupWeights = True,
#        usePileupWeights = False,
        onlineSelection = onlineSelection,
        offlineSelection = leg,
        TauSelection      = signalAnalysis.tauSelection,
#        TauSelection = PSet(
#            discriminators = ["byLooseCombinedIsolationDeltaBetaCorr3Hits",
#                             "againstMuonTight3",
#                             "againstElectronMediumMVA5"],
#        ),
        ElectronSelection = signalAnalysis.eVeto,
        MuonSelection     = signalAnalysis.muVeto,
        JetSelection      = signalAnalysis.jetSelection,
        BJetSelection     = signalAnalysis.bjetSelection,
        binning = binning,
        xLabel  = xLabel,
        yLabel  = yLabel,
    )
#    a.TauSelection.applyTriggerMatching = False
    a.JetSelection.numberOfJetsCutValue = 3
#    a.BJetSelection.bjetDiscrWorkingPoint = "Medium"
    a.BJetSelection.numberOfBJetsCutValue = 1

    if dataVersion.isData():
        a.Trigger.triggerOR = ["HLT_LooseIsoPFTau35_Trk20_Prong1_v2",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v3",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v4",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v6",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v7",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v9",
                               "HLT_LooseIsoPFTau35_Trk20_Prong1_v10"]
        a.Trigger.triggerOR2 = ["HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v2",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v3",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v4",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v6",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v7",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v9",
                                "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v10"]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = ["HLT_LooseIsoPFTau50_Trk30_eta2p1_v1",
                                   "HLT_LooseIsoPFTau50_Trk30_eta2p1_v2",
                                   "HLT_LooseIsoPFTau50_Trk30_eta2p1_v3",
                                   "HLT_LooseIsoPFTau50_Trk30_eta2p1_vx"]
            a.Trigger.triggerOR2 = ["HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_JetIdCleaned_v1",
                                    "HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_JetIdCleaned_v2",
                                    "HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_v1",
                                    "HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_JetIdCleaned_vx",
                                    "HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_vx"]

        lumi,runmin,runmax = runRange(era)
        a.lumi    = lumi
        a.runMin  = runmin
        a.runMax  = runmax
    else:
        a.Trigger.triggerOR = ["HLT_LooseIsoPFTau35_Trk20_Prong1_v6"]
        a.Trigger.triggerOR2 = ["HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v6"]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = ["HLT_LooseIsoPFTau50_Trk30_eta2p1_v1",
                                   "HLT_LooseIsoPFTau50_Trk30_eta2p1_vx"]
            a.Trigger.triggerOR2 = ["HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_v1",
                                    "HLT_LooseIsoPFTau50_Trk30_eta2p1_"+onlineSelection+"_vx"]

    if useCaloMET:
        a.Trigger.triggerOR2 = []

    return a
Esempio n. 3
0
def createAnalyzer(dataVersion, era, onlineSelection="MET80"):
    useCaloMET = False
    if "CaloMET" in era:
        useCaloMET = True
        era = era[:-8]

    a = Analyzer(
        "TriggerEfficiency",
        name=era,
        Trigger=PSet(triggerOR=[], triggerOR2=[]),
        usePileupWeights=True,
        #        usePileupWeights = False,
        onlineSelection=onlineSelection,
        offlineSelection=leg,
        TauSelection=signalAnalysis.tauSelection,
        #        TauSelection = PSet(
        #            discriminators = ["byLooseCombinedIsolationDeltaBetaCorr3Hits",
        #                             "againstMuonTight3",
        #                             "againstElectronMediumMVA5"],
        #        ),
        ElectronSelection=signalAnalysis.eVeto,
        MuonSelection=signalAnalysis.muVeto,
        JetSelection=signalAnalysis.jetSelection,
        BJetSelection=signalAnalysis.bjetSelection,
        binning=binning,
        xLabel=xLabel,
        yLabel=yLabel,
    )
    #    a.TauSelection.applyTriggerMatching = False
    a.JetSelection.numberOfJetsCutValue = 3
    #    a.BJetSelection.bjetDiscrWorkingPoint = "Medium"
    a.BJetSelection.numberOfBJetsCutValue = 1

    if dataVersion.isData():
        a.Trigger.triggerOR = [
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v2",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v3",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v4",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v6",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v7",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v9",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_v10"
        ]
        a.Trigger.triggerOR2 = [
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v2",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v3",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v4",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v6",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v7",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v9",
            "HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v10"
        ]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = [
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_v2",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_v3",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_vx"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection +
                "_JetIdCleaned_v1", "HLT_LooseIsoPFTau50_Trk30_eta2p1_" +
                onlineSelection + "_JetIdCleaned_v2",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection + "_v1",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection +
                "_JetIdCleaned_vx",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection + "_vx"
            ]

        lumi, runmin, runmax = runRange(era)
        a.lumi = lumi
        a.runMin = runmin
        a.runMax = runmax
    else:
        a.Trigger.triggerOR = ["HLT_LooseIsoPFTau35_Trk20_Prong1_v6"]
        a.Trigger.triggerOR2 = ["HLT_LooseIsoPFTau35_Trk20_Prong1_MET70_v6"]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = [
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_v1",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_vx"
            ]
            a.Trigger.triggerOR2 = [
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection + "_v1",
                "HLT_LooseIsoPFTau50_Trk30_eta2p1_" + onlineSelection + "_vx"
            ]

    if useCaloMET:
        a.Trigger.triggerOR2 = []

    return a
Esempio n. 4
0
def createAnalyzer(dataVersion,era):
    a = Analyzer("TriggerEfficiency",
        name = era,
        Trigger = PSet(
            triggerOR  = [],
            triggerOR2 = []
        ),
        usePileupWeights = True,
        offlineSelection = leg,
        MuonSelection = PSet(
#            discriminators = ["muIDMedium"],
#            discriminators = ["TrgMatch_IsoMu20_eta2p1"],
            discriminators = ["Muons_TrgMatch_IsoMu16_eta2p1"],
        ),
        TauSelection = PSet(
            discriminators = ["byLooseCombinedIsolationDeltaBetaCorr3Hits",
                             "againstMuonTight3",
                             "againstElectronMediumMVA5"],
        ),
        binning = binning,
        xLabel  = xLabel,
        yLabel  = yLabel,
    )

    if isData(dataVersion):
        a.Trigger.triggerOR = ["HLT_IsoMu15_eta2p1_L1ETM20_v3",
                               "HLT_IsoMu15_eta2p1_L1ETM20_v4",
                               "HLT_IsoMu15_eta2p1_L1ETM20_v5",
                               "HLT_IsoMu15_eta2p1_L1ETM20_v6",
                               "HLT_IsoMu15_eta2p1_L1ETM20_v7"]
        a.Trigger.triggerOR2 = ["HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v2",
                                "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v4",
                                "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v6",
                                "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v7",
                                "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v9",
                                "HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v10"]
        if era == "2015C":
#            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_CaloMET30_v1",
#                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1"]
#            a.Trigger.triggerOR2 = ["HLT_IsoMu16_eta2p1_CaloMET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
#                                    "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1"]
            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1","HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx"]
            a.Trigger.triggerOR2= ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1","HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx"]
#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v2"]
#            a.Trigger.triggerOR2 = ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v2"]
        if era == "2015D":
            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v2",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v3",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx",
                                   "HLT_IsoMu16_eta2p1_MET30_v1",
                                   "HLT_IsoMu16_eta2p1_MET30_vx"]
            a.Trigger.triggerOR2= ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v2",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v3",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx",
                                   "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
                                   "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_vx"]
        if era == "2015CD":
            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v1",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v2",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_v3",
                                   "HLT_IsoMu16_eta2p1_MET30_v1"]
            a.Trigger.triggerOR2= ["HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v1",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v2",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_v3",
                                   "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_v1"]
#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v1",
#                                   "HLT_IsoMu20_eta2p1_v2",
#                                   "HLT_IsoMu17_eta2p1_v2"]
#            a.Trigger.triggerOR2= ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v1",
#                                   "HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v2"]

        lumi,runmin,runmax = runRange(era)
        a.lumi    = lumi
        a.runMin  = runmin
        a.runMax  = runmax
    else:
        a.Trigger.triggerOR = ["HLT_IsoMu15_eta2p1_L1ETM20_v5"]
        a.Trigger.triggerOR2 = ["HLT_IsoMu15_eta2p1_LooseIsoPFTau35_Trk20_Prong1_L1ETM20_v6"]
        if era == "2015C" or era == "2015D" or era == "2015CD":
            a.Trigger.triggerOR = ["HLT_IsoMu16_eta2p1_CaloMET30_v1",
                                   "HLT_IsoMu16_eta2p1_MET30_vx",
                                   "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_vx"]
            a.Trigger.triggerOR2 = ["HLT_IsoMu16_eta2p1_CaloMET30_LooseIsoPFTau50_Trk30_eta2p1_v1",
                                    "HLT_IsoMu16_eta2p1_MET30_LooseIsoPFTau50_Trk30_eta2p1_vx",
                                    "HLT_IsoMu16_eta2p1_MET30_JetIdCleaned_LooseIsoPFTau50_Trk30_eta2p1_vx"]
#            a.Trigger.triggerOR = ["HLT_IsoMu20_eta2p1_v1"]
#            a.Trigger.triggerOR2 = ["HLT_IsoMu17_eta2p1_LooseIsoPFTau20_v1"]

    #print "check triggerOR",a.Trigger.triggerOR
    return a