diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/CMakeLists.txt b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/CMakeLists.txt index 3292323d2d6a2dc3a6246181078a3ed7aa1b22ae..0e9043c41efc511d736ebfe25fc83af084911eca 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/CMakeLists.txt +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/CMakeLists.txt @@ -8,8 +8,8 @@ atlas_add_component( AnalysisTriggerAlgs src/*.h src/*.cxx src/components/*.cxx LINK_LIBRARIES AthenaBaseComps AthenaKernel StoreGateLib xAODTrigL1Calo xAODTrigger GaudiKernel - TrigConfData TrigConfL1Data TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Interfaces - TrigT1Result TrigConfInterfaces TrigT1CaloUtilsLib ) + TrigConfData TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Interfaces + TrigT1Result TrigT1CaloUtilsLib ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsConfig.py b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsConfig.py index 31962d66e8cd83e00b9920a8ab91ec3c4944e9a5..3168c6c132f506c33f8e3ee40d0878b58ebd32c1 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsConfig.py +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/python/AnalysisTriggerAlgsConfig.py @@ -33,9 +33,7 @@ class RoIBResultToxAOD( Conf.RoIBResultToxAOD ): # later on in the job configuration... # Set the handle for the algorithm: - self.LVL1ConfigSvc = lvl1ConfigSvc from AthenaConfiguration.AllConfigFlags import ConfigFlags - self.UseNewConfig = ConfigFlags.Trigger.readLVL1FromJSON # # Set up the L1Calo tools: diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx index 3d682058d586e79c8df0986488b7e3e5b5ba5358..0bd50db17804b0358eaecea899015429e71601e7 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx @@ -24,11 +24,6 @@ #include "TrigT1CaloUtils/JEMJetAlgorithm.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" #include "TrigConfData/L1Menu.h" // xAOD include(s): @@ -60,10 +55,6 @@ StatusCode RoIBResultToxAOD::initialize() { ATH_MSG_INFO( "Inputs from LVL1 Muon systems switched off" ); } - // Connect to the LVL1ConfigSvc for the trigger configuration. - ATH_CHECK( m_configSvc.retrieve() ); - ATH_MSG_DEBUG( "Connected to " << m_configSvc.typeAndName() ); - if( m_doMuon ) { // Get the RPC RecRoI tool ATH_CHECK( m_recRPCRoiTool.retrieve() ); @@ -135,37 +126,18 @@ StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, auto emtau_aux = std::make_unique< xAOD::EmTauRoIAuxContainer >(); emtau_xaod->setStore( emtau_aux.get() ); - /// Digit scale for calorimeter trigger - float caloTrigScale = 1; const TrigConf::L1Menu * l1menu = nullptr; - std::vector< TrigConf::TriggerThreshold* > caloThresholds; std::map< int, std::string > emThresholdNames; std::map< int, std::string > tauThresholdNames; - if( m_useNewConfig ) { - ATH_CHECK( detStore()->retrieve(l1menu) ); - caloTrigScale = (float)l1menu->thrExtraInfo().EM().resolutionMeV(); - for( auto thr : l1menu->thresholds("EM")) { - emThresholdNames[ thr->mapping() ] = thr->name(); - } - for( auto thr : l1menu->thresholds("TAU")) { - tauThresholdNames[ thr->mapping() ] = thr->name(); - } - } else { - caloTrigScale = GeV / m_configSvc->thresholdConfig()->caloInfo().globalEmScale(); - /** Get EmTau Thresholds from configSvc. Also fill a map of threshold names while - we are here - will be useful later */ - const std::vector< TrigConf::TriggerThreshold* >& thresholds = - m_configSvc->ctpConfig()->menu().thresholdVector(); - for( TrigConf::TriggerThreshold* tt : thresholds ) { - if( tt->type() == TrigConf::L1DataDef::emType() ) { - caloThresholds.push_back( tt ); - emThresholdNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::tauType() ) { - caloThresholds.push_back( tt ); - tauThresholdNames[ tt->thresholdNumber() ] = tt->name(); - } - } + + ATH_CHECK( detStore()->retrieve(l1menu) ); + // Digit scale for calorimeter trigger + float caloTrigScale = static_cast<float>(l1menu->thrExtraInfo().EM().resolutionMeV()); + for( auto thr : l1menu->thresholds("EM")) { + emThresholdNames[ thr->mapping() ] = thr->name(); + } + for( auto thr : l1menu->thresholds("TAU")) { + tauThresholdNames[ thr->mapping() ] = thr->name(); } // Tool to reconstruct EM/tau cluster & isolation sums @@ -190,12 +162,7 @@ StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, << std::setw( 8 ) << roIWord << MSG::dec ); // RecRoI - LVL1::RecEmTauRoI recRoI; - if( l1menu ) { - recRoI = LVL1::RecEmTauRoI( roIWord, l1menu ); - } else { - recRoI = LVL1::RecEmTauRoI( roIWord, &caloThresholds ); - } + LVL1::RecEmTauRoI recRoI( roIWord, l1menu ); // xAOD component // ATLAS standard phi convention differs from L1 hardware convention @@ -273,28 +240,13 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, jetet_xaod->setStore( jetet_aux.get() ); const TrigConf::L1Menu * l1menu = nullptr; - if( m_useNewConfig ) { - ATH_CHECK( detStore()->retrieve(l1menu) ); - } + ATH_CHECK( detStore()->retrieve(l1menu) ); // Digit scale for calorimeter trigger - float caloTrigScale{0}; - if( m_useNewConfig ) { - caloTrigScale = (float)l1menu->thrExtraInfo().JET().resolutionMeV(); - } else { - caloTrigScale = GeV / m_configSvc->thresholdConfig()->caloInfo().globalJetScale(); - } + float caloTrigScale = static_cast<float>(l1menu->thrExtraInfo().JET().resolutionMeV()); ATH_MSG_DEBUG( "caloTrigScale = " << caloTrigScale ); - /** Get Jet/Energy Thresholds from configSvc. Also fill maps of threshold names while - we are here - will be useful later. - - Unfortunately there are 3 types of jet threshold and 3 types of ET trigger threshold, - so this bit doesn't look very elegant */ - - std::vector<TrigConf::TriggerThreshold*> jetThresholds; - std::vector<TrigConf::TriggerThreshold*> energyThresholds; - std::vector<TrigConf::TriggerThreshold*> jetEnergyThresholds; + // Fill maps of threshold names std::map<int, std::string> jetNames; std::map<int, std::string> jfNames; std::map<int, std::string> jbNames; @@ -302,52 +254,17 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, std::map<int, std::string> teNames; std::map<int, std::string> xsNames; std::map<int, std::string> jeNames; - if ( m_useNewConfig ) { - for( auto thr : l1menu->thresholds("JET")) { - jetNames[ thr->mapping() ] = thr->name(); - } - for( auto thr : l1menu->thresholds("XE")) { - xeNames[ thr->mapping() ] = thr->name(); - } - for( auto thr : l1menu->thresholds("TE")) { - teNames[ thr->mapping() ] = thr->name(); - } - for( auto thr : l1menu->thresholds("XS")) { - xsNames[ thr->mapping() ] = thr->name(); - } - } else { - const std::vector< TrigConf::TriggerThreshold* >& thresholds = - m_configSvc->ctpConfig()->menu().thresholdVector(); - for( TrigConf::TriggerThreshold* tt : thresholds ) { - if( tt->type() == TrigConf::L1DataDef::jetType() ) { - jetThresholds.push_back( tt ); - jetNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::jfType() ) { - jetThresholds.push_back( tt ); - jfNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::jbType() ) { - jetThresholds.push_back( tt ); - jbNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::xeType() ) { - energyThresholds.push_back( tt ); - xeNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::teType() ) { - energyThresholds.push_back( tt ); - teNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::xsType() ) { - energyThresholds.push_back( tt ); - xsNames[ tt->thresholdNumber() ] = tt->name(); - } - else if( tt->type() == TrigConf::L1DataDef::jeType() ) { - jetEnergyThresholds.push_back( tt ); - jeNames[ tt->thresholdNumber() ] = tt->name(); - } - } + for( auto thr : l1menu->thresholds("JET")) { + jetNames[ thr->mapping() ] = thr->name(); + } + for( auto thr : l1menu->thresholds("XE")) { + xeNames[ thr->mapping() ] = thr->name(); + } + for( auto thr : l1menu->thresholds("TE")) { + teNames[ thr->mapping() ] = thr->name(); + } + for( auto thr : l1menu->thresholds("XS")) { + xsNames[ thr->mapping() ] = thr->name(); } // Tool to reconstruct Jet cluster ET sums @@ -384,12 +301,7 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, // Jet ROI if( roiType == LVL1::TrigT1CaloDefs::JetRoIWordType ) { // RecRoI - LVL1::RecJetRoI recRoI; - if( m_useNewConfig) { - recRoI = LVL1::RecJetRoI( roIWord, l1menu ); - } else { - recRoI = LVL1::RecJetRoI( roIWord, &jetThresholds ); - } + LVL1::RecJetRoI recRoI( roIWord, l1menu ); // xAOD component // Convert to ATLAS phi convention @@ -476,12 +388,7 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, << roiWord2 << MSG::dec ); // RecRoI - LVL1::RecEnergyRoI recRoI; - if( m_useNewConfig) { - recRoI = LVL1::RecEnergyRoI( roiWord0, roiWord1, roiWord2, l1menu ); - } else { - recRoI = LVL1::RecEnergyRoI( roiWord0, roiWord1, roiWord2, &energyThresholds ); - } + LVL1::RecEnergyRoI recRoI( roiWord0, roiWord1, roiWord2, l1menu ); // Overflow bits unsigned int overflows = 0; @@ -550,9 +457,7 @@ StatusCode RoIBResultToxAOD::createMuonRoI( const ROIB::RoIBResult& result, ATH_MSG_DEBUG( "in buildMuonRoI()" ); const TrigConf::L1Menu * l1menu = nullptr; - if( m_useNewConfig ) { - ATH_CHECK( detStore()->retrieve(l1menu) ); - } + ATH_CHECK( detStore()->retrieve(l1menu) ); // Create the xAOD container. auto mu_xaod = std::make_unique< xAOD::MuonRoIContainer >(); @@ -562,21 +467,8 @@ StatusCode RoIBResultToxAOD::createMuonRoI( const ROIB::RoIBResult& result, std::vector< TrigConf::TriggerThreshold* > muonThresholds; std::map< int, std::string > thresholdNames; - if( m_useNewConfig ) { - for( auto thr : l1menu->thresholds("MU")) { - thresholdNames[ thr->mapping() ] = thr->name(); - } - } else { - /** Get Muon Thresholds from configSvc. Also fill a map of threshold names while - we are here - will be useful later */ - const std::vector< TrigConf::TriggerThreshold* >& thresholds = - m_configSvc->ctpConfig()->menu().thresholdVector(); - for( TrigConf::TriggerThreshold* tt : thresholds ) { - if( tt->type() == TrigConf::L1DataDef::muonType() ) { - muonThresholds.push_back( tt ); - thresholdNames[ tt->thresholdNumber() ] = tt->name(); - } - } + for( auto thr : l1menu->thresholds("MU")) { + thresholdNames[ thr->mapping() ] = thr->name(); } // get Muon ROI @@ -592,14 +484,7 @@ StatusCode RoIBResultToxAOD::createMuonRoI( const ROIB::RoIBResult& result, ATH_MSG_DEBUG( MSG::hex << std::setw( 8 ) << roIWord ); // RecRoI - LVL1::RecMuonRoI recRoI; - if( m_useNewConfig ) { - recRoI = LVL1::RecMuonRoI( roIWord, m_recRPCRoiTool.get(), - m_recTGCRoiTool.get(), l1menu ); - } else { - recRoI = LVL1::RecMuonRoI( roIWord, m_recRPCRoiTool.get(), - m_recTGCRoiTool.get(), &muonThresholds ); - } + LVL1::RecMuonRoI recRoI( roIWord, m_recRPCRoiTool.get(), m_recTGCRoiTool.get(), l1menu ); const double thrValue = recRoI.getThresholdValue() * GeV; const int index = recRoI.getThresholdNumber() - 1; diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h index af76f177d5acb17f44b98244092dcf007659867f..d7588ca489b988fa76f3d003b6d7af278806d0b5 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.h @@ -14,7 +14,6 @@ #include "StoreGate/WriteHandleKey.h" // Tool/service include(s): -#include "TrigConfInterfaces/ILVL1ConfigSvc.h" #include "TrigT1Interfaces/ITrigT1MuonRecRoiTool.h" #include "TrigT1Interfaces/TrigT1CaloDefs.h" #include "TrigT1CaloToolInterfaces/IL1CPMTools.h" @@ -75,11 +74,6 @@ private: /// @name Services /// @{ - /// The trigger configuration service - ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc { - this, "LVL1ConfigSvc", "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc", - "Service providing the LVL1 trigger configuration" }; - /// The RPC RoI reconstruction tool ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_recRPCRoiTool { this, "RecRpcRoiTool", "LVL1::TrigT1RPCRecRoiTool/TrigT1RPCRecRoiTool"}; /// The TGC RoI reconstruction service @@ -150,9 +144,6 @@ private: /// @name Other properties /// @{ - /// Use new-style menu - Gaudi::Property<bool> m_useNewConfig { this, "UseNewConfig", true, "When true, read the menu from detector store, when false use the L1ConfigSvc" }; - /// Use inputs from the Calo system Gaudi::Property< bool > m_doCalo { this, "DoCalo", true, "Use inputs from the Calo system" };