ATLAS Offline Software
ElectronLikelihoodToolMapping.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 # =============================================================================
4 # Name: ElectronLikelihoodToolMapping.py
5 #
6 # Author: Tulay Cuhadar Donszelmann, Jovan Mitrevski, Kurt Brendlinger
7 # Created: August 2013
8 #
9 # Description: Find mapping of mask and function for ID quality
10 # =============================================================================
11 
12 
13 from ElectronPhotonSelectorTools.LikelihoodEnums import LikeEnum
14 import ElectronPhotonSelectorTools.ElectronLikelihoodMenuDefs as ElectronLikelihoodMenuDefs
15 
16 
18  trigger2015 = 1
19  offlineMC20 = 5
20  offlineMC21 = 6
21 
22 
23 # format - key: (mask, function)
24 
25 ElectronLHMapTrigger2015 = {
26  LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseTriggerConfig2015),
27  LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumTriggerConfig2015),
28  LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightTriggerConfig2015),
29 }
30 
31 ElectronLHMapOfflineMC20 = {
32  LikeEnum.VeryLoose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfigMC20),
33  LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfigMC20),
34  LikeEnum.LooseBL: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseBLOfflineConfigMC20),
35  LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfigMC20),
36  LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfigMC20),
37 
38  LikeEnum.VeryLooseLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseLLPOfflineConfigMC20),
39  LikeEnum.LooseLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseLLPOfflineConfigMC20),
40  LikeEnum.MediumLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumLLPOfflineConfigMC20),
41  LikeEnum.TightLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightLLPOfflineConfigMC20),
42 }
43 
44 ElectronLHMapOfflineMC21 = {
45  LikeEnum.VeryLoose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseOfflineConfigMC21),
46  LikeEnum.Loose: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseOfflineConfigMC21),
47  LikeEnum.LooseBL: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseBLOfflineConfigMC21),
48  LikeEnum.Medium: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumOfflineConfigMC21),
49  LikeEnum.Tight: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightOfflineConfigMC21),
50 
51  LikeEnum.VeryLooseLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodVeryLooseLLPOfflineConfigMC21),
52  LikeEnum.LooseLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodLooseLLPOfflineConfigMC21),
53  LikeEnum.MediumLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodMediumLLPOfflineConfigMC21),
54  LikeEnum.TightLLP: (LikeEnum.CustomOperatingPoint, ElectronLikelihoodMenuDefs.ElectronLikelihoodTightLLPOfflineConfigMC21),
55 }
56 
57 def ElectronLikelihoodMap(quality, menu):
58  if menu == electronLHmenu.trigger2015:
59  return ElectronLHMapTrigger2015[quality]
60  elif menu == electronLHmenu.offlineMC20:
61  return ElectronLHMapOfflineMC20[quality]
62  elif menu == electronLHmenu.offlineMC21:
63  return ElectronLHMapOfflineMC21[quality]
64  else:
65  raise ValueError("Requested menu is undefined: %d" % menu)
python.ElectronLikelihoodToolMapping.ElectronLikelihoodMap
def ElectronLikelihoodMap(quality, menu)
Definition: ElectronLikelihoodToolMapping.py:57
python.ElectronLikelihoodToolMapping.electronLHmenu
Definition: ElectronLikelihoodToolMapping.py:17