ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerPhotonIsEMSelectorMapping.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3# =============================================================================
4# Name: TriggerPhotonIsEMSelectorMapping.py
5#
6# Description: Find mapping of mask and function for ID quality
7# =============================================================================
8
9#
10import TriggerMenuMT.HLT.Photon.TriggerPhotonIsEMMenuDefs as TriggerPhotonIsEMMenuDefs
11from ElectronPhotonSelectorTools.EgammaPIDdefs import egammaPID
12
13#
14# The "photonPIDmenu" used to store every menu in existence...
15# now we will simply update the
16# location of the conf file to the new path.
17# Therefore, the CURRENT MENU is: menuCurrentCuts
18# (corresponding to the PhotonIsEMMapCurrent dict)
19
21 menuCurrentCuts = 0
22
23
24# format - key: (mask, function)
25TriggerPhotonIsEMMapCurrent = {
26 egammaPID.PhotonIDLoose: (
27 egammaPID.PhotonLoose,
28 TriggerPhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
29 egammaPID.PhotonIDMedium: (
30 egammaPID.PhotonMedium,
31 TriggerPhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
32 egammaPID.PhotonIDTight: (
33 egammaPID.PhotonTight,
34 TriggerPhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfig),
35}
36
37def TriggerPhotonIsEMMap(quality, menu):
38 # These are the "current menus" (non-legacy)
39 if menu == triggerPhotonPIDmenu.menuCurrentCuts and quality in TriggerPhotonIsEMMapCurrent.keys():
40 return TriggerPhotonIsEMMapCurrent[quality]
41 else:
42 raise ValueError("Requested menu is undefined: %d" % menu)
43