ATLAS Offline Software
PhotonIsEMSelectorMapping.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 # =============================================================================
4 # Name: PhotonIsEMSelectorMapping.py
5 
11 
12 #
13 import ElectronPhotonSelectorTools.PhotonIsEMMenuDefs as PhotonIsEMMenuDefs
14 from ElectronPhotonSelectorTools.EgammaPIDdefs import egammaPID
15 
16 #
17 # The "photonPIDmenu" used to store every menu in existence...
18 # now we will simply update the
19 # location of the conf file to the new path.
20 # Therefore, the CURRENT MENU is: menuCurrentCuts
21 # (corresponding to the PhotonIsEMMapCurrent dict)
22 # and the other menu that exists is the "menuPtInclJan2018"
23 # (the PhotonIsEMMapPtInclJan2018 dict)
24 # (because it will be used concurrently in the same tag of athena).
25 # Should remove menuPtInclJan2018 when it is no longer supported.
26 #
27 
28 
30  menuCurrentCuts = 0
31  menuPtInclJan2018 = 1
32  menuMuDependent2022 = 2
33 
34 
35 # format - key: (mask, function)
36 PhotonIsEMMapCurrent = {
37  egammaPID.PhotonIDLoose: (
38  egammaPID.PhotonLoose,
39  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
40  egammaPID.PhotonIDMedium: (
41  egammaPID.PhotonMedium,
42  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
43  egammaPID.PhotonIDTight: (
44  egammaPID.PhotonTight,
45  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfig),
46 
47  egammaPID.PhotonIDLooseAR: (
48  egammaPID.PhotonLooseAR,
49  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
50  egammaPID.PhotonIDMediumAR: (
51  egammaPID.PhotonMediumAR,
52  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
53  egammaPID.PhotonIDTightAR: (
54  egammaPID.PhotonTightAR,
55  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfig),
56  egammaPID.NoIDCut: (
57  0,
58  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig)
59 }
60 
61 PhotonIsEMMapPtInclJan2018 = {
62  egammaPID.PhotonIDTight: (
63  egammaPID.PhotonTight,
64  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigPtInclJan2018),
65 }
66 
67 PhotonIsEMMapMuDependent2022 = {
68  egammaPID.PhotonIDTight: (
69  egammaPID.PhotonTight,
70  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigMuDependent2022),
71 }
72 
73 
74 def PhotonIsEMMap(quality, menu):
75  # These are the "current menus" (non-legacy)
76  if menu == photonPIDmenu.menuCurrentCuts and quality in PhotonIsEMMapCurrent.keys():
77  return PhotonIsEMMapCurrent[quality]
78  elif menu == photonPIDmenu.menuPtInclJan2018 and quality in PhotonIsEMMapPtInclJan2018.keys():
79  return PhotonIsEMMapPtInclJan2018[quality]
80  elif menu == photonPIDmenu.menuMuDependent2022 and quality in PhotonIsEMMapMuDependent2022.keys():
81  return PhotonIsEMMapMuDependent2022[quality]
82  else:
83  raise ValueError("Requested menu is undefined: %d" % menu)
python.PhotonIsEMSelectorMapping.PhotonIsEMMap
def PhotonIsEMMap(quality, menu)
Definition: PhotonIsEMSelectorMapping.py:74
python.PhotonIsEMSelectorMapping.photonPIDmenu
Definition: PhotonIsEMSelectorMapping.py:29