ATLAS Offline Software
PhotonIsEMSelectorMapping.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 # =============================================================================
4 # Name: PhotonIsEMSelectorMapping.py
5 #
6 # Author: Tulay Cuhadar Donszelmann, Jovan Mitrevski
7 # Created: Dec 2011
8 #
9 # Description: Find mapping of mask and function for ID quality
10 # =============================================================================
11 
12 #
13 import ElectronPhotonSelectorTools.PhotonIsEMMenuDefs as PhotonIsEMMenuDefs
14 from ElectronPhotonSelectorTools.EgammaPIDdefs import egammaPID
15 
16 #
17 # Define here the mapping between a "menu" and the corresponding selectors
18 # The latter are configured in PhotonIsEMMenuDefs.py
19 #
20 
21 
23  offlineMC20 = 1
24  offlineMC21 = 2
25 
26 # format - key: (mask, function)
27 
28 PhotonIsEMMapOfflineMC20 = {
29  egammaPID.PhotonIDLoose: (
30  egammaPID.PhotonLoose,
31  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
32  egammaPID.PhotonIDMedium: (
33  egammaPID.PhotonMedium,
34  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
35  egammaPID.PhotonIDTight: (
36  egammaPID.PhotonTight,
37  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigMC20),
38 
39  egammaPID.PhotonIDLooseAR: (
40  egammaPID.PhotonLooseAR,
41  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
42  egammaPID.PhotonIDMediumAR: (
43  egammaPID.PhotonMediumAR,
44  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
45  egammaPID.PhotonIDTightAR: (
46  egammaPID.PhotonTightAR,
47  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigMC20),
48  egammaPID.NoIDCut: (
49  0,
50  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig)
51 }
52 
53 PhotonIsEMMapOfflineMC21 = {
54  egammaPID.PhotonIDLoose: (
55  egammaPID.PhotonLoose,
56  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
57  egammaPID.PhotonIDMedium: (
58  egammaPID.PhotonMedium,
59  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
60  egammaPID.PhotonIDTight: (
61  egammaPID.PhotonTight,
62  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigMC21),
63 
64  egammaPID.PhotonIDLooseAR: (
65  egammaPID.PhotonLooseAR,
66  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig),
67  egammaPID.PhotonIDMediumAR: (
68  egammaPID.PhotonMediumAR,
69  PhotonIsEMMenuDefs.PhotonIsEMMediumSelectorConfig),
70  egammaPID.PhotonIDTightAR: (
71  egammaPID.PhotonTightAR,
72  PhotonIsEMMenuDefs.PhotonIsEMTightSelectorConfigMC21),
73  egammaPID.NoIDCut: (
74  0,
75  PhotonIsEMMenuDefs.PhotonIsEMLooseSelectorConfig)
76 }
77 
78 
79 def PhotonIsEMMap(quality, menu):
80  if menu == photonPIDmenu.offlineMC20 and quality in PhotonIsEMMapOfflineMC20.keys():
81  return PhotonIsEMMapOfflineMC20[quality]
82  elif menu == photonPIDmenu.offlineMC21 and quality in PhotonIsEMMapOfflineMC21.keys():
83  return PhotonIsEMMapOfflineMC21[quality]
84  else:
85  raise ValueError("Requested menu is undefined: %d" % menu)
python.PhotonIsEMSelectorMapping.PhotonIsEMMap
def PhotonIsEMMap(quality, menu)
Definition: PhotonIsEMSelectorMapping.py:79
python.PhotonIsEMSelectorMapping.photonPIDmenu
Definition: PhotonIsEMSelectorMapping.py:22