From c2d504b6c848922fb4a75982dd832da9309cfdaa Mon Sep 17 00:00:00 2001 From: Debo <debottam.bakshi.gupta@cern.ch> Date: Fri, 30 Oct 2020 22:21:21 +0100 Subject: [PATCH] Some sanitization of TrigEgammaPrecisionEtcutHypoTool --- .../python/TrigEgammaPrecisionEtcutHypoTool.py | 7 +------ .../src/ITrigEgammaPrecisionEtcutHypoTool.h | 4 ++-- .../src/TrigEgammaPrecisionEtcutHypoTool.cxx | 10 ++++------ .../src/TrigEgammaPrecisionEtcutHypoTool.h | 3 ++- .../Egamma/PrecisionElectronSequenceSetup.py | 4 +--- .../Egamma/PrecisionTrackingSequenceSetup.py | 2 -- .../Electron/PrecisionElectronRecoSequences.py | 1 - .../python/HLTMenuConfig/Menu/ChainMerging.py | 7 ++----- 8 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionEtcutHypoTool.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionEtcutHypoTool.py index f7a3e231f65..93df21968a2 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionEtcutHypoTool.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaPrecisionEtcutHypoTool.py @@ -1,6 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.SystemOfUnits import GeV +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration def _IncTool(name, threshold, sel): @@ -8,9 +6,6 @@ def _IncTool(name, threshold, sel): tool = TrigEgammaPrecisionEtcutHypoTool( name ) - from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram - monTool = GenericMonitoringTool("MonTool_"+name) - tool.AcceptAll = True return tool diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionEtcutHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionEtcutHypoTool.h index ebdd79f5c82..ef688ae2bbb 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionEtcutHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionEtcutHypoTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGEGAMMAHYPO_ITPRECISIONETCUTHYPOTOOL_H #define TRIGEGAMMAHYPO_ITPRECISIONETCUTHYPOTOOL_H 1 @@ -45,7 +45,7 @@ class ITrigEgammaPrecisionEtcutHypoTool * @brief Makes a decision for a single object * The decision needs to be returned **/ - virtual bool decide( const ClusterInfo& i ) const = 0; + virtual bool decide() const = 0; protected: diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.cxx index ee165a36188..06c01a5375c 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.cxx @@ -34,7 +34,7 @@ StatusCode TrigEgammaPrecisionEtcutHypoTool::initialize() { TrigEgammaPrecisionEtcutHypoTool::~TrigEgammaPrecisionEtcutHypoTool(){} -bool TrigEgammaPrecisionEtcutHypoTool::decide( const ITrigEgammaPrecisionEtcutHypoTool::ClusterInfo& input ) const { +bool TrigEgammaPrecisionEtcutHypoTool::decide() const { bool pass = false; @@ -52,11 +52,9 @@ bool TrigEgammaPrecisionEtcutHypoTool::decide( const ITrigEgammaPrecisionEtcutHy StatusCode TrigEgammaPrecisionEtcutHypoTool::decide( std::vector<ClusterInfo>& input ) const { for ( auto& i: input ) { - if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) { - if ( decide( i ) ) { - addDecisionID( m_decisionId, i.decision ); - } - } + if ( i.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) continue; + addDecisionID( m_decisionId, i.decision ); } return StatusCode::SUCCESS; } + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.h index d43d93990dd..8cc23732443 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionEtcutHypoTool.h @@ -30,7 +30,7 @@ class TrigEgammaPrecisionEtcutHypoTool : public extends<AthAlgTool, ITrigEgammaP virtual StatusCode decide( std::vector<ITrigEgammaPrecisionEtcutHypoTool::ClusterInfo>& input ) const override; - virtual bool decide( const ITrigEgammaPrecisionEtcutHypoTool::ClusterInfo& i ) const override; + virtual bool decide() const override; private: HLT::Identifier m_decisionId; @@ -43,3 +43,4 @@ class TrigEgammaPrecisionEtcutHypoTool : public extends<AthAlgTool, ITrigEgammaP }; #endif //> !TRIGEGAMMAHYPO_PRECISIONETCUTHYPOTOOL_H + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionElectronSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionElectronSequenceSetup.py index 51c7bb965c8..83b2b944b0c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionElectronSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionElectronSequenceSetup.py @@ -1,10 +1,9 @@ # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # from AthenaConfiguration.AllConfigFlags import ConfigFlags -from AthenaCommon.Constants import DEBUG # menu components from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool from AthenaCommon.CFElements import parOR, seqAND @@ -44,7 +43,6 @@ def precisionElectronMenuSequence(): thePrecisionElectronHypo = TrigEgammaPrecisionElectronHypoAlgMT("TrigEgammaPrecisionElectronHypoAlgMT") thePrecisionElectronHypo.Electrons = sequenceOut thePrecisionElectronHypo.RunInView = True - thePrecisionElectronHypo.OutputLevel = DEBUG from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool import TrigEgammaPrecisionElectronHypoToolFromDict diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingSequenceSetup.py index 0c11bdeacd0..eb980e7ea8f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingSequenceSetup.py @@ -3,7 +3,6 @@ # from AthenaConfiguration.AllConfigFlags import ConfigFlags -from AthenaCommon.Constants import DEBUG # menu components from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool @@ -47,7 +46,6 @@ def precisionTrackingMenuSequence(name): thePrecisionEtcutHypo = TrigEgammaPrecisionEtcutHypoAlgMT(name+"precisionEtcutHypo") thePrecisionEtcutHypo.CaloClusters = caloclusters - thePrecisionEtcutHypo.OutputLevel = DEBUG return MenuSequence( Sequence = sequence, Maker = precisionEtcutViewsMaker, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py index 2fe0a4d5a14..015721b35fa 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py @@ -3,7 +3,6 @@ # from AthenaCommon.CFElements import parOR -from AthenaCommon.GlobalFlags import globalflags #logging from AthenaCommon.Logging import logging diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py index 34be5ccb227..9b9ee59d0ae 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py @@ -1,6 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -from __future__ import print_function +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging log = logging.getLogger( __name__ ) @@ -116,8 +114,7 @@ def getEmptySeqName(stepName, chain_index, step_number, alignGroup): if re.search('^Step[0-9]_',stepName): stepName = stepName[6:] - seqName = 'Empty_'+ alignGroup +'_Seq'+str(step_number)+ '_'+ stepName + '_leg' + str(chain_index) - print("EmptySequenceName: ", seqName) + seqName = 'Empty'+ alignGroup +'Seq'+str(step_number)+ '_'+ stepName + '_leg' + str(chain_index) return seqName -- GitLab