From 5a23a4aec06cc6db963f760ac5e38e33f4e1ff2c Mon Sep 17 00:00:00 2001 From: Juan Lieber Marin Date: Thu, 19 May 2022 23:40:29 +0200 Subject: [PATCH] squashing commits --- .../AsgElectronSelectorTool.h | 2 ++ .../Root/AsgElectronSelectorTool.cxx | 20 ++++++----- .../python/TrigEgammaEmulationToolConfigMT.py | 34 ++++++++++++++----- .../TrigEgammaPrecisionElectronHypoTool.py | 2 +- .../python/TrigEgammaMonitCategoryMT.py | 2 +- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronSelectorTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronSelectorTool.h index 2050403721b..7dc6d57d470 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronSelectorTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronSelectorTool.h @@ -144,6 +144,8 @@ private: /// Flag for skip the use of deltaPoverP in dnn calculation (like at HLT) bool m_skipDeltaPoverP; + bool m_skipAmbiguityCut; + /// Multiclass model or not bool m_multiClass{}; /// Use the CF output node in the numerator or the denominator diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronSelectorTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronSelectorTool.cxx index e59c156ea60..16e4b89a786 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronSelectorTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronSelectorTool.cxx @@ -71,6 +71,8 @@ AsgElectronSelectorTool::AsgElectronSelectorTool( const std::string& myname ) : declareProperty("doSmoothBinInterpolation", m_doSmoothBinInterpolation, "use smooth interpolation between discriminant bins"); // especially for trigger electron declareProperty("skipDeltaPoverP",m_skipDeltaPoverP = false,"If true, it will skip the check of deltaPoverP"); + + declareProperty("skipAmbiguityCut",m_skipAmbiguityCut = false,"If true, it will skip the ambiguity cut"); } @@ -343,14 +345,16 @@ asg::AcceptData AsgElectronSelectorTool::accept( const EventContext& ctx, const std::string notFoundList = ""; // get the ambiguity type from the decoration - if (eg->isAvailable("ambiguityType")){ - static const SG::AuxElement::Accessor acc("ambiguityType"); - ambiguityBit = acc(*eg); - } - else { - allFound = false; - notFoundList += "ambiguityType "; - } + if (!m_skipAmbiguityCut){ + if (eg->isAvailable("ambiguityType")){ + static const SG::AuxElement::Accessor acc("ambiguityType"); + ambiguityBit = acc(*eg); + } + else { + allFound = false; + notFoundList += "ambiguityType "; + } + } nSiHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfSiliconHitsAndDeadSensors(*track); nPixHitsPlusDeadSensors = ElectronSelectorHelpers::numberOfPixelHitsAndDeadSensors(*track); diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfigMT.py b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfigMT.py index 4b51299334e..b46bc86c746 100644 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfigMT.py +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/python/TrigEgammaEmulationToolConfigMT.py @@ -70,7 +70,10 @@ class TrigEgammaEmulationToolConfig: self.__emulator.ElectronCBSelectorTools = TrigEgammaPrecisionElectronCBSelectorCfg(ConfigFilePath = self.ElectronCBConfigFilePath).getPublicTools() self.__emulator.ElectronDNNSelectorTools = TrigEgammaPrecisionElectronDNNSelectorCfg(ConfigFilePath = self.ElectronDNNConfigFilePath).getPublicTools() self.__emulator.PhotonCBSelectorTools = createTrigEgammaPrecisionPhotonSelectors(ConfigFilePath = self.PhotonCBConfigFilePath) - + for tool in self.__emulator.ElectronDNNSelectorTools: + tool.skipAmbiguityCut =True + for tool in self.__emulator.ElectronLHSelectorTools: + tool.skipDeltaPoverP = True # # Setup chain by name (only single chains) @@ -95,24 +98,37 @@ class TrigEgammaEmulationToolConfig: # Configure L1Calo L1CaloTool = self.setupL1Calo(trigger + "_Step0" , d) - + sequence = list() # Configure HLT FastCaloTool = TrigEgammaFastCaloHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationFastCaloHypoTool(trigger+'_Step1') ) - PrecisionCaloTool = TrigEgammaPrecisionCaloHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionCaloHypoTool(trigger+'_Step3')) - PrecisionTrackingTool = TrigEgammaPrecisionTrackingHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionTrackingHypoTool(trigger+'_Step4')) - if signature == 'Electron': - FastTool = TrigEgammaFastElectronHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationFastElectronHypoTool(trigger+'_Step2')) - PrecisionTool = TrigEgammaPrecisionElectronHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionElectronHypoTool(trigger+'_Step5')) + isEtCut = bool(d['chainParts'][0]['addInfo']) + isIdperf = bool(d['chainParts'][0]['idperfInfo']) + FastTool = TrigEgammaFastElectronHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationFastElectronHypoTool(trigger+'_Step2')) + if isEtCut: + sequence = [FastCaloTool, FastTool, PrecisionCaloTool] + elif isIdperf: + PrecisionTrackingTool = TrigEgammaPrecisionTrackingHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionTrackingHypoTool(trigger+'_Step4')) + sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool] + else: + PrecisionTrackingTool = TrigEgammaPrecisionTrackingHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionTrackingHypoTool(trigger+'_Step4')) + PrecisionTool = TrigEgammaPrecisionElectronHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionElectronHypoTool(trigger+'_Step5')) + sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool, PrecisionTool] elif signature == 'Photon': + isEtCut = bool(d['chainParts'][0]['addInfo']) FastTool = TrigEgammaFastPhotonHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationFastPhotonHypoTool(trigger+'_Step2')) - PrecisionTool = TrigEgammaPrecisionPhotonHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionPhotonHypoTool(trigger+'_Step5')) + if isEtCut: + sequence = [FastCaloTool, FastTool, PrecisionCaloTool] + else: + PrecisionTool = TrigEgammaPrecisionPhotonHypoToolFromDict(d, tool = CompFactory.Trig.TrigEgammaEmulationPrecisionPhotonHypoTool(trigger+'_Step5')) + sequence = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTool] chain = CompFactory.Trig.TrigEgammaEmulationChain( name = trigger, L1Seed = L1CaloTool, - Steps = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool, PrecisionTool], + # Steps = [FastCaloTool, FastTool, PrecisionCaloTool, PrecisionTrackingTool, PrecisionTool], + Steps = sequence, Chain = trigger, Signature = signature.lower(), OutputLevel = self.OutputLevel diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py index 0d10c10c77f..30335982ccb 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionElectronHypoTool.py @@ -372,7 +372,7 @@ def TrigEgammaPrecisionElectronLHSelectorCfg( name='TrigEgammaPrecisionElectronL for pidname, configfilebase in SelectorConfigFiles.items(): fullpidname = pidname if pidvar == '_default' else pidname + pidvar toolname = 'AsgElectronSelector_' + fullpidname - configfile = config['path'] + configfilebase + config['postfix'] + '.conf' + configfile = config['path'] + '/' + configfilebase + config['postfix'] + '.conf' skipdeltapcheck = True if 'nogsf' in pidvar else False log.debug( ' --> %s, config file: %s', fullpidname, configfile ) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py index fea0c10a786..57c25ae5515 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py @@ -34,7 +34,6 @@ monitoring_electron = [ monitoringTP_electron = [ 'HLT_e60_lhmedium_L1EM22VHI', 'HLT_e60_lhmedium_L1eEM26M', - 'HLT_e26_lhtight_ivarloose_L1EM22VHI', 'HLT_e26_lhtight_ivarloose_L1EM22VH', 'HLT_e26_dnnloose_L1EM22VHI', 'HLT_e26_dnnmedium_L1EM22VHI', @@ -44,6 +43,7 @@ monitoringTP_electron = [ 'HLT_e26_lhtight_L1eEM26L', 'HLT_e26_lhtight_L1eEM26T', 'HLT_e26_lhtight_ivarmedium_L1EM22VHI', + 'HLT_e26_lhtight_ivarloose_L1EM22VHI', 'HLT_e26_lhtight_ivarloose_L1eEM26', 'HLT_e26_lhtight_ivarloose_L1eEM26M', 'HLT_e26_lhtight_ivarloose_L1eEM26T', -- GitLab