From d617470bc03eefb8cb4d93cfce20ec0e4855e04b Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> Date: Mon, 3 Sep 2018 10:08:17 +0200 Subject: [PATCH] Reverted RoIBResultToxAOD to inherit from AthAlgorithm. It turns out that the L1Calo tools very much have an internal state, so the algorithm can't be reentrant. Kept the structure of the code such that it could be made reentrant easily in the future once the tools will allow to do that. Former-commit-id: 55874f230746d075324599863ee23764151a023a --- .../src/RoIBResultToxAOD.cxx | 20 +++++++-------- .../src/RoIBResultToxAOD.h | 25 ++++++++----------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx index 879278050e7..309c8cf3c16 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx @@ -20,13 +20,13 @@ #include "TrigT1Interfaces/RecEnergyRoI.h" #include "TrigT1Interfaces/JEPRoIDecoder.h" #include "TrigT1CaloEvent/JetInput.h" -#include "TrigConfL1Data/L1DataDef.h" -#include "TrigConfL1Data/TriggerThreshold.h" // Trigger configuration interface includes: #include "TrigConfL1Data/CTPConfig.h" #include "TrigConfL1Data/Menu.h" #include "TrigConfL1Data/TriggerItem.h" +#include "TrigConfL1Data/L1DataDef.h" +#include "TrigConfL1Data/TriggerThreshold.h" // xAOD include(s): #include "xAODTrigger/MuonRoIAuxContainer.h" @@ -53,7 +53,7 @@ namespace { RoIBResultToxAOD::RoIBResultToxAOD( const std::string& name, ISvcLocator* svcLoc ) - : AthReentrantAlgorithm( name, svcLoc ) { + : AthAlgorithm( name, svcLoc ) { } @@ -111,23 +111,23 @@ StatusCode RoIBResultToxAOD::initialize() { return StatusCode::SUCCESS; } -StatusCode RoIBResultToxAOD::execute_r( const EventContext& ctx ) const { +StatusCode RoIBResultToxAOD::execute() { // Tell the user what's happening. ATH_MSG_DEBUG( "in execute()" ); // Access the input object. - auto roibResult = SG::makeHandle( m_roibResultKey, ctx ); + auto roibResult = SG::makeHandle( m_roibResultKey, getContext() ); // Create the muon RoIs: if( m_doMuon ) { - ATH_CHECK( createMuonRoI( *roibResult, ctx ) ); + ATH_CHECK( createMuonRoI( *roibResult, getContext() ) ); } // Create the calo RoIs: if( m_doCalo ) { - ATH_CHECK( createEmTauRoI( *roibResult, ctx ) ); - ATH_CHECK( createJetEnergyRoI( *roibResult, ctx ) ); + ATH_CHECK( createEmTauRoI( *roibResult, getContext() ) ); + ATH_CHECK( createJetEnergyRoI( *roibResult, getContext() ) ); } // Return gracefully. @@ -135,7 +135,7 @@ StatusCode RoIBResultToxAOD::execute_r( const EventContext& ctx ) const { } StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, - const EventContext& ctx ) const { + const EventContext& ctx ) { // Tell the user what's happening. ATH_MSG_DEBUG( "building EmTauRoI" ); @@ -248,7 +248,7 @@ StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, StatusCode RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, - const EventContext& ctx ) const { + const EventContext& ctx ) { ATH_MSG_DEBUG( "building JetEnergyRoI" ); diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h index 746b47061d4..45163e7771d 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h @@ -6,7 +6,7 @@ #define ANALYSISTRIGGERALGS_ROIBRESULTTOXAOD_H // Gaudi/Athena include(s): -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/ReadHandleKey.h" @@ -32,23 +32,15 @@ /** * @short RoIB result to xAOD converter * - * This is a slightly adapted version of the original RoIBResultToAOD - * algorithm. Going the route through the LVL1_ROI structure was - * needed due to the interface of the AOD->xAOD ROI converters - * - * The RoIBResultToxAOD algorithm builds the CTP_Decision and - * LVL1_ROI objects from the LVL1 ROIB::RoIBResult object. - * In addition the TriggerType of the CTP can be rebuild, - * when zero in the input object. - * - * The CTP_Decision and LVL1_ROI objects are stored in ESD/AOD. + * The RoIBResultToxAOD algorithm builds the xAOD analysis objects + * from the LVL1 @c ROIB::RoIBResult object. * * @author Tadashi Maeno <Tadashi.Maeno@cern.ch> * @author Attila Kraznahorkay Jr. <Attila.Krasznahorkay@cern.ch> * @author Alan Watson <Alan.Watson@cern.ch> * @author Wolfgang Ehrenfeld <Wolfgang.Menges@desy.de> */ -class RoIBResultToxAOD : public AthReentrantAlgorithm { +class RoIBResultToxAOD : public AthAlgorithm { public: /// Algorithm constructor @@ -57,21 +49,24 @@ public: /// @name Function(s) implementing the @c Algorithm interface /// @{ + /// Declare that the algorithm is clonable + virtual bool isClonable() const override { return true; } + /// Function initialising the algorithm virtual StatusCode initialize() override; /// Function executing the algorithm - virtual StatusCode execute_r( const EventContext& ctx ) const override; + virtual StatusCode execute() override; /// @} private: /// Create the EmTau RoI objects StatusCode createEmTauRoI( const ROIB::RoIBResult& roib, - const EventContext& ctx ) const; + const EventContext& ctx ); /// Create the JetEnergy RoI object StatusCode createJetEnergyRoI( const ROIB::RoIBResult& roib, - const EventContext& ctx ) const; + const EventContext& ctx ); /// Create the Muon RoI objects StatusCode createMuonRoI( const ROIB::RoIBResult& roib, const EventContext& ctx ) const; -- GitLab