Exemple #1
0
def ConfiguredAsgElectronLikelihoodTool(name,
                                        quality,
                                        menu=electronLHmenu.offlineMC16,
                                        **kw):
    """
    Configure the AsgElectronIsEMSelector with the quality cuts
    and allow for (re-)setting of all provided cuts.
    """
    try:
        ntuple = ElectronLikelihoodMap(quality, menu)
    except KeyError:
        sys.stderr.write(
            "Electron quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h).\n This function only supports standard electron IDs, and not photon or forward IDs\n"
        )
        raise

    # Get the label for user data
    tmpName = (ntuple[1]).func_name
    labelName = "isLH" + ((tmpName.split("Config")[0]).split("Likelihood")[1])

    # Create an instance of the tool
    tool = CfgMgr.AsgElectronLikelihoodTool(name, **kw)
    ntuple[1](tool)

    # Get all provided properties and overwrite the default values with them
    SetToolProperties(tool, **kw)

    #print tool
    return tool
Exemple #2
0
def getMETMakerAlg(suffix, jetSelection="Tier0", jetColl=""):
    from AthenaCommon import CfgMgr

    print "Generate METMaker and METMakerAlg for METAssoc_" + suffix
    from AthenaCommon.AppMgr import ToolSvc
    from AthenaCommon.AlgSequence import AlgSequence
    topSequence = AlgSequence()

    doPFlow = 'PFlow' in suffix
    doTruth = suffix.startswith('Truth')
    metMaker = CfgMgr.met__METMaker(
        'METMaker_' + suffix,
        DoPFlow=doPFlow,
        DoSoftTruth=doTruth,
        JetSelection=jetSelection,
    )
    ToolSvc += metMaker

    muonSel = CfgMgr.CP__MuonSelectionTool(
        "MuonSelectionTool_METMakerAlg",
        MuQuality=1,  # Medium
        MaxEta=2.4)
    ToolSvc += muonSel

    elecSelLH = CfgMgr.AsgElectronLikelihoodTool(
        "EleSelLikelihood_METMakerAlg", WorkingPoint="MediumLHElectron")
    ToolSvc += elecSelLH

    photonSelIsEM = CfgMgr.AsgPhotonIsEMSelector("PhotonSelIsEM_METMakerAlg",
                                                 WorkingPoint="TightPhoton")
    ToolSvc += photonSelIsEM

    tauSel = CfgMgr.TauAnalysisTools__TauSelectionTool(
        "TauSelectionTool_METMakerAlg")
    ToolSvc += tauSel

    if jetColl == "":
        jetColl = suffix + 'Jets'
        if doTruth:
            jetColl = suffix.split('_')[1] + 'Jets'
    makerAlg = CfgMgr.met__METMakerAlg(
        'METMakerAlg_' + suffix,
        METMapName='METAssoc_' + suffix,
        METCoreName='MET_Core_' + suffix,
        METName='MET_Reference_' + suffix,
        InputJets=jetColl,
        Maker=metMaker,
        MuonSelectionTool=muonSel,
        ElectronLHSelectionTool=elecSelLH,
        PhotonIsEMSelectionTool=photonSelIsEM,
        TauSelectionTool=tauSel,
    )
    return makerAlg
Exemple #3
0
def getEgammaLikelihoodSelectorCaloOnly(calibPath):

    from AthenaCommon.AppMgr import ToolSvc
    calibname = calibPath.split('/')[-1]
    configList = [
        calibPath + '/ElectronLikelihoodTightTriggerConfig_CaloOnly.conf',
        calibPath + '/ElectronLikelihoodMediumTriggerConfig_CaloOnly.conf',
        calibPath + '/ElectronLikelihoodLooseTriggerConfig_CaloOnly.conf',
        calibPath + '/ElectronLikelihoodVeryLooseTriggerConfig_CaloOnly.conf',
    ]
    asgTools = []
    for idx, config in enumerate(configList):
        name = config.split('/')[-1].replace('.conf', '_EFCalo_' + calibname)
        asg = CfgMgr.AsgElectronLikelihoodTool(name)
        asg.usePVContainer = False
        asg.ConfigFile = config
        asg.caloOnly = True
        ToolSvc += asg
        asgTools.append(asg)
    return asgTools
