From f21f94c1490b8092d4bef116dd6fe43e6ae84ecd Mon Sep 17 00:00:00 2001
From: Jonathan Long <longjon@umich.edu>
Date: Mon, 14 Jun 2021 15:53:13 +0000
Subject: [PATCH] Electron working point without pix requirements for LRT
 chains

---
 .../TrigEgammaPrecisionElectronHypoTool.py    |  6 +++++-
 .../python/HLTMenuConfig/Egamma/EgammaDefs.py | 10 +++++++++-
 .../Egamma/ElectronChainConfiguration.py      | 19 +++++++++++++++++++
 .../python/HLTMenuConfig/Menu/LS2_v1.py       | 16 ++++++++++++++++
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  2 +-
 5 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py
index 6eed3a21ec3..1e852eb983b 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py
@@ -29,7 +29,7 @@ def createTrigEgammaPrecisionElectronHypoAlg(name, sequenceOut):
     thePrecisionElectronHypo.ElectronLHSelectorTools = createTrigEgammaPrecisionElectronLHSelectors()
     thePrecisionElectronHypo.ElectronDNNSelectorTools = createTrigEgammaPrecisionElectronDNNSelectors()
     thePrecisionElectronHypo.CBNames = ["medium", "loose", "mergedtight"] # just like the pidnames
-    thePrecisionElectronHypo.LHNames = ["lhtight", "lhmedium", "lhloose", "lhvloose"] # just like the pidnames
+    thePrecisionElectronHypo.LHNames = ["lhtight", "lhmedium", "lhloose", "lhvloose", "lhtightnopix", "lhmediumnopix","lhloosenopix","lhvloosenopix"] # just like the pidnames
     MonTool.Histograms = [ 
                 defineHistogram('TIME_exec', type='TH1F', path='EXPERT', title="Precision Electron Hypo Algtime; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=8000.0),
                 defineHistogram('TIME_LH_exec', type='TH1F', path='EXPERT', title="Precision Electron Hypo LH Algtime; time [ us ] ; Nruns", xbins=30, xmin=0.0, xmax=3000.0),
@@ -54,6 +54,10 @@ class TrigEgammaPrecisionElectronHypoToolConfig:
                            'lhmedium' ,
                            'lhloose'  ,
                            'lhvloose' ,
+                           'lhtightnopix'  ,
+                           'lhmediumnopix' ,
+                           'lhloosenopix'  ,
+                           'lhvloosenopix' ,
                            'dnntight',
                            'dnnmedium',
                            'dnnloose',
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
index d176f365766..c5681397d50 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py
@@ -23,7 +23,7 @@ class TrigEgammaKeys(object):
       outputTopoSeededClusterKey = 'HLT_egammaTopoSeededClusters'
       TrigEMClusterToolOutputContainer = 'HLT_TrigEMClusterOutput'
       TrigElectronTracksCollectionName = recordable('HLT_IDTrack_Electron_IDTrig')
-      pidVersion = 'rel21_20180312'
+      pidVersion = 'rel22_20210611'
       dnnVersion = 'mc16_20210430'
 
 class TrigEgammaKeys_LRT(object):
@@ -86,6 +86,10 @@ def createTrigEgammaPrecisionElectronLHSelectors(ConfigFilePath=None):
           'lhmedium':'AsgElectronLHMediumSelector',
           'lhloose':'AsgElectronLHLooseSelector',
           'lhvloose':'AsgElectronLHVLooseSelector',
+          'lhtightnopix':'AsgElectronLHTightSelectorNoPix',
+          'lhmediumnopix':'AsgElectronLHMediumSelectorNoPix',
+          'lhloosenopix':'AsgElectronLHLooseSelectorNoPix',
+          'lhvloosenopix':'AsgElectronLHVLooseSelectorNoPix',
           })
      
     ElectronToolConfigFile = collections.OrderedDict({
@@ -93,6 +97,10 @@ def createTrigEgammaPrecisionElectronLHSelectors(ConfigFilePath=None):
           'lhmedium':'ElectronLikelihoodMediumTriggerConfig.conf',
           'lhloose':'ElectronLikelihoodLooseTriggerConfig.conf',
           'lhvloose':'ElectronLikelihoodVeryLooseTriggerConfig.conf',
+          'lhtightnopix':'ElectronLikelihoodTightTriggerConfig_NoPix.conf',
+          'lhmediumnopix':'ElectronLikelihoodMediumTriggerConfig_NoPix.conf',
+          'lhloosenopix':'ElectronLikelihoodLooseTriggerConfig_NoPix.conf',
+          'lhvloosenopix':'ElectronLikelihoodVeryLooseTriggerConfig_NoPix.conf',
           })
 
     selectors = []
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
index 9f4acbd8c05..6659720d538 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
@@ -184,6 +184,25 @@ class ElectronChainConfiguration(ChainConfigurationBase):
                 'lhtightlrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
                 'lhmediumlrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
                 'lhtightlrttight'   : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+