Exemple #4
0
def TrigElectronSelectors(sel):
    import logging

    mlog = logging.getLogger('EgammaDefs')

    # Configure the LH selectors
    from AthenaCommon import CfgMgr
    #TrigEgammaKeys.pidVersion.set_On()
    mlog.info("TrigEgammaPidTools version " + str(TrigEgammaKeys.pidVersion))
    ConfigFilePath = 'ElectronPhotonSelectorTools/trigger/' + TrigEgammaKeys.pidVersion

    SelectorNames = {
        'lhvloose': 'AsgElectronLHVLooseSelector',
        'lhloose': 'AsgElectronLHLooseSelector',
        'lhmedium': 'AsgElectronLHMediumSelector',
        'lhtight': 'AsgElectronLHTightSelector',
    }

    ElectronToolConfigFile = {
        'lhvloose': 'ElectronLikelihoodVeryLooseTriggerConfig.conf',
        'lhloose': 'ElectronLikelihoodLooseTriggerConfig.conf',
        'lhmedium': 'ElectronLikelihoodMediumTriggerConfig.conf',
        'lhtight': 'ElectronLikelihoodTightTriggerConfig.conf',
    }

    mlog.info('Configuring electron PID tools...')
    if sel not in SelectorNames:
        mlog.error('No selector defined for working point ' + sel +
                   ' for electrons :-( ')
        return
    else:
        mlog.info('Configuring electron PID for ' + sel)
        SelectorTool = CfgMgr.AsgElectronLikelihoodTool(SelectorNames[sel])
        SelectorTool.ConfigFile = ConfigFilePath + '/' + ElectronToolConfigFile[
            sel]
        SelectorTool.usePVContainer = False
        SelectorTool.skipDeltaPoverP = True
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += SelectorTool

        return SelectorTool
Exemple #5
0
def TrigEgammaMonTool():
    #from AthenaCommon.AppMgr import ToolSvc
    from AthenaCommon import CfgMgr
    from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector
    from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap,electronPIDmenu
    from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConfig import TrigEgammaNavAnalysisTool,TrigEgammaNavTPAnalysisTool,TrigEgammaNavTPJpsieeAnalysisTool
    from TrigEgammaAnalysisTools.TrigEgammaProbelist import default,defaultJpsi # to import probelist
    #from TrigHLTMonitoring.HLTMonTriggerList import hltmonList # import MaM trigger list, not available!!!!
   
    # Import full trigger menu, requires setup of both MC and Physics
    # Makes available all possible triggers which can be in any dataset
    # Set final list from triggers available in data
    import TriggerMenu.menu.Physics_pp_v5 as physics_menu
    from TriggerJobOpts.TriggerFlags import TriggerFlags

    # Offline selectors -- taken from latest conf
    # Offline tunes for 50 ns
    LooseElectronSelector=CfgMgr.AsgElectronIsEMSelector("LooseElectron50nsSelector")
    LooseElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronIsEMLooseSelectorCutDefs.conf"
    ToolSvc+=LooseElectronSelector
    MediumElectronSelector=CfgMgr.AsgElectronIsEMSelector("MediumElectron50nsSelector")
    MediumElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronIsEMMediumSelectorCutDefs.conf"
    ToolSvc+=MediumElectronSelector
    TightElectronSelector=CfgMgr.AsgElectronIsEMSelector("TightElectron50nsSelector")
    TightElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronIsEMTightSelectorCutDefs.conf"
    ToolSvc+=TightElectronSelector

    LooseLHSelector=CfgMgr.AsgElectronLikelihoodTool("LooseLH50nsSelector")
    LooseLHSelector.ConfigFile="ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronLikelihoodLooseOfflineConfig2015.conf"
    ToolSvc+=LooseLHSelector
    MediumLHSelector=CfgMgr.AsgElectronLikelihoodTool("MediumLH50nsSelector")
    MediumLHSelector.ConfigFile="ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronLikelihoodMediumOfflineConfig2015.conf"
    ToolSvc+=MediumLHSelector
    TightLHSelector=CfgMgr.AsgElectronLikelihoodTool("TightLH50nsSelector")
    TightLHSelector.ConfigFile="ElectronPhotonSelectorTools/offline/mc15_20150429/ElectronLikelihoodTightOfflineConfig2015.conf"
    ToolSvc+=TightLHSelector

    physics_menu.setupMenu()
    egammaMenu = TriggerFlags.EgammaSlice.signatures()
    egammaChains = []
    l1Items = []
    addItems = []
    for egchain in egammaMenu:
        egammaChains.append(egchain[0])
        l1Items.append(egchain[1])
        addItems.append(egchain[3])
    # Set list to full menu
    #probelist = egammaChains
    probelist = default
    Jpsiprobelist = defaultJpsi
    #probelist=['e5_loose_idperf','e5_lhloose_idperf','e0_perf_L1EM15','g0_perf_L1EM15']

    basePath = '/HLT/Egamma/'
    tagItems = ['e24_lhmedium_iloose_L1EM18VH',
        'e24_lhmedium_iloose_L1EM20VH',
        'e24_lhtight_iloose',
        'e26_lhtight_iloose',
        # Primary cut-based electron triggers
        'e24_medium_iloose_L1EM18VH',
        'e24_medium_iloose_L1EM20VH',
        'e24_tight_iloose',
        'e26_tight_iloose']

    JpsitagItems = ['e5_tight_e4_etcut',
                    'e9_tight_e4_etcut',
                    'e14_tight_e4_etcut',
                    'e9_etcut_e5_tight',
                    'e14_etcut_e5_tight',
                    # Primary cut-based electron triggers
                    'e5_tight_e4_etcut_Jpsiee',
                    'e9_tight_e4_etcut_Jpsiee',
                    'e14_tight_e4_etcut_Jpsiee',
                    'e9_etcut_e5_tight_Jpsiee',
                    'e14_etcut_e5_tight_Jpsiee']
    Analysis = TrigEgammaNavAnalysisTool(name='NavAnalysis',
            DirectoryPath=basePath+'Analysis',
            TriggerList=probelist, 
            ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
            ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
            File="",
            OutputLevel=0,DetailedHistograms=False)
    TPAnalysis = TrigEgammaNavTPAnalysisTool(name='NavTPAnalysis',
            DirectoryPath=basePath+'TPAnalysis',
            TriggerList=probelist, 
            ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector],
            ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector], 
            File="",
            TagTriggerList=tagItems,
            RemoveCrack=False,
            OutputLevel=0,DetailedHistograms=True)
    JpsiTPAnalysis = TrigEgammaNavTPJpsieeAnalysisTool(name='NavTPJpsieeAnalysis',
                                                        DirectoryPath=basePath+'TPJpsieeAnalysis',
                                                        TriggerList=Jpsiprobelist,
                                                        File="",
                                                        TagTriggerList= JpsitagItems,
                                                        RemoveCrack=True,
                                                        ZeeLowerMass=2,
                                                        ZeeUpperMass=5,
                                                        OfflineTagMinEt=5,
                                                        OfflineProbeMinEt=5,
                                                        OutputLevel=0,
                                                        DetailedHistograms=False,
                                                        doJpsiee=True)
    from TrigEgammaAnalysisTools.TrigEgammaAnalysisToolsConf import TrigEgammaMonTool
    TrigEgammaMonTool = TrigEgammaMonTool( name = "TrigEgammaMonTool", 
            histoPathBase=basePath,
            Tools=["TrigEgammaNavAnalysisTool/NavAnalysis",
                "TrigEgammaNavTPAnalysisTool/NavTPAnalysis",
                "TrigEgammaNavTPAnalysisTool/NavTPJpsieeAnalysis"])
Exemple #6
0
def ElectronPidTools():
    #from AthenaCommon.AppMgr import ToolSvc
    # Run1 selectors -- added directly to ToolSvc from default config via mapping
    #print '=========== Run1 PID ============'
    for key in ElectronToolName:
        if not ('lh' in key):
            if ('1' in key):
                tool = ConfiguredAsgElectronIsEMSelector(
                    ElectronToolName[key], ElectronPidName[key],
                    electronPIDmenu.menuTrig2012)
                addToToolSvc(tool)

    # Trigger specific Run1 selectors for high pt triggers
    #print '=========== Run1 PID trigger specific ============'
    for key in ElectronHypoToolName:
        if not ('lh' in key):
            if ('1' in key):
                tool = ConfiguredAsgElectronIsEMSelector(
                    ElectronHypoToolName[key], ElectronPidName[key],
                    electronPIDmenu.menuTrig2012)
                tool.trigEtTh = 20000
                addToToolSvc(tool)

    # Calo only Run1 selectors
    #print '=========== Run1 PID Calo============'
    for key in ElectronCaloToolName:
        if not ('lh' in key):
            if ('1' in key):
                tool = ConfiguredAsgElectronIsEMSelector(
                    ElectronCaloToolName[key], ElectronPidName[key],
                    electronPIDmenu.menuTrig2012)
                tool.caloOnly = True
                addToToolSvc(tool)

    # Calo-only Trigger specific with trigEtTh property set
    #print '=========== Run1 PID Calo trigger specific ============'
    for key in ElectronCaloHypoToolName:
        if not ('lh' in key):
            if ('1' in key):
                tool = ConfiguredAsgElectronIsEMSelector(
                    ElectronCaloHypoToolName[key], ElectronPidName[key],
                    electronPIDmenu.menuTrig2012)
                tool.caloOnly = True
                tool.trigEtTh = 20000
                addToToolSvc(tool)

    # Versioned selectors for Run2
    #print '=========== Run2 PID ============'
    for key in ElectronToolName:
        if not ('lh' in key):
            if not ('1' in key):
                tool = CfgMgr.AsgElectronIsEMSelector(ElectronToolName[key])
                tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[key]
                tool.isEMMask = ElectronIsEMBits[key]
                addToToolSvc(tool)

    # Trigger specific Run2 selectors
    #print '=========== Run2 PID trigger specific ============'
    for key in ElectronHypoToolName:
        if not ('lh' in key):
            if not ('1' in key):
                tool = CfgMgr.AsgElectronIsEMSelector(
                    ElectronHypoToolName[key])
                tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[key]
                tool.isEMMask = ElectronIsEMBits[key]
                tool.trigEtTh = 20000
                addToToolSvc(tool)

    # Calo-only selectors
    #print '=========== Run2 PID Calo============'
    for key in ElectronCaloToolName:
        if not ('lh' in key):
            if not ('1' in key):
                tool = CfgMgr.AsgElectronIsEMSelector(
                    ElectronCaloToolName[key])
                tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[
                    key]
                tool.isEMMask = ElectronIsEMBits[key]
                tool.caloOnly = True
                addToToolSvc(tool)

    # Calo-only trigger specific selectors
    #print '=========== Run2 PID Calo trigger specific ============'
    for key in ElectronCaloHypoToolName:
        if not ('lh' in key):
            if not ('1' in key):
                tool = CfgMgr.AsgElectronIsEMSelector(
                    ElectronCaloHypoToolName[key])
                tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[
                    key]
                tool.isEMMask = ElectronIsEMBits[key]
                tool.caloOnly = True
                tool.trigEtTh = 20000
                addToToolSvc(tool)

    # LH selectors
    #print '======== LH selectors ==========='
    for key in ElectronToolName:
        if ('lh' in key):
            tool = CfgMgr.AsgElectronLikelihoodTool(ElectronToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[key]
            tool.usePVContainer = False
            addToToolSvc(tool)

    # Special LH triggers for alignment / commisioning
    for key in ElectronLHVLooseToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHVLooseToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHVLooseToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHLooseToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHLooseToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHLooseToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHMediumToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHMediumToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHMediumToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHTightToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHTightToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHTightToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    # Calo-only LH selectors
    #print '======== LH Calo selectors ==========='
    for key in ElectronCaloToolName:
        if ('lh' in key):
            tool = CfgMgr.AsgElectronLikelihoodTool(ElectronCaloToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[key]
            tool.usePVContainer = False
            tool.caloOnly = True
            addToToolSvc(tool)
Exemple #7
0
                                   JetJvtMomentName="NewJvt",
                                   DoPFlow=False)
tool1.METMakerTopo = mettoolTopo

mettoolPFlow = CfgMgr.met__METMaker('METMaker_AntiKt4PFlow',
                                    JetSelection="PFlow",
                                    JetJvtMomentName="NewJvt",
                                    DoPFlow=True)
tool1.METMakerPFlow = mettoolPFlow

museltool = CfgMgr.CP__MuonSelectionTool(
    "MuonSelectionTool",
    MuQuality=1,  # Medium
    MaxEta=2.4,
    TurnOffMomCorr=True)
tool1.MuonSelectionTool = museltool

eseltool = CfgMgr.AsgElectronLikelihoodTool("ElectronLHSelectionTool",
                                            WorkingPoint="MediumLHElectron")
tool1.ElectronLHSelectionTool = eseltool

phoseltool = CfgMgr.AsgPhotonIsEMSelector("PhotonIsEMSelectionTool",
                                          WorkingPoint="TightPhoton")
tool1.PhotonIsEMSelectionTool = phoseltool

tauseltool = CfgMgr.TauAnalysisTools__TauSelectionTool("TauSelectionTool")
tool1.TauSelectionTool = tauseltool

monMan = CfgMgr.AthenaMonManager("PhysValMonManager")
monMan.AthenaMonTools += [tool1]
Exemple #8
0
def ElectronPidTools():
    # Versioned selectors for Run2
    #print '=========== Run2 PID ============'
    for key in ElectronToolName:
        if ('lh' in key):
            tool = CfgMgr.AsgElectronLikelihoodTool(ElectronToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[key]
            tool.usePVContainer = False
            addToToolSvc(tool)
        elif ('bloose' in key):
            tool = CfgMgr.AsgElectronIsEMSelector(ElectronToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[
                'loose']  # use loose isEMconfig for all bloose settings and just change isEM bit
            tool.isEMMask = BLooseISEMBits[key]
            addToToolSvc(tool)

        else:
            tool = CfgMgr.AsgElectronIsEMSelector(ElectronToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronToolConfigFile[key]
            tool.isEMMask = ElectronIsEMBits[key]
            addToToolSvc(tool)

    # Calo-only selectors
    #print '=========== Run2 PID Calo============'
    for key in ElectronCaloToolName:
        if ('lh' in key):
            tool = CfgMgr.AsgElectronLikelihoodTool(ElectronCaloToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[key]
            tool.usePVContainer = False
            tool.caloOnly = True
            addToToolSvc(tool)
        elif ('bloose' in key):
            tool = CfgMgr.AsgElectronIsEMSelector(ElectronCaloToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[
                'loose']  # use loose isEMconfig for all bloose settings and just change isEM bit
            tool.caloOnly = True
            tool.isEMMask = BLooseISEMBits[key]
            addToToolSvc(tool)

        else:
            tool = CfgMgr.AsgElectronIsEMSelector(ElectronCaloToolName[key])
            tool.ConfigFile = ConfigFilePath + ElectronCaloToolConfigFile[key]
            tool.isEMMask = ElectronIsEMBits[key]
            tool.caloOnly = True
            addToToolSvc(tool)

    # Special LH triggers for alignment / commisioning
    for key in ElectronLHVLooseToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHVLooseToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHVLooseToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHLooseToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHLooseToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHLooseToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHMediumToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHMediumToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHMediumToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)

    for key in ElectronLHTightToolName:
        tool = CfgMgr.AsgElectronLikelihoodTool(ElectronLHTightToolName[key])
        tool.ConfigFile = ConfigFilePath + ElectronLHTightToolConfigFile[key]
        tool.usePVContainer = False
        addToToolSvc(tool)
Exemple #9
0
from TrigEgammaHypo.TrigEgammaPidTools import PhotonPidTools
from TrigEgammaHypo.TrigEgammaPidTools import ElectronToolName
ElectronPidTools()
PhotonPidTools()

from ElectronPhotonSelectorTools.ElectronPhotonSelectorToolsConf import AsgElectronIsEMSelector, AsgElectronLikelihoodTool
from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap, electronPIDmenu

# Offline selectors -- taken from latest conf
LooseElectronSelector = CfgMgr.AsgElectronIsEMSelector(
    "T0HLTLooseElectronSelector")
MediumElectronSelector = CfgMgr.AsgElectronIsEMSelector(
    "T0HLTMediumElectronSelector")
TightElectronSelector = CfgMgr.AsgElectronIsEMSelector(
    "T0HLTTightElectronSelector")
LooseLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTLooseLHSelector")
MediumLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHSelector")
TightLHSelector = CfgMgr.AsgElectronLikelihoodTool("T0HLTTightLHSelector")
VeryLooseLHSelector = CfgMgr.AsgElectronLikelihoodTool(
    "T0HLTVeryLooseLHSelector")
# MediumLHHISelector                  = CfgMgr.AsgElectronLikelihoodTool("T0HLTMediumLHHISelector")

# see the configuration calib paths below
LooseElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMLooseSelectorCutDefs.conf"
MediumElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMMediumSelectorCutDefs.conf"
TightElectronSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20150712/ElectronIsEMTightSelectorCutDefs.conf"
# 2018 (vtest)
LooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodLooseOfflineConfig2017_CutBL_Smooth.conf"
MediumLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodMediumOfflineConfig2017_Smooth.conf"
TightLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodTightOfflineConfig2017_Smooth.conf"
VeryLooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc16_20170828/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf"
Exemple #10
0
def getEventSelectionTool():

    from TrigEgammaEmulationTool.TrigEgammaEmulationPidToolsConfig import getEgammaIsEMSelectorCaloOnly, \
                                                                          getElectronIsEMSelector,\
                                                                          getEgammaLikelihoodSelectorCaloOnly, \
                                                                          getElectronLikelihoodSelector2015,\
                                                                          getElectronLikelihoodSelectorNoD0
    from AthenaCommon import CfgMgr
    from AthenaCommon.AppMgr import ToolSvc

    VeryLooseLHSelector = CfgMgr.AsgElectronLikelihoodTool(
        "T0HLTVeryLooseLHSelector")
    VeryLooseLHSelector.ConfigFile = "ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodVeryLooseOfflineConfig2016_Smooth.conf"
    ToolSvc += VeryLooseLHSelector

    # create all selector list. Here, the order is matter. Please check the
    # TrigEgammaEventSelection to put this in order
    EFCaloIsEMSelectorList = getEgammaIsEMSelectorCaloOnly(
        "ElectronPhotonSelectorTools/trigger/rel21_20170217")
    HLTIsEMSelectorList = getElectronIsEMSelector(
        "ElectronPhotonSelectorTools/trigger/rel21_20170217")
    EFCaloLikelihoodSelectorList = getEgammaLikelihoodSelectorCaloOnly(
        "ElectronPhotonSelectorTools/trigger/rel21_20170217")
    HLTLikelihoodSelectorList = getElectronLikelihoodSelectorNoD0(
        "ElectronPhotonSelectorTools/trigger/rel21_20170217")

    TrigEgammaEventSelection = ToolFactory(
        TrigEgammaAnalysisToolsConf.TrigEgammaEventSelection,
        name="TrigEgammaEventSelection",
        Analysis='EventsSelection',
        ElectronKey='Electrons',
        MatchTool=EgammaMatchTool,
        PlotTool=TrigEgammaPlotTool,
        EmulationTool=EmulationTool,  # The emulation must be on in this tool.
        doEmulation=True,
        Tools=[],
        isEMResultNames=["Tight", "Medium", "Loose"],
        LHResultNames=["LHTight", "LHMedium", "LHLoose"],
        # for the offline selection. Default for the likelihood is v11
        ElectronIsEMSelector=[
            TightElectronSelector, MediumElectronSelector,
            LooseElectronSelector
        ],
        ElectronLikelihoodTool=[
            TightLHSelector, MediumLHSelector, LooseLHSelector,
            VeryLooseLHSelector
        ],
        ElectronLHVLooseTool=VeryLooseLHSelector,
        ZeeLowerMass=80,
        ZeeUpperMass=100,
        OfflineTagSelector='Tight',  # 1=tight, 2=medium, 3=loose 
        OfflineProbeSelector='Loose',
        ForceProbePid=False,
        OppositeCharge=True,
        OfflineTagMinEt=25,
        OfflineProbeMinEt=4,
        CutLabels=[
            "Events", "LAr", "RetrieveElectrons", "TwoElectrons",
            "PassTrigger", "EventWise", "Success"
        ],
        TagTriggerList=["e24_tight_iloose"],
        TriggerList=monitoringTP_electron,
        #SupportingTrigList = probeListLowMidPtSupportingTriggers+probeListHighPtSupportingTriggers,
        ApplyMinimalTrigger=False,
        SelectionZ=True,
        SelectionW=False,
        SelectionJpsi=False,
        SelectionFakes=False,
        SelectionMC=False,
        ForceTrigAttachment=True,
        DetailedDataLevel=0,  # 0 = VerySlim, 1 = Slim and 2 = Full
        # Asg selectors to decorate my final skimmed ntuple.
        EFCaloElectronLikelihoodSelector=EFCaloLikelihoodSelectorList,
        EFCaloElectronIsEMSelector=EFCaloIsEMSelectorList,
        HLTElectronLikelihoodSelector=HLTLikelihoodSelectorList,
        HLTElectronIsEMSelector=HLTIsEMSelectorList,
    )

    # Return the template
    return TrigEgammaEventSelection