+                'lhvloosenopixlrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhloosenopixlrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhmediumnopixlrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhtightnopixlrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+
+                'lhvloosenopixlrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhloosenopixlrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhmediumnopixlrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhtightnopixlrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+
+                'lhvloosenopixlrttight'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhloosenopixlrttight'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhmediumnopixlrttight'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhtightnopixlrttight'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+
+                'lhloosenopixivarlooselrtloose'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhvloosenopixivarlooselrtmedium'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
+                'lhvloosenopixivarlooselrttight'  : ['getFastCalo', 'getFastElectron_lrt', 'getPrecisionCaloElectron_lrt', 'getPrecisionTracking_lrt', 'getPrecisionElectron_lrt'],
           
                 # dnn chains
                 'dnnloose'   : ['getFastCalo', 'getFastElectron', 'getPrecisionCaloElectron', 'getPrecisionTracking', 'getPrecisionElectron'],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index f1670b20a1c..c50cbc38fc2 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -134,6 +134,7 @@ def setupMenu():
         # lrt chains
 
         # Commented out: ATR-23564
+        # Chains below for ATR-23500 should be used instead
         # ChainProp(name='HLT_e5_lhloose_lrtloose_L1EM3', groups=SingleElectronGroup),
         # ChainProp(name='HLT_e5_lhmedium_lrtmedium_L1EM3', groups=SingleElectronGroup),
         # ChainProp(name='HLT_e5_lhtight_lrttight_L1EM3', groups=SingleElectronGroup),
@@ -145,6 +146,21 @@ def setupMenu():
         ChainProp(name='HLT_e5_idperf_loose_lrtloose_L1EM3', groups=SingleElectronGroup),
         ChainProp(name='HLT_e26_idperf_loose_lrtloose_L1EM22VHI', groups=SingleElectronGroup),  
 
+        # Test chains for ATR-23500, once ATR-23564 is resolved
+        #ChainProp(name='HLT_e26_lhvloosenopix_lrtloose_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhvloosenopix_lrtmedium_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhvloosenopix_lrttight_L1EM22VHI', groups=SingleElectronGroup),
+        #
+        #ChainProp(name='HLT_e26_lhloosenopix_lrtloose_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhloosenopix_lrtmedium_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhloosenopix_lrttight_L1EM22VHI', groups=SingleElectronGroup),
+        #
+        #ChainProp(name='HLT_e26_lhloosenopix_ivarloose_lrtloose_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhvloosenopix_ivarloose_lrtmedium_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e26_lhvloosenopix_ivarloose_lrttight_L1EM22VHI', groups=SingleElectronGroup),
+        #ChainProp(name='HLT_e28_lhloosenopix_lrtmedium_L1EM22VHI', groups=SingleElectronGroup),
+
+
         # Primary
         ChainProp(name='HLT_e17_lhvloose_nod0_L1EM15VH',  groups=SingleElectronGroup),
         ChainProp(name='HLT_e17_lhvloose_nod0_L1EM15VHI',  groups=SingleElectronGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 30e21b8d5b5..f330c775dfa 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -502,7 +502,7 @@ ElectronChainParts = {
     'trigType'       : ['e'],
     'threshold'      : '',
     'etaRange'       : [],
-    'IDinfo'         : ['dnnloose','dnnmedium','dnntight','lhvloose','lhloose','lhmedium','lhtight','vloose','loose','medium','tight', 'mergedtight'],
+    'IDinfo'         : ['dnnloose','dnnmedium','dnntight','lhvloose','lhloose','lhmedium','lhtight','vloose','loose','medium','tight', 'mergedtight','lhvloosenopix','lhloosenopix','lhmediumnopix','lhtightnopix'],
     'isoInfo'        : ['ivarloose','ivarmedium','ivartight'],
     'trkInfo'        : ['idperf', 'gsf'],
     'lrtInfo'        : ['lrtloose','lrtmedium','lrttight'],
-- 
GitLab