diff --git a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/CMakeLists.txt index 715af3e01bead324e2e61503722eb12472c73c72..197e2ce3b9cd8ce9ac53b737b37b3249ef533ac7 100644 --- a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/CMakeLists.txt +++ b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/CMakeLists.txt @@ -26,7 +26,6 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigConfiguration/TrigConfHLTData Trigger/TrigConfiguration/TrigConfInterfaces Trigger/TrigConfiguration/TrigConfL1Data - Trigger/TrigConfiguration/TrigConfigSvc Trigger/TrigEvent/TrigMonitoringEvent Trigger/TrigT1/TrigT1Interfaces Trigger/TrigT1/TrigT1Result ) @@ -39,13 +38,13 @@ atlas_add_library( TriggerD3PDMakerLib src/*.cxx PUBLIC_HEADERS TriggerD3PDMaker INCLUDE_DIRS ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils EventKernel FourMomUtils GaudiKernel D3PDMakerUtils TrigSteeringEvent TrigDecisionToolLib TrigObjectMatchingLib StoreGateLib SGtests TrigConfigSvcLib + LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils EventKernel FourMomUtils GaudiKernel D3PDMakerUtils TrigSteeringEvent TrigDecisionToolLib TrigObjectMatchingLib StoreGateLib SGtests PRIVATE_LINK_LIBRARIES xAODTrigger AnalysisTriggerEvent TrigConfHLTData TrigConfL1Data TrigMonitoringEvent TrigT1Interfaces TrigT1Result ) atlas_add_component( TriggerD3PDMaker src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils EventKernel FourMomUtils GaudiKernel D3PDMakerUtils TrigDecisionToolLib TrigObjectMatchingLib TrigSteeringEvent StoreGateLib SGtests xAODTrigger AnalysisTriggerEvent TrigConfHLTData TrigConfL1Data TrigConfigSvcLib TrigMonitoringEvent TrigT1Interfaces TrigT1Result TriggerD3PDMakerLib ) + LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils EventKernel FourMomUtils GaudiKernel D3PDMakerUtils TrigDecisionToolLib TrigObjectMatchingLib TrigSteeringEvent StoreGateLib SGtests xAODTrigger AnalysisTriggerEvent TrigConfHLTData TrigConfL1Data TrigMonitoringEvent TrigT1Interfaces TrigT1Result TriggerD3PDMakerLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/TriggerD3PDMaker/TriggerKeyTool.h b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/TriggerD3PDMaker/TriggerKeyTool.h index 2ef2188bae3c690c299834ff563e94009d6ad382..bd6d49433693b48a143cd8899d3538e18582eee8 100644 --- a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/TriggerD3PDMaker/TriggerKeyTool.h +++ b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/TriggerD3PDMaker/TriggerKeyTool.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -106,9 +106,6 @@ public: private: /// Property: Trigger configuration service instance. ServiceHandle<TrigConf::ITrigConfigSvc> m_trigConfigSvc; - - /// Property: DS configuration instance (sometimes used when reading MC). - ServiceHandle< TrigConf::ITrigConfigSvc > m_dsSvc; }; diff --git a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.cxx index 206dd64f3463bfe67d7cc9492b4632c4ede04113..290a736417870758615714a6089d4ed3d3e5cdcc 100644 --- a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: TrigDBKeysFillerTool.cxx 504000 2012-06-05 16:28:50Z ssnyder $ @@ -8,9 +8,6 @@ #include "AthenaKernel/errorcheck.h" #include "CxxUtils/crc64.h" -// Trigger include(s): -#include "TrigConfigSvc/DSConfigSvc.h" - // Local include(s): #include "TrigDBKeysFillerTool.h" @@ -20,9 +17,7 @@ namespace D3PD { const std::string& name, const IInterface* parent ) : BlockFillerTool< void >( type, name, parent ), - m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ), - m_dsSvc( "TrigConf::DSConfigSvc/DSConfigSvc", name ) { - + m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ) { book().ignore(); // Avoid coverity warnings. } @@ -60,25 +55,9 @@ namespace D3PD { ( static_cast< int >( *m_smk ) < 0 ) || ( static_cast< int >( *m_l1psk ) < 0 ) || ( static_cast< int >( *m_hltpsk ) < 0 ) ) { - - // See if we are reading an AOD: - if( ! m_dsSvc ) { - REPORT_MESSAGE( MSG::FATAL ) - << "The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."; - return StatusCode::FAILURE; - } - TrigConf::DSConfigSvc* dsSvc = dynamic_cast< TrigConf::DSConfigSvc* >( m_dsSvc.operator->() ); - if( ! dsSvc ) { - REPORT_MESSAGE( MSG::FATAL ) - << "The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."; - return StatusCode::FAILURE; - } - // Turn the configuration source name (probably an XML file in this case) into an // imaginary Super Master Key: - *m_smk = CxxUtils::crc64( dsSvc->configurationSource() ) & 0xffff; + *m_smk = CxxUtils::crc64( m_configSvc->configurationSource() ) & 0xffff; *m_l1psk = 0; *m_hltpsk = 0; } diff --git a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.h b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.h index 14c0f24db04daa79164038a938e7c1bae7ce4c8b..9c037e05e8cad34e88f8a1dc6f54d4780f388535 100644 --- a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.h +++ b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TrigDBKeysFillerTool.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: TrigDBKeysFillerTool.h 587765 2014-03-14 20:17:12Z ssnyder $ @@ -50,8 +50,6 @@ namespace D3PD { private: /// The trigger configuration service to get the information from ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc; - /// Handle used (sometimes) when reading MC files - ServiceHandle< TrigConf::IHLTConfigSvc > m_dsSvc; uint32_t* m_smk; ///< Super Master Key uint32_t* m_l1psk; ///< LVL1 Prescale Key diff --git a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TriggerKeyTool.cxx b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TriggerKeyTool.cxx index f043355fc3e745b9fba30adde89169a0ef420235..92c6b79e767bef141654879c3e98623cd957c1c3 100644 --- a/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TriggerKeyTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/TriggerD3PDMaker/src/TriggerKeyTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -13,7 +13,6 @@ #include "TriggerD3PDMaker/TriggerKeyTool.h" #include "TrigConfInterfaces/ITrigConfigSvc.h" -#include "TrigConfigSvc/DSConfigSvc.h" #include "CxxUtils/crc64.h" #include "AthenaKernel/errorcheck.h" #include <sstream> @@ -33,16 +32,12 @@ TriggerKeyTool::TriggerKeyTool (const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool (type, name, parent), - m_trigConfigSvc ("TrigConf::TrigConfigSvc/TrigConfigSvc", name), - m_dsSvc ("TrigConf::DSConfigSvc/DSConfigSvc", name) + m_trigConfigSvc ("TrigConf::TrigConfigSvc/TrigConfigSvc", name) { declareInterface<TriggerKeyTool> (this); declareProperty ("TrigConfigSvc", m_trigConfigSvc, "Trigger configuration service instance."); - declareProperty ("DSSvc", m_dsSvc, - "DS configuration instance " - "(sometimes used when reading MC)."); } @@ -74,24 +69,11 @@ TriggerKeyTool::Keys TriggerKeyTool::getKeys() const if ( (keys.first == 0 && keys.second.first == 0 && keys.second.second == 0) || keys.first < 0 || keys.second.first < 0 || keys.second.second < 0 ) { - // See if we are reading an AOD: - const TrigConf::DSConfigSvc* dsSvc = 0; - if (m_dsSvc) - dsSvc = dynamic_cast<const TrigConf::DSConfigSvc*> (&*m_dsSvc); - - if( ! dsSvc ) { - REPORT_MESSAGE( MSG::ERROR ) - << "The trigger configuration keys don't seem to make sense, " - << "and we're not using TrigConf::DSConfigSvc..."; - keys.first = -1; - } - else { - // Turn the configuration source name (probably an XML file in this case) - // into an imaginary Super Master Key: - keys = - std::make_pair( ( CxxUtils::crc64( dsSvc->configurationSource() ) & 0xffff ), + // Turn the configuration source name (probably an XML file in this case) + // into an imaginary Super Master Key: + keys = + std::make_pair( ( CxxUtils::crc64( m_trigConfigSvc->configurationSource() ) & 0xffff ), std::make_pair( 0, 0 ) ); - } } return keys; } @@ -111,15 +93,7 @@ std::string TriggerKeyTool::getString() const ss << "SMK" << smk; return ss.str(); } - - if (m_dsSvc) { - const TrigConf::DSConfigSvc* dsSvc = - dynamic_cast<const TrigConf::DSConfigSvc*> (&*m_dsSvc); - if (dsSvc) - return dsSvc->configurationSource(); - } - - return ""; + return m_trigConfigSvc->configurationSource(); } diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py index 5c5134ebc38c702599dc8dc5d95e4d962d4642ab..64488f961c7ae69f17ad6c3160d7001b267d6fbd 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py @@ -1,3 +1,4 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from future.utils import iteritems #################################################################### @@ -121,19 +122,10 @@ if TriggerFlags.doMT(): recoLog.info( "Configuring LVL1 simulation (MT)" ) from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence topSequence += Lvl1SimulationSequence(None) - recoLog.info( "Configuring HLT (MT)" ) - # this configuration of the HLTConfigSvc is only temporary - if not hasattr(svcMgr, 'HLTConfigSvc'): - from TrigConfigSvc.TrigConfigSvcConfig import HLTConfigSvc - svcMgr += HLTConfigSvc() - if TriggerFlags.readHLTconfigFromXML(): - hltJsonFile = TriggerFlags.inputHLTconfigFile().replace(".xml",".json").replace("HLTconfig", "HLTmenu") - else: - hltJsonFile = TriggerFlags.outputHLTconfigFile().replace(".xml",".json").replace("HLTconfig", "HLTmenu") - svcMgr.HLTConfigSvc.InputType = "file" - svcMgr.HLTConfigSvc.JsonFileName = hltJsonFile - recoLog.info("Configured HLTConfigSvc with InputType='file' and JsonFileName=%s" % hltJsonFile) + recoLog.info( "Configuring HLT (MT)" ) + from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc + svcMgr += getHLTConfigSvc() from L1Decoder.L1DecoderConfig import L1Decoder topSequence += L1Decoder() diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h index 9c2ac20863a8ad07bb9148f91abb5e660b8659e5..60d883eef3212972f6fa31edd161817cc93c1dde 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h @@ -59,8 +59,8 @@ namespace TrigConf { */ void clear(); - /** Access to the underlying data, if needed */ - const ptree & data() const { return m_data; } + /** Access to the underlying data, if needed */ + ptree data() const { return m_data; } /** Check for attribute * @return true if the structure is just a value @@ -122,6 +122,14 @@ namespace TrigConf { **/ DataStructure getObject(const std::string & pathToChild, bool ignoreIfMissing = false) const; + + /** Access to the keys of an DataStructure which presents a dictionary + * + * In case the DataStructure is a list or a simple attribute, an empty vector is returned + **/ + std::vector<std::string> getKeys() const; + + /** Access to initialized state */ explicit operator bool() const { return m_initialized; } bool isValid() const { return m_initialized; } diff --git a/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx index 0f570300907a59641b4da7c7fb77059fbf07d914..eac5f35fe9d624c38fc8c90679aeb057e689a5a6 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx @@ -147,6 +147,24 @@ TrigConf::DataStructure::getObject(const std::string & pathToChild, bool ignoreI } +std::vector<std::string> +TrigConf::DataStructure::getKeys() const +{ + std::vector<std::string> keys; + if ( ! m_data.empty() && + ! m_data.front().first.empty() ) + { + for( auto & entry : m_data ) { + keys.push_back(entry.first); + } + } + return keys; +} + + + + + void TrigConf::DataStructure::print(ostream & os) const { diff --git a/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx index 3b9600c20472d70367e1e8477b74d11a2d981b04..4cf60305df3f7403e1ce7b86cabb3f544e991b27 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx @@ -18,19 +18,19 @@ TrigConf::Chain::~Chain() const std::string & TrigConf::Chain::name() const { - return data().get_child("name").data(); + return m_data.get_child("name").data(); } unsigned int TrigConf::Chain::counter() const { - return data().get_child("counter").get_value<unsigned int>(); + return m_data.get_child("counter").get_value<unsigned int>(); } const std::string & TrigConf::Chain::l1item() const { - return data().get_child("l1item").data(); + return m_data.get_child("l1item").data(); } diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx index 25bdaf15d3508b5a12931f8636ab6cfb90ac7bea..a495626f1778eb90eb0b96c5836a2164d65cfab4 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Item.cxx @@ -17,43 +17,43 @@ TrigConf::L1Item::~L1Item() const std::string & TrigConf::L1Item::name() const { - return data().get_child("name").data(); + return m_data.get_child("name").data(); } unsigned int TrigConf::L1Item::ctpId() const { - return data().get_child("ctpId").get_value<unsigned int>(); + return m_data.get_child("ctpId").get_value<unsigned int>(); } const std::string & TrigConf::L1Item::definition() const { - return data().get_child("definition").data(); + return m_data.get_child("definition").data(); } unsigned int TrigConf::L1Item::complexDeadtime() const { - return data().get_child("complexDeadtime").get_value<unsigned int>(); + return m_data.get_child("complexDeadtime").get_value<unsigned int>(); } const std::string & TrigConf::L1Item::monitor() const { - return data().get_child("monitor").data(); + return m_data.get_child("monitor").data(); } unsigned int TrigConf::L1Item::partition() const { - return data().get_child("partition").get_value<unsigned int>(); + return m_data.get_child("partition").get_value<unsigned int>(); } const std::string & TrigConf::L1Item::triggerType() const { - return data().get_child("triggerType").data(); + return m_data.get_child("triggerType").data(); } TrigConf::DataStructure diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx index 34913025e1534f29c0e340382ecbf6f83a844aac..9b9aae7bf606bf52ab4b1d464535b5bd19288bbb 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx @@ -19,31 +19,31 @@ TrigConf::L1Threshold::~L1Threshold() const std::string & TrigConf::L1Threshold::name() const { - return data().get_child("name").data(); + return m_data.get_child("name").data(); } const std::string & TrigConf::L1Threshold::type() const { - return data().get_child("type").data(); + return m_data.get_child("type").data(); } const std::string & TrigConf::L1Threshold::input() const { - return data().get_child("input").data(); + return m_data.get_child("input").data(); } unsigned int TrigConf::L1Threshold::mapping() const { - return data().get_child("mapping").get_value<unsigned int>(); + return m_data.get_child("mapping").get_value<unsigned int>(); } unsigned int TrigConf::L1Threshold::id() const { - return data().get_child("id").get_value<unsigned int>(); + return m_data.get_child("id").get_value<unsigned int>(); } std::vector<TrigConf::DataStructure> diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx index 14f21a07677942bdc76d767faac29360fce8accf..dd6ef0ee40392ec7ac4c935a5b412356a0a80839 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx @@ -17,19 +17,19 @@ TrigConf::L1TopoAlgorithm::~L1TopoAlgorithm() unsigned int TrigConf::L1TopoAlgorithm::algId() const { - return data().get_child("algId").get_value<unsigned int>(); + return m_data.get_child("algId").get_value<unsigned int>(); } const std::string & TrigConf::L1TopoAlgorithm::name() const { - return data().get_child("name").data(); + return m_data.get_child("name").data(); } const std::string & TrigConf::L1TopoAlgorithm::type() const { - return data().get_child("type").data(); + return m_data.get_child("type").data(); } diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx index 3698667674b025749029002a68ba3b774102ab31..42280d2badc7e10a62cff5e0c5e2060fe194cc24 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoOutput.cxx @@ -17,42 +17,42 @@ TrigConf::L1TopoOutput::~L1TopoOutput() const std::string & TrigConf::L1TopoOutput::algName() const { - return data().get_child("algName").data(); + return m_data.get_child("algName").data(); } unsigned int TrigConf::L1TopoOutput::algId() const { - return data().get_child("algId").get_value<unsigned int>(); + return m_data.get_child("algId").get_value<unsigned int>(); } unsigned int TrigConf::L1TopoOutput::clock() const { - return data().get_child("clock").get_value<unsigned int>(); + return m_data.get_child("clock").get_value<unsigned int>(); } unsigned int TrigConf::L1TopoOutput::firstBit() const { - return data().get_child("firstBit").get_value<unsigned int>(); + return m_data.get_child("firstBit").get_value<unsigned int>(); } unsigned int TrigConf::L1TopoOutput::fpga() const { - return data().get_child("fpga").get_value<unsigned int>(); + return m_data.get_child("fpga").get_value<unsigned int>(); } unsigned int TrigConf::L1TopoOutput::board() const { - return data().get_child("board").get_value<unsigned int>(); + return m_data.get_child("board").get_value<unsigned int>(); } const std::string & TrigConf::L1TopoOutput::triggerLines() const { - return data().get_child("triggerLines").data(); + return m_data.get_child("triggerLines").data(); } diff --git a/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt index 8599b6debdbfa5ba0a108739c9bfd7a482ec599a..ad976cf756285bb8d730be624af028a69879589d 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt +++ b/Trigger/TrigConfiguration/TrigConfIO/CMakeLists.txt @@ -23,7 +23,7 @@ find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) # Component(s) in the package: atlas_add_library( TrigConfIOLib - TrigConfIO/*.h src/JsonFileLoader.cxx src/TrigDBLoader.cxx + TrigConfIO/*.h src/JsonFileLoader.cxx src/TrigDBLoader.cxx src/TrigDBMenuLoader.cxx src/TrigDBJobOptionsLoader.cxx PUBLIC_HEADERS TrigConfIO INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} TrigConfBase TrigConfData GaudiKernel diff --git a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBJobOptionsLoader.h b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBJobOptionsLoader.h new file mode 100644 index 0000000000000000000000000000000000000000..875a32382ea6ec8a4254fd9d73e4efd5513a8a65 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBJobOptionsLoader.h @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file TrigConfIO/TrigDBJobOptionsLoader.h + * @author J. Stelzer + * @date Sep 2019 + * @brief Loader class for Trigger configuration from the Trigger DB + */ + +#ifndef TRIGCONFIO_TRIGDBJOBOPTIONSLOADER_H +#define TRIGCONFIO_TRIGDBJOBOPTIONSLOADER_H + +#include "TrigConfData/DataStructure.h" + +#include "boost/property_tree/ptree.hpp" + +#include "TrigConfIO/TrigDBLoader.h" + +namespace TrigConf { + + /** + * @brief Loader of trigger configurations from Json files + */ + class TrigDBJobOptionsLoader : public TrigDBLoader { + public: + + /** Constructor */ + TrigDBJobOptionsLoader(const std::string & connection); + + /** Destructor */ + virtual ~TrigDBJobOptionsLoader(); + + /** + * @brief Load content from the Trigger DB into two ptrees for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param jobOptions [out] the loaded job options + */ + bool loadJobOptions ( unsigned int smk, + boost::property_tree::ptree & jobOptions ) const; + + /** + * @brief Load content from the Trigger DB into an L1Menu and an HLTMenu for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param jobOptions [out] the loaded job options + */ + bool loadJobOptions ( unsigned int smk, + DataStructure & jobOptions ) const; + + + }; + +} + +#endif + diff --git a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBLoader.h b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBLoader.h index 66978cc05d8b6a750e4fcc1606b3466cbbbbb40f..efe534334f0d0a629e73822bfb4120e2df04f878 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBLoader.h +++ b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBLoader.h @@ -9,16 +9,12 @@ * @brief Loader class for Trigger configuration from the Trigger DB */ -#ifndef TRIGCONFSTORAGE_DBLOADER_H -#define TRIGCONFSTORAGE_DBLOADER_H +#ifndef TRIGCONFIO_TRIGDBLOADER_H +#define TRIGCONFIO_TRIGDBLOADER_H -#include "GaudiKernel/StatusCode.h" - -#include "boost/property_tree/ptree.hpp" #include "TrigConfBase/TrigConfMessaging.h" -#include "TrigConfData/DataStructure.h" - +#include <memory> namespace coral { class ISessionProxy; @@ -33,53 +29,21 @@ namespace TrigConf { public: /** Constructor */ - TrigDBLoader(const std::string & connection); + TrigDBLoader(const std::string & loaderName, const std::string & connection); /** Destructor */ virtual ~TrigDBLoader(); - /** - * @brief Load content from the Trigger DB into a ptree for a given SuperMasterKey (SMK) - * @param smk [in] the SMK - * @param data [out] - * @param pathToChild [in] Path to a sub structure for partial loading of data - * - * The file is searched for in the path list defined by the environment variable @c DATAPATH. - * If the optional parameter @c pathToChild is specified, one can load parts if the configuration - * from the file. - *@code - * TrigConf::TrigDBLoader fileLoader; - * TrigConf::DataStructure metSignificance; - * fileLoader.loadFile( l1_filename, metSignificance, "CaloInfo.METSignificance"); - @endcode - */ - StatusCode loadMenu ( unsigned int smk, - boost::property_tree::ptree & l1data, - boost::property_tree::ptree & hltdata - ); - - /** - * @brief Load content of json file into a ptree - * @param filename [in] Name of the json file - * @param data [out] - * @param pathToChild [in] Path to a sub structure for partial loading of data - */ - StatusCode loadMenu ( unsigned int smk, - DataStructure & l1menu, - DataStructure & hltmenu); - void setLevel(MSGTC::Level lvl) { msg().setLevel(lvl); } MSGTC::Level outputLevel() const { return msg().level(); } - private: + protected: /** @brief create (if needed) DB session and return the session proxy */ - coral::ISessionProxy& getDBSession(); - - /**@brief close open sessions*/ - void closeDBSession(); + std::unique_ptr<coral::ISessionProxy> createDBSession() const; + private: // private variables std::string m_connection {"TRIGGERDB"}; @@ -87,8 +51,6 @@ namespace TrigConf { int m_retrialTimeout {0}; int m_connectionTimeout {0}; - coral::ISessionProxy * m_sessionproxy { nullptr }; ///< the coral database session - }; } diff --git a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBMenuLoader.h b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBMenuLoader.h new file mode 100644 index 0000000000000000000000000000000000000000..567613f98f70b910fff5cf1fe04ba42c2e5c1094 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBMenuLoader.h @@ -0,0 +1,77 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file TrigConfIO/TrigDBLoader.h + * @author J. Stelzer + * @date Sep 2019 + * @brief Loader class for Trigger configuration from the Trigger DB + */ + +#ifndef TRIGCONFIO_TRIGDBMENULOADER_H +#define TRIGCONFIO_TRIGDBMENULOADER_H + +#include "TrigConfIO/TrigDBLoader.h" + +#include "boost/property_tree/ptree.hpp" + +#include "TrigConfData/DataStructure.h" + + +namespace TrigConf { + + /** + * @brief Loader of trigger menu configurations from the database + */ + class TrigDBMenuLoader : public TrigConf::TrigDBLoader { + public: + + /** Constructor */ + TrigDBMenuLoader(const std::string & connection); + + /** Destructor */ + virtual ~TrigDBMenuLoader(); + + /** + * @brief Load L1 menu content from the Trigger DB into a ptree for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param l1menu [out] the loaded L1 menu + * @return true if loading was successfull + */ + bool loadL1Menu ( unsigned int smk, + boost::property_tree::ptree & l1menu ) const; + + /** + * @brief Load HLT menu content from the Trigger DB into two ptrees for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param hltmenu [out] the loaded HLT menu + * @return true if loading was successfull + */ + bool loadHLTMenu ( unsigned int smk, + boost::property_tree::ptree & hltmenu ) const; + + /** + * @brief Load content from the Trigger DB into an L1Menu for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param l1menu [out] the loaded L1 menu + * @return true if loading was successfull + */ + bool loadL1Menu ( unsigned int smk, + DataStructure & l1menu ) const; + + /** + * @brief Load content from the Trigger DB into an HLTMenu for a given SuperMasterKey (SMK) + * @param smk [in] the SMK that should be loaded + * @param hltmenu [out] the loaded HLT menu + * @return true if loading was successfull + */ + bool loadHLTMenu ( unsigned int smk, + DataStructure & hltmenu ) const; + + }; + +} + +#endif + diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBJobOptionsLoader.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBJobOptionsLoader.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7f9c0d91aa405ce38411ebafc4b282d9d48512a3 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBJobOptionsLoader.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigConfIO/TrigDBJobOptionsLoader.h" + +#include "CoralBase/Exception.h" +#include "CoralBase/Attribute.h" +#include "CoralBase/AttributeList.h" +#include "CoralBase/Blob.h" + +#include "RelationalAccess/IRelationalService.h" +#include "RelationalAccess/IRelationalDomain.h" +#include "RelationalAccess/ConnectionService.h" +#include "RelationalAccess/IConnectionServiceConfiguration.h" +#include "RelationalAccess/ISessionProxy.h" +#include "RelationalAccess/IQuery.h" +#include "RelationalAccess/ISchema.h" +#include "RelationalAccess/ICursor.h" +#include "RelationalAccess/ITransaction.h" + + +#include "boost/property_tree/ptree.hpp" +#include "boost/property_tree/json_parser.hpp" +#include "boost/iostreams/stream.hpp" + +#include <memory> +#include <exception> + +using ptree = boost::property_tree::ptree; + +TrigConf::TrigDBJobOptionsLoader::TrigDBJobOptionsLoader(const std::string & connection) : + TrigDBLoader("TrigDBJobOptionsLoader", connection) +{} + +TrigConf::TrigDBJobOptionsLoader::~TrigDBJobOptionsLoader() +{} + + +bool +TrigConf::TrigDBJobOptionsLoader::loadJobOptions ( unsigned int smk, + boost::property_tree::ptree & jobOptions ) const +{ + auto session = createDBSession(); + session->transaction().start( /*bool readonly=*/ true); + + std::unique_ptr< coral::IQuery > query( session->nominalSchema().newQuery() ); + query->addToTableList ( "SUPER_MASTER_TABLE", "SMT" ); + query->addToTableList ( "JO_MASTER_TABLE", "JOMT" ); + + // bind list + coral::AttributeList bindList; + bindList.extend<int>("smk"); + bindList[0].data<int>() = smk; + + // condition clause + std::string theCondition = ""; + theCondition += std::string( " SMT.SMT_ID = :smk" ); + theCondition += std::string( " AND SMT.SMT_JO_MASTER_TABLE_ID = JOMT.JO_ID" ); + + query->setCondition( theCondition, bindList ); + + // output data and types + coral::AttributeList attList; + attList.extend<std::string>( "SMT.SMT_NAME" ); + attList.extend<int> ( "SMT.SMT_VERSION" ); + attList.extend<int> ( "SMT.SMT_JO_MASTER_TABLE_ID" ); + attList.extend<coral::Blob>( "JOMT.JO_CONTENT" ); + + query->defineOutput(attList); + for( const coral::Attribute & attr : attList) { + query->addToOutputList(attr.specification().name()); + } + + coral::ICursor& cursor = query->execute(); + + if ( ! cursor.next() ) { + throw std::runtime_error( "TrigDBJobOptionsLoader: SuperMasterKey not available" ); + } + + const coral::AttributeList& row = cursor.currentRow(); + + const coral::Blob& joBlob = row["JOMT.JO_CONTENT"].data<coral::Blob>(); + boost::iostreams::stream<boost::iostreams::array_source> stream( static_cast<const char*> ( joBlob.startingAddress()), joBlob.size()); + boost::property_tree::read_json(stream, jobOptions); + + session->transaction().commit(); + + return true; +} + + +bool +TrigConf::TrigDBJobOptionsLoader::loadJobOptions ( unsigned int smk, + DataStructure & jobOptions ) const +{ + + boost::property_tree::ptree ptJobOptions, pthlt; + + bool success = this -> loadJobOptions( smk, ptJobOptions); + + if(!success) + return false; + + if( ! ptJobOptions.empty() ) + jobOptions.setData(ptJobOptions); + + return true; +} + diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBLoader.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBLoader.cxx index f3f937e7a069fe43fcd59b88e00f276fec7a6725..0fa387017693bf0c557e861446bdd076187bd5b2 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBLoader.cxx +++ b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBLoader.cxx @@ -5,136 +5,27 @@ #include "TrigConfIO/TrigDBLoader.h" #include "CoralBase/Exception.h" -#include "CoralBase/Attribute.h" -#include "CoralBase/AttributeList.h" -#include "CoralBase/Blob.h" -#include "RelationalAccess/IRelationalService.h" -#include "RelationalAccess/IRelationalDomain.h" #include "RelationalAccess/ConnectionService.h" #include "RelationalAccess/IConnectionServiceConfiguration.h" #include "RelationalAccess/ISessionProxy.h" -#include "RelationalAccess/IQuery.h" -#include "RelationalAccess/ISchema.h" -#include "RelationalAccess/ICursor.h" -#include "RelationalAccess/ITransaction.h" - #include "boost/property_tree/ptree.hpp" -#include "boost/property_tree/json_parser.hpp" -#include "boost/iostreams/stream.hpp" - -#include <memory> -#include <exception> using ptree = boost::property_tree::ptree; -TrigConf::TrigDBLoader::TrigDBLoader(const std::string & connection) : - TrigConfMessaging("TrigDBLoader"), +TrigConf::TrigDBLoader::TrigDBLoader(const std::string & loaderName, const std::string & connection) : + TrigConfMessaging(loaderName), m_connection(connection) {} + TrigConf::TrigDBLoader::~TrigDBLoader() {} - -StatusCode -TrigConf::TrigDBLoader::loadMenu ( unsigned int smk, - boost::property_tree::ptree & l1menu, boost::property_tree::ptree & hltmenu ) -{ - StatusCode sc = StatusCode::SUCCESS; - - bool mySession = false; - auto & session = getDBSession(); - if ( ! session.transaction().isActive() ) { - session.transaction().start(true); - mySession = true; - } - - std::unique_ptr< coral::IQuery > query( session.nominalSchema().newQuery() ); - query->addToTableList ( "SUPER_MASTER_TABLE", "SMT" ); - query->addToTableList ( "L1_MASTER_TABLE", "L1MT" ); - query->addToTableList ( "HLT_MASTER_TABLE", "HMT" ); - - // bind list - coral::AttributeList bindList; - bindList.extend<int>("smk"); - bindList[0].data<int>() = smk; - - // condition clause - std::string theCondition = ""; - theCondition += std::string( " SMT.SMT_ID = :smk" ); - theCondition += std::string( " AND SMT.SMT_L1_MASTER_TABLE_ID = L1MT.L1MT_ID" ); - theCondition += std::string( " AND SMT.SMT_HLT_MASTER_TABLE_ID = HMT.HMT_ID" ); - - query->setCondition( theCondition, bindList ); - - // output data and types - coral::AttributeList attList; - attList.extend<std::string>( "SMT.SMT_NAME" ); - attList.extend<int> ( "SMT.SMT_VERSION" ); - attList.extend<int> ( "SMT.SMT_L1_MASTER_TABLE_ID" ); - attList.extend<int> ( "SMT.SMT_HLT_MASTER_TABLE_ID" ); - attList.extend<coral::Blob>( "L1MT.L1MT_MENU" ); - attList.extend<coral::Blob>( "HMT.HMT_MENU" ); - - query->defineOutput(attList); - for( const coral::Attribute & attr : attList) { - query->addToOutputList(attr.specification().name()); - } - - coral::ICursor& cursor = query->execute(); - - if ( ! cursor.next() ) { - throw std::runtime_error( "TrigDBLoader: SuperMasterKey not available" ); - } - - const coral::AttributeList& row = cursor.currentRow(); - - const coral::Blob& l1menuBlob = row["L1MT.L1MT_MENU"].data<coral::Blob>(); - boost::iostreams::stream<boost::iostreams::array_source> streamL1( static_cast<const char*> ( l1menuBlob.startingAddress()), l1menuBlob.size()); - boost::property_tree::read_json(streamL1, l1menu); - - const coral::Blob& hltmenuBlob = row["HMT.HMT_MENU"].data<coral::Blob>(); - boost::iostreams::stream<boost::iostreams::array_source> streamHLT( static_cast<const char*> ( hltmenuBlob.startingAddress()), hltmenuBlob.size()); - boost::property_tree::read_json(streamHLT, hltmenu); - - if ( mySession ) session.transaction().commit(); - - return sc; -} - - -StatusCode -TrigConf::TrigDBLoader::loadMenu ( unsigned int smk, - DataStructure & l1menu, DataStructure & hltmenu ) -{ - - boost::property_tree::ptree ptl1, pthlt; - - StatusCode sc = this -> loadMenu( smk, ptl1, pthlt); - - if(!sc.isSuccess()) - return sc; - - if( ! ptl1.empty() ) - l1menu.setData(ptl1); - if( ! pthlt.empty() ) - hltmenu.setData(pthlt); - - return sc; -} - - - -coral::ISessionProxy& -TrigConf::TrigDBLoader::getDBSession() { - - // if we have a session proxy, use it - if( m_sessionproxy ) - return *m_sessionproxy; - +std::unique_ptr<coral::ISessionProxy> +TrigConf::TrigDBLoader::createDBSession() const { coral::ConnectionService connSvc; coral::IConnectionServiceConfiguration& csc = connSvc.configuration(); @@ -142,35 +33,20 @@ TrigConf::TrigDBLoader::getDBSession() { csc.setConnectionRetrialTimeOut( m_retrialTimeout ); csc.setConnectionTimeOut( m_connectionTimeout ); - + /* TODO if(csc.replicaSortingAlgorithm() == nullptr) { // likely to be standalone, create our own TRG_MSG_INFO("Create own ReplicaSortingAlgorithm"); - // m_replicaSorter = new TrigConf::ReplicaSorter(); - // csc.setReplicaSortingAlgorithm(*m_replicaSorter); + m_replicaSorter = new TrigConf::ReplicaSorter(); + csc.setReplicaSortingAlgorithm(*m_replicaSorter); } + */ TRG_MSG_INFO("Connecting to " << m_connection); - m_sessionproxy = connSvc.connect(m_connection, coral::AccessMode::ReadOnly); - TRG_MSG_INFO("Opening session " << m_connection << " with " - << m_retrialPeriod << "/" << m_retrialTimeout << "/" << m_connectionTimeout); - - return *m_sessionproxy; -} - -void -TrigConf::TrigDBLoader::closeDBSession() { + auto proxy = std::unique_ptr<coral::ISessionProxy>( connSvc.connect(m_connection, coral::AccessMode::ReadOnly) ); - if(m_sessionproxy) { - try{ - delete m_sessionproxy; - m_sessionproxy = nullptr; - TRG_MSG_INFO("Closing session " << m_connection); - } - catch ( coral::Exception& e ) { - TRG_MSG_WARNING("CORAL exception " << e.what()); - throw; - } - } + TRG_MSG_INFO("Opened session " << m_connection << " with " + << m_retrialPeriod << "/" << m_retrialTimeout << "/" << m_connectionTimeout); + return proxy; } diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBMenuLoader.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBMenuLoader.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4184237b691a9458f8cde5a3a26cd40ad7d0b875 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBMenuLoader.cxx @@ -0,0 +1,171 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigConfIO/TrigDBMenuLoader.h" + +#include "CoralBase/Exception.h" +#include "CoralBase/Attribute.h" +#include "CoralBase/AttributeList.h" +#include "CoralBase/Blob.h" + +#include "RelationalAccess/IRelationalService.h" +#include "RelationalAccess/IRelationalDomain.h" +#include "RelationalAccess/ConnectionService.h" +#include "RelationalAccess/IConnectionServiceConfiguration.h" +#include "RelationalAccess/ISessionProxy.h" +#include "RelationalAccess/IQuery.h" +#include "RelationalAccess/ISchema.h" +#include "RelationalAccess/ICursor.h" +#include "RelationalAccess/ITransaction.h" + + +#include "boost/property_tree/ptree.hpp" +#include "boost/property_tree/json_parser.hpp" +#include "boost/iostreams/stream.hpp" + +#include <memory> +#include <exception> + +using ptree = boost::property_tree::ptree; + +TrigConf::TrigDBMenuLoader::TrigDBMenuLoader(const std::string & connection) : + TrigDBLoader("TrigDBMenuLoader", connection) +{} + +TrigConf::TrigDBMenuLoader::~TrigDBMenuLoader() +{} + + + +bool +TrigConf::TrigDBMenuLoader::loadL1Menu ( unsigned int smk, + boost::property_tree::ptree & l1menu ) const +{ + auto session = createDBSession(); + session->transaction().start( /*bool readonly=*/ true); + + std::unique_ptr< coral::IQuery > query( session->nominalSchema().newQuery() ); + query->addToTableList ( "SUPER_MASTER_TABLE", "SMT" ); + query->addToTableList ( "L1_MASTER_TABLE", "L1MT" ); + + // bind list + coral::AttributeList bindList; + bindList.extend<int>("smk"); + bindList[0].data<int>() = smk; + + // condition clause + std::string theCondition = ""; + theCondition += std::string( " SMT.SMT_ID = :smk" ); + theCondition += std::string( " AND SMT.SMT_L1_MASTER_TABLE_ID = L1MT.L1MT_ID" ); + + query->setCondition( theCondition, bindList ); + + // output data and types + coral::AttributeList attList; + attList.extend<std::string>( "SMT.SMT_NAME" ); + attList.extend<int> ( "SMT.SMT_VERSION" ); + attList.extend<int> ( "SMT.SMT_L1_MASTER_TABLE_ID" ); + attList.extend<coral::Blob>( "L1MT.L1MT_MENU" ); + + query->defineOutput(attList); + for( const coral::Attribute & attr : attList) { + query->addToOutputList(attr.specification().name()); + } + + coral::ICursor& cursor = query->execute(); + + if ( ! cursor.next() ) { + throw std::runtime_error( "TrigDBMenuLoader: SuperMasterKey not available" ); + } + + const coral::AttributeList& row = cursor.currentRow(); + + const coral::Blob& l1menuBlob = row["L1MT.L1MT_MENU"].data<coral::Blob>(); + boost::iostreams::stream<boost::iostreams::array_source> streamL1( static_cast<const char*> ( l1menuBlob.startingAddress()), l1menuBlob.size()); + boost::property_tree::read_json(streamL1, l1menu); + + session->transaction().commit(); + + return true; +} + + + +bool +TrigConf::TrigDBMenuLoader::loadHLTMenu ( unsigned int smk, + boost::property_tree::ptree & hltmenu ) const +{ + auto session = createDBSession(); + session->transaction().start( /*bool readonly=*/ true); + + std::unique_ptr< coral::IQuery > query( session->nominalSchema().newQuery() ); + query->addToTableList ( "SUPER_MASTER_TABLE", "SMT" ); + query->addToTableList ( "HLT_MASTER_TABLE", "HMT" ); + + // bind list + coral::AttributeList bindList; + bindList.extend<int>("smk"); + bindList[0].data<int>() = smk; + + // condition clause + std::string theCondition = ""; + theCondition += std::string( " SMT.SMT_ID = :smk" ); + theCondition += std::string( " AND SMT.SMT_HLT_MASTER_TABLE_ID = HMT.HMT_ID" ); + + query->setCondition( theCondition, bindList ); + + // output data and types + coral::AttributeList attList; + attList.extend<std::string>( "SMT.SMT_NAME" ); + attList.extend<int> ( "SMT.SMT_VERSION" ); + attList.extend<int> ( "SMT.SMT_HLT_MASTER_TABLE_ID" ); + attList.extend<coral::Blob>( "HMT.HMT_MENU" ); + + query->defineOutput(attList); + for( const coral::Attribute & attr : attList) { + query->addToOutputList(attr.specification().name()); + } + + coral::ICursor& cursor = query->execute(); + + if ( ! cursor.next() ) { + throw std::runtime_error( "TrigDBMenuLoader: SuperMasterKey not available" ); + } + + const coral::AttributeList& row = cursor.currentRow(); + + const coral::Blob& hltmenuBlob = row["HMT.HMT_MENU"].data<coral::Blob>(); + boost::iostreams::stream<boost::iostreams::array_source> streamHLT( static_cast<const char*> ( hltmenuBlob.startingAddress()), hltmenuBlob.size()); + boost::property_tree::read_json(streamHLT, hltmenu); + + session->transaction().commit(); + + return true; +} + + + +bool +TrigConf::TrigDBMenuLoader::loadL1Menu( unsigned int smk, DataStructure & l1menu ) const +{ + boost::property_tree::ptree ptl1; + bool success = loadL1Menu( smk, ptl1 ); + if(!success) + return false; + if( ! ptl1.empty() ) + l1menu.setData(ptl1); + return true; +} + +bool +TrigConf::TrigDBMenuLoader::loadHLTMenu( unsigned int smk, DataStructure & hltmenu ) const +{ + boost::property_tree::ptree pthlt; + bool success = loadHLTMenu( smk, pthlt ); + if(!success) + return false; + if( ! pthlt.empty() ) + hltmenu.setData(pthlt); + return true; +} diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx index b813e7cff952cad8f44eaa94c1bc4c3a788302bf..20a2b87919eb9d623d4b04c6fd96e2b40cb306e7 100644 --- a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx +++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx @@ -6,7 +6,8 @@ #include <vector> #include "TrigConfIO/JsonFileLoader.h" -#include "TrigConfIO/TrigDBLoader.h" +#include "TrigConfIO/TrigDBMenuLoader.h" +#include "TrigConfIO/TrigDBJobOptionsLoader.h" #include "TrigConfData/HLTMenu.h" #include "TrigConfData/L1Menu.h" #include "TrigConfData/L1TopoMenu.h" @@ -26,7 +27,7 @@ public: ~Config(){} Config(){} - std::vector<std::string> knownParameters { "file", "smk", "db", "write", "help", "h" }; + std::vector<std::string> knownParameters { "file", "smk", "db", "write", "help", "h", "d", "detail" }; // parameters // input @@ -38,8 +39,8 @@ public: std::string base { "" }; // other - bool help {false}; - + bool help { false }; + bool detail { false }; // to keep track of configuration errors vector<string> error; @@ -65,6 +66,7 @@ void Config::usage() { cout << " --write [base] ... to write out json files, e.g. L1menu[_<base>].json. base is optional.\n"; cout << "[Other options]\n"; cout << " -h|--help ... this help\n"; + cout << " -d|--detail ... prints detailed job options\n"; cout << "\n\n"; cout << "Examples\n"; cout << " --file L1menu.json HLTMenu.json ... read L1Menu.json and HLTMenu.json and show some basic statistics\n"; @@ -96,6 +98,7 @@ Config::parseProgramOptions(int argc, char* argv[]) { currentParameter = ""; // check the boolean parameters if(paramName == "h" || paramName == "help" ) { help = true; continue; } + if(paramName == "d" || paramName == "detail" ) { detail = true; continue; } currentParameter = paramName; continue; } @@ -129,6 +132,10 @@ Config::parseProgramOptions(int argc, char* argv[]) { error.push_back("No input specified! Please provide either input file(s) or smk"); } + if ( listofUnknownParameters.size() > 0 ) { + error.push_back( string("Unknown parameter(s):") + listofUnknownParameters); + } + } @@ -180,24 +187,47 @@ int main(int argc, char** argv) { if( cfg.smk != 0 ) { // load config from DB - // db loader - TrigConf::TrigDBLoader dbloader(cfg.dbalias); + // db menu loader + TrigConf::TrigDBMenuLoader dbloader(cfg.dbalias); TrigConf::L1Menu l1menu; TrigConf::HLTMenu hltmenu; - dbloader.loadMenu( cfg.smk, l1menu, hltmenu ); + dbloader.loadL1Menu( cfg.smk, l1menu ); if (l1menu) { cout << "Loaded L1 menu with " << l1menu.size() << " items" << endl; l1menu.printStats(); } else { cout << "Did not load an L1 menu" << endl; } + + dbloader.loadHLTMenu( cfg.smk, hltmenu ); if (hltmenu) { cout << "Loaded HLT menu with " << hltmenu.size() << " chains" << endl; } else { cout << "Did not load an HLT menu" << endl; } + + // db job options loader + TrigConf::TrigDBJobOptionsLoader jodbloader(cfg.dbalias); + + TrigConf::DataStructure jo; + jodbloader.loadJobOptions( cfg.smk, jo ); + if (jo) { + cout << "Loaded job options with " << jo.getObject("properties").getKeys().size() << " entries " << endl; + if( cfg.detail ) { + for( const auto alg : jo.getObject("properties").data()) { + std::cout << alg.first << std::endl; + for( const auto prop : alg.second ) { + std::cout << " " << prop.first << " -> " << prop.second.data() << std::endl; + } + } + } + } else { + cout << "Did not load job options" << endl; + } + + } diff --git a/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/IHLTConfigSvc.h b/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/IHLTConfigSvc.h index 75440eab0c587b9a961e5781c67b2083528549a3..df8b6d4e527f49ca9ae32710e901daba0f103c24 100644 --- a/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/IHLTConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/IHLTConfigSvc.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: IHLTConfigSvc.h 660352 2015-04-13 23:03:15Z stelzer $ @@ -14,6 +14,8 @@ // Local include(s): #include "TrigConfInterfaces/IIHLTConfigSvc.h" +#include <string> + namespace TrigConf { // Forward declaration(s): diff --git a/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/ITrigConfigSvc.h b/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/ITrigConfigSvc.h index b1fb37967706bf575ed71d7d3060b16e5e7cd3f9..0cbfece7a3b8181e6994677744510ba582b88a3a 100644 --- a/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/ITrigConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfInterfaces/TrigConfInterfaces/ITrigConfigSvc.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: ITrigConfigSvc.h 706340 2015-11-06 10:35:33Z krasznaa $ @@ -40,6 +40,8 @@ namespace TrigConf { /// Specify the interface declared by this class DeclareInterfaceID( ITrigConfigSvc, 0, 1 ); + virtual std::string configurationSource() const = 0; + }; // class ITrigConfigSvc } // namespace TrigConf diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt index 2e5891f9e55e912f4b88f7994b5d84abc2c5ba32..ce3981f774e2469bf29421ad55794296c31cdd2f 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt +++ b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt @@ -7,6 +7,7 @@ atlas_subdir( TrigConfigSvc ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC + PRIVATE Control/AthenaBaseComps Control/StoreGate GaudiKernel @@ -16,7 +17,6 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigConfiguration/TrigConfInterfaces Trigger/TrigConfiguration/TrigConfL1Data Trigger/TrigEvent/TrigSteeringEvent - PRIVATE Control/AthenaKernel Control/AthAnalysisBaseComps Control/AthenaMonitoring @@ -37,17 +37,11 @@ find_package( ROOT COMPONENTS Hist ) find_package( cx_Oracle ) find_package( nlohmann_json ) -# Component(s) in the package: -atlas_add_library( TrigConfigSvcLib - src/*.cxx src/*.h - PUBLIC_HEADERS TrigConfigSvc - PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps AthenaKernel GaudiKernel StoreGateLib TrigConfHLTData TrigConfInterfaces TrigConfL1Data - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} ${ROOT_LIBRARIES} AthAnalysisBaseCompsLib AthenaMonitoringLib AthenaPoolUtilities EventInfo IOVDbDataModel L1TopoConfig PathResolver TrigConfBase TrigConfStorage TrigConfData TrigConfIOLib nlohmann_json::nlohmann_json ) - atlas_add_component( TrigConfigSvc + src/*.cxx src/components/*.cxx - LINK_LIBRARIES TrigConfigSvcLib ) + INCLUDE_DIRS ${COOL_INCLUDE_DIRS} + LINK_LIBRARIES AthAnalysisBaseCompsLib AthenaBaseComps TrigConfIOLib TrigConfData TrigConfStorage TrigConfL1Data L1TopoConfig EventInfo AthenaMonitoringLib nlohmann_json::nlohmann_json ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/selection.xml b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/selection.xml deleted file mode 100644 index 20bf7ed421045a359bf4a39783e585a2dfcfcb3a..0000000000000000000000000000000000000000 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/selection.xml +++ /dev/null @@ -1,26 +0,0 @@ -<lcgdict> - <class name="TrigConf::HLTChainList"/> - <class name="TrigConf::HLTSequenceList"/> - <class name="std::vector<TrigConf::HLTChain*>"/> - <class name="TrigConf::HLTChain"/> - <class name="std::vector<TrigConf::HLTSignature*>"/> - <class name="TrigConf::HLTSignature"/> - <class name="std::vector<TrigConf::HLTTriggerElement*>"/> - <class name="TrigConf::HLTTriggerElement"/> - <class name="std::vector<TrigConf::HLTTriggerType*>"/> - <class name="TrigConf::HLTTriggerType"/> - <class name="std::vector<TrigConf::HLTStreamTag*>"/> - <class name="TrigConf::HLTStreamTag"/> - <class name="std::vector<TrigConf::HLTSequence*>"/> - <class name="TrigConf::HLTSequence"/> - - <class name="TrigConf::TrigConfigARA"/> - <class name="TrigConf::TrigConfigSvcARA"/> - - <class name="TrigConf::TriggerItem"/> - <class name="TrigConf::CTPConfig"/> - <class name="TrigConf::L1DataBaseclass"/> - <class name="TrigConf::TrigConfData"/> - <class name="TrigConf::ThresholdConfig"/> - -</lcgdict> diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py new file mode 100644 index 0000000000000000000000000000000000000000..c3d427a6265b8a427629e5a1c61fc9d3e787c1a3 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py @@ -0,0 +1,123 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from PyUtils.Decorators import memoize +from AthenaCommon.Logging import logging + +# L1 Json file name +def getL1MenuFileName( flags=None ): + if flags is None: + from TriggerJobOpts.TriggerFlags import TriggerFlags as tf + l1MenuFileName = 'L1Menu_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' + else: + l1MenuFileName = 'L1Menu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' + l1MenuFileName = l1MenuFileName.replace(".xml",".json").replace("LVL1config", "L1Menu") + l1MenuFileName = l1MenuFileName.replace("_newJO","") + return l1MenuFileName + +# HLT Json file name +def getHLTMenuFileName( flags=None ): + if flags is None: + from TriggerJobOpts.TriggerFlags import TriggerFlags as tf + hltMenuFileName = 'HLTMenu_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' + else: + hltMenuFileName = 'HLTMenu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' + hltMenuFileName = hltMenuFileName.replace(".xml",".json").replace("HLTconfig", "HLTMenu").replace("HLTmenu", "HLTMenu") + hltMenuFileName = hltMenuFileName.replace("_newJO","") + return hltMenuFileName + + +# L1 menu generation +@memoize +def generateL1Menu( flags=None ): + log = logging.getLogger('TrigConfigSvcCfg') + from TriggerJobOpts.TriggerFlags import TriggerFlags + fileName = getL1MenuFileName( flags ) + if flags: + TriggerFlags.triggerMenuSetup = flags.Trigger.triggerMenuSetup + menuName = TriggerFlags.triggerMenuSetup() if flags is None else flags.Trigger.triggerMenuSetup + log.info("Generating L1 menu %s", menuName) + from TriggerMenuMT.L1.L1MenuConfig import L1MenuConfig + l1cfg = L1MenuConfig( menuName = menuName, outputFile = fileName ) + log.info("Writing L1 menu file %s", fileName) + l1cfg.writeJSON() + # also still generate the old L1 xml + + + return fileName + + +# configuration of L1ConfigSvc +def getL1ConfigSvc( flags = None ): + log = logging.getLogger('TrigConfigSvcCfg') + from AthenaCommon.Logging import log + from TriggerJobOpts.TriggerFlags import TriggerFlags + from TrigConfigSvc.TrigConfigSvcConf import TrigConf__LVL1ConfigSvc + from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH + from AthenaCommon.AppMgr import theApp + # generate menu file + generateL1Menu( flags=flags ) + + # configure config svc + l1ConfigSvc = TrigConf__LVL1ConfigSvc( "LVL1ConfigSvc" ) + l1XMLFile = findFileInXMLPATH( TriggerFlags.inputLVL1configFile() if flags is None else flags.Trigger.LVL1ConfigFile ) + l1ConfigSvc.ConfigSource = "XML" + l1ConfigSvc.XMLMenuFile = l1XMLFile + l1ConfigSvc.InputType = "file" + l1JsonFileName = getL1MenuFileName( flags ) + l1ConfigSvc.JsonFileName = l1JsonFileName + theApp.CreateSvc += [ "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc" ] + log.info( "Configured LVL1ConfigSvc with run 2 style input file : %s", l1XMLFile ) + log.info( "Configured LVL1ConfigSvc with InputType='file' and JsonFileName=%s", l1JsonFileName ) + return l1ConfigSvc + + +# configuration of HLTConfigSvc +def getHLTConfigSvc( flags = None ): + log = logging.getLogger('TrigConfigSvcCfg') + from AthenaCommon.Logging import log + from TrigConfigSvc.TrigConfigSvcConf import TrigConf__HLTConfigSvc + from AthenaCommon.AppMgr import theApp + hltConfigSvc = TrigConf__HLTConfigSvc( "HLTConfigSvc" ) + hltXMLFile = "None" + hltConfigSvc.ConfigSource = "Run3_Dummy" + hltConfigSvc.XMLMenuFile = hltXMLFile + hltConfigSvc.InputType = "file" + hltJsonFileName = getHLTMenuFileName( flags ) + hltConfigSvc.JsonFileName = hltJsonFileName + theApp.CreateSvc += [ "TrigConf::HLTConfigSvc/HLTConfigSvc" ] + log.info( "Configured HLTConfigSvc with run 2 style input file : %s", hltXMLFile ) + log.info( "Configured HLTConfigSvc with InputType='file' and JsonFileName=%s", hltJsonFileName ) + return hltConfigSvc + +# provide both services in new JO +def L1ConfigSvcCfg( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + acc.addService( getL1ConfigSvc( flags ) ) + return acc + +# provide both services in new JO +def HLTConfigSvcCfg( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + acc.addService( getHLTConfigSvc( flags ) ) + return acc + +# provide both services in new JO +def TrigConfigSvcCfg( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + acc.addService( getL1ConfigSvc( flags ) ) + acc.addService( getHLTConfigSvc( flags ) ) + return acc + + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=True + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.lock() + acc = TrigConfigSvcCfg( ConfigFlags ) + acc.store( file( "test.pkl", "w" ) ) + print("All OK") diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py index 64251b60ff0a6f2c6a6e1c6240d9c83ab7be12f5..2610e129441328aa5755287b31f9f7f9ff9946a0 100755 --- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py @@ -435,8 +435,8 @@ def TrigConfigSvcCfg( flags ): from TrigConfigSvc.TrigConfigSvcConf import TrigConf__HLTConfigSvc hltConfigSvc = TrigConf__HLTConfigSvc( "HLTConfigSvc" ) - hltJsonFile = flags.Trigger.HLTConfigFile.replace(".xml",".json").replace("HLTconfig","HLTmenu") - hltJsonFile = findFileInXMLPATH(hltJsonFile) + hltJsonFile = flags.Trigger.HLTMenuFile.replace(".xml",".json").replace("HLTconfig","HLTmenu") + #hltJsonFile = findFileInXMLPATH(hltJsonFile) log.debug( "HLTConfigSvc input file:"+hltJsonFile ) hltConfigSvc.JsonFileName = hltJsonFile diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx index 964563b2b71e9b69076ae09ab511a4c10f5518a5..108c262584b3cd984472a2eb92e8edac394ca976 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "TrigConfigSvc/ConfigSvcBase.h" +#include "./ConfigSvcBase.h" #include "TrigConfBase/TrigDBConnectionConfig.h" #include "TrigConfStorage/IStorageMgr.h" #include "TrigConfStorage/StorageMgr.h" @@ -60,7 +60,10 @@ ConfigSvcBase::initialize() { string s(boost::to_lower_copy(m_configSourceString)); // lower case - if (s == "run3_dummy") { + if (s == "none") { + ATH_MSG_INFO("Old style menu has been disabled"); + m_xmlFile = ""; + } else if (s == "run3_dummy") { ATH_MSG_WARNING("Configured to use Run-3 Dummy menu. This should never be seen in production"); } else if(s != "xml") { TrigDBConnectionConfig::DBType dbtype(TrigDBConnectionConfig::DBLookup); diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/ConfigSvcBase.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h similarity index 100% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/ConfigSvcBase.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx index b7e92c8c4f74bb914b466d6dd7590648099a256f..0b1d349a703890c08c9315b5f7dbe02cb684f64c 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: DSConfigSvc.cxx 742408 2016-04-23 18:55:57Z stelzer $ @@ -41,7 +41,7 @@ #include "TrigConfStorage/DBLoader.h" // Local include(s): -#include "TrigConfigSvc/DSConfigSvc.h" +#include "./DSConfigSvc.h" #include "boost/lexical_cast.hpp" diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/DSConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.h similarity index 96% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/DSConfigSvc.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.h index 4c5a0bc94655e44470babe07a720d223be06a5a8..567ba27572982d49392231d277b9157ace86c528 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/DSConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TrigConfig_DSConfigSvc @@ -11,7 +11,7 @@ #include "TrigConfHLTData/HLTFrame.h" #include "GaudiKernel/ServiceHandle.h" -#include "TrigConfigSvc/ConfigSvcBase.h" +#include "./ConfigSvcBase.h" #include "AthenaKernel/IIOVSvc.h" #include "StoreGate/StoreGateSvc.h" @@ -119,7 +119,7 @@ namespace TrigConf { uint32_t hltPrescaleKey() const { return m_hltPsKey; } // access to a description of the source of the configuration (TriggerDB/XMLfilename) - const std::string& configurationSource() const { + std::string configurationSource() const override { return m_configSrc; } diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx index 254d5aebbcb420251208242a4188a7e13c0bfe02..253df7789f4e29af6a70203cb07ba28218e23f85 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // class declaration -#include "TrigConfigSvc/HLTConfigSvc.h" +#include "./HLTConfigSvc.h" #include <exception> #include <vector> @@ -26,6 +26,7 @@ // Local includes: #include "TrigConfIO/JsonFileLoader.h" +#include "TrigConfIO/TrigDBMenuLoader.h" #include "TrigConfData/HLTMenu.h" #include "TrigConfBase/TrigDBConnectionConfig.h" #include "TrigConfStorage/StorageMgr.h" @@ -42,6 +43,10 @@ #include "TrigConfHLTData/HLTPrescaleSetCollection.h" #include "AthenaMonitoringKernel/OHLockedHist.h" +#include "TrigConfInterfaces/IJobOptionsSvc.h" + +#include "TrigConfInterfaces/IJobOptionsSvc.h" + #include "boost/algorithm/string/case_conv.hpp" #include "boost/lexical_cast.hpp" @@ -83,29 +88,51 @@ HLTConfigSvc::~HLTConfigSvc() StatusCode HLTConfigSvc::writeConfigToDetectorStore() { - // load the json file into TrigConf::HLTMenu - TrigConf::JsonFileLoader fileLoader; - fileLoader.setLevel(TrigConf::MSGTC::WARNING); - TrigConf::HLTMenu * hltmenu = new TrigConf::HLTMenu; - if( m_inputType == "file" ) { - if( fileLoader.loadFile( m_hltFileName, *hltmenu ).isSuccess() ) { - ATH_MSG_INFO( "Loaded HLT menu file " << m_hltFileName.value() ); - } else { - ATH_MSG_WARNING( "Failed loading HLT menu file " << m_hltFileName.value()); - return StatusCode::RECOVERABLE; - } - } + if( m_inputType == "db" ) { + + // db menu loader + TrigConf::TrigDBMenuLoader dbloader(m_dbConnection); + dbloader.setLevel(TrigConf::MSGTC::WARNING); + + if( dbloader.loadHLTMenu( m_smk, *hltmenu ) ) { + ATH_MSG_INFO( "Loaded HLT menu from DB " << m_dbConnection << " for SMK " << m_smk.value() ); + } else { + ATH_MSG_WARNING( "Failed loading HLT menu from DB for SMK " << m_smk.value()); + return StatusCode::RECOVERABLE; + } + + } else if ( m_inputType == "file" ) { + + // load the json file into TrigConf::HLTMenu + TrigConf::JsonFileLoader fileLoader; + fileLoader.setLevel(TrigConf::MSGTC::WARNING); - ServiceHandle<StoreGateSvc> detStore( "StoreGateSvc/DetectorStore", name() ); + if( fileLoader.loadFile( m_hltFileName, *hltmenu ).isSuccess() ) { + ATH_MSG_INFO( "Loaded HLT menu file " << m_hltFileName.value() ); + } else { + ATH_MSG_WARNING( "Failed loading HLT menu file " << m_hltFileName.value()); + return StatusCode::RECOVERABLE; + } + + } else if( m_inputType == "cool" ) { + ATH_MSG_FATAL( "Loading of HLT menu from COOL + DB not implemented"); + return StatusCode::FAILURE; + } - ATH_CHECK( detStore.retrieve() ); - if( detStore->record(hltmenu,"HLTTriggerMenu").isSuccess() ) { - ATH_MSG_INFO( "Recorded HLT menu with key 'HLTTriggerMenu' in the detector store" ); - } + // To the reviewers: I will need to leave this commented, as one has to understand why this solution does not work + // auto writeHandle = SG::makeHandle(m_hltMenuKey); + // ATH_MSG_INFO("Recording HLT menu with " << m_hltMenuKey); + // ATH_CHECK( writeHandle.record( std::unique_ptr<TrigConf::HLTMenu>(hltmenu) )); - return StatusCode::SUCCESS; + ServiceHandle<StoreGateSvc> detStore( "StoreGateSvc/DetectorStore", name() ); + ATH_CHECK( detStore.retrieve() ); + if( detStore->record(hltmenu,"HLTTriggerMenu").isSuccess() ) { + ATH_MSG_INFO( "Recorded HLT menu with key 'HLTTriggerMenu' in the detector store" ); + } + + return StatusCode::SUCCESS; } @@ -146,13 +173,30 @@ HLTConfigSvc::sequences() const { StatusCode HLTConfigSvc::initialize() { - ATH_CHECK(ConfigSvcBase::initialize()); + // ATH_CHECK( m_hltMenuKey.initialize() ); - StatusCode sc = writeConfigToDetectorStore(); - if( !sc.isSuccess() ) { - ATH_MSG_INFO( "This previous WARNING message is being ignored in the current transition phase. Once we rely entirely on the new menu providing mechanism, this will become a reason to abort."); + { + /// Handle to JobOptionsSvc used to retrieve the DataFlowConfig property + if( auto joSvc = serviceLocator()->service<TrigConf::IJobOptionsSvc>( "JobOptionsSvc" ) ) { + if( joSvc->superMasterKey()>0 ) { + m_inputType = "db"; + m_smk = joSvc->superMasterKey(); + m_dbConnection = joSvc->server(); + m_configSourceString = "RUN3_Dummy"; + } + } else { + ATH_MSG_INFO("Did not locate TrigConf::JobOptionsSvc, not running athenaHLT"); + } + + StatusCode sc = writeConfigToDetectorStore(); + if( !sc.isSuccess() ) { + ATH_MSG_INFO( "This previous WARNING message is being ignored in the current transition phase. Once we rely entirely on the new menu providing mechanism, this will become a reason to abort."); + } } + ATH_CHECK(ConfigSvcBase::initialize()); + + ////////////////////////////////////////////////////////////// // BEGIN RUN-3 TESTING BLOCK - THIS SHOULD BE TEMPORARY ////////////////////////////////////////////////////////////// @@ -293,7 +337,7 @@ HLTConfigSvc::initialize() { if(m_PartitionName.value() !="") { m_partition = m_PartitionName; } else { - ServiceHandle<IJobOptionsSvc> jobOptionsSvc("JobOptionsSvc", name()); + ServiceHandle<::IJobOptionsSvc> jobOptionsSvc("JobOptionsSvc", name()); if (jobOptionsSvc.retrieve().isFailure()) { ATH_MSG_WARNING("Cannot retrieve JobOptionsSvc"); } else { diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h similarity index 93% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTConfigSvc.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h index 6367b2ff84e03ffeba6bf3ce2f2620d522d12845..a52187d8cbdaf8181a76323384784c5a5afceefa 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.h @@ -1,10 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TrigConfigSvc_HLTConfigSvc #define TrigConfigSvc_HLTConfigSvc +#include "./ConfigSvcBase.h" + #include <string> #include <vector> @@ -12,9 +14,10 @@ #include "StoreGate/StoreGateSvc.h" #include "TrigConfInterfaces/IHLTConfigSvc.h" -#include "TrigConfigSvc/ConfigSvcBase.h" #include "TrigConfHLTData/HLTFrame.h" +#include "TrigConfData/HLTMenu.h" + class TH1F; class TH2I; class TrigTimer; @@ -72,6 +75,8 @@ namespace TrigConf { Gaudi::Property< std::string > m_dbConnection { this, "TriggerDB", "TRIGGERDB", "DB connection alias, needed if InputType is db" }; Gaudi::Property< unsigned int > m_smk { this, "SMK", 0, "DB smk, needed if InputType is db" }; + // SG::WriteHandleKey<TrigConf::HLTMenu> m_hltMenuKey{"DetectorStore+HLTTriggerMenu"}; + StatusCode assignPrescalesToChains(uint lumiblock ); StatusCode bookHistograms(); diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.cxx index 54a9d0fa9fde3c47b6ccdc59ad258b55f41df579..335d3ac97bdcab8d05fda3cdd391ca6fe7687357 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "TrigConfigSvc/L1TopoConfigSvc.h" +#include "./L1TopoConfigSvc.h" #include "L1TopoConfig/L1TopoMenu.h" #include "TrigConfStorage/IStorageMgr.h" diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/L1TopoConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.h similarity index 86% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/L1TopoConfigSvc.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.h index 07f04a1a763502267cc42fc5f146badf86dd08df..9910a14818ac85cc0839a077f09759385a0012b8 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/L1TopoConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/L1TopoConfigSvc.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGCONFIGSVC_L1TOPOCONFIGSVC #define TRIGCONFIGSVC_L1TOPOCONFIGSVC #include "TrigConfInterfaces/IL1TopoConfigSvc.h" -#include "TrigConfigSvc/ConfigSvcBase.h" +#include "./ConfigSvcBase.h" #include <memory> diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx index b97049274cdc1af2e9ac734511d96da8488c74a6..150cd1b6a512a8251628588ff3ff06250d612966 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx @@ -1,11 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ +#include "./LVL1ConfigSvc.h" +#include "./Verifyer.h" -// STL includes: -#include <exception> -#include <vector> // Athena/Gaudi includes: #include "PathResolver/PathResolver.h" @@ -16,11 +15,10 @@ #include "StoreGate/StoreGateSvc.h" -// Local includes: -#include "TrigConfigSvc/Verifyer.h" // Trigger database interface includes: #include "TrigConfIO/JsonFileLoader.h" +#include "TrigConfIO/TrigDBMenuLoader.h" #include "TrigConfData/L1Menu.h" #include "TrigConfL1Data/DeadTime.h" #include "TrigConfL1Data/CTPConfig.h" @@ -39,10 +37,13 @@ #include "TrigConfL1Data/JetThresholdValue.h" #include "TrigConfL1Data/L1DataDef.h" -#include "TrigConfigSvc/LVL1ConfigSvc.h" +#include "TrigConfInterfaces/IJobOptionsSvc.h" #include "boost/algorithm/string/case_conv.hpp" -#include "boost/lexical_cast.hpp" + +// STL includes: +#include <exception> +#include <vector> using namespace std; using namespace TrigConf; @@ -72,29 +73,50 @@ LVL1ConfigSvc::~LVL1ConfigSvc() StatusCode LVL1ConfigSvc::writeConfigToDetectorStore() { - // load the json file into TrigConf::L1Menu - TrigConf::JsonFileLoader fileLoader; - fileLoader.setLevel(TrigConf::MSGTC::WARNING); + TrigConf::L1Menu * l1menu = new TrigConf::L1Menu; + + if( m_inputType == "db" ) { + + // db menu loader + TrigConf::TrigDBMenuLoader dbloader(m_dbConnection); + dbloader.setLevel(TrigConf::MSGTC::WARNING); + + if( dbloader.loadL1Menu( m_smk, *l1menu ) ) { + ATH_MSG_INFO( "Loaded L1 menu from DB " << m_dbConnection << " for SMK " << m_smk.value() ); + } else { + ATH_MSG_WARNING( "Failed loading L1 menu from DB for SMK " << m_smk.value()); + return StatusCode::RECOVERABLE; + } + + } else if ( m_inputType == "file" ) { + + // json file menu loader + TrigConf::JsonFileLoader fileLoader; + fileLoader.setLevel(TrigConf::MSGTC::WARNING); - TrigConf::L1Menu * l1menu = new TrigConf::L1Menu; + if( fileLoader.loadFile( m_l1FileName, *l1menu ).isSuccess() ) { + ATH_MSG_INFO( "Loaded L1 menu file " << m_l1FileName.value() ); + } else { + ATH_MSG_WARNING( "Failed loading L1 menu file " << m_l1FileName.value()); + return StatusCode::RECOVERABLE; + } - if( m_inputType == "file" ) { - if( fileLoader.loadFile( m_l1FileName, *l1menu ).isSuccess() ) { - ATH_MSG_INFO( "Loaded L1 menu file " << m_l1FileName.value() ); - } else { - ATH_MSG_WARNING( "Failed loading L1 menu file " << m_l1FileName.value()); - return StatusCode::RECOVERABLE; - } - } + } else if( m_inputType == "cool" ) { + ATH_MSG_FATAL( "Loading of L1 menu from COOL + DB not implemented"); + return StatusCode::FAILURE; + } - ServiceHandle<StoreGateSvc> detStore( "StoreGateSvc/DetectorStore", name() ); + // auto writeHandle = SG::makeHandle(m_l1MenuKey); + // ATH_MSG_INFO("Recording L1 menu with " << m_l1MenuKey); + // ATH_CHECK( writeHandle.record( std::unique_ptr<TrigConf::L1Menu>(l1menu) )); - ATH_CHECK( detStore.retrieve() ); - if( detStore->record(l1menu,"L1TriggerMenu").isSuccess() ) { - ATH_MSG_INFO( "Recorded L1 menu with key 'L1TriggerMenu' in the detector store" ); - } + ServiceHandle<StoreGateSvc> detStore( "StoreGateSvc/DetectorStore", name() ); + ATH_CHECK( detStore.retrieve() ); + if( detStore->record(l1menu,"L1TriggerMenu").isSuccess() ) { + ATH_MSG_INFO( "Recorded L1 menu with key 'L1TriggerMenu' in the detector store" ); + } - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } @@ -102,12 +124,27 @@ LVL1ConfigSvc::writeConfigToDetectorStore() { StatusCode LVL1ConfigSvc::initialize() { - CHECK(ConfigSvcBase::initialize()); + /// Handle to JobOptionsSvc used to retrieve the DataFlowConfig property + + // ATH_CHECK( m_l1MenuKey.initialize() ); + + if( auto joSvc = serviceLocator()->service<TrigConf::IJobOptionsSvc>( "JobOptionsSvc" ) ) { + if( joSvc->superMasterKey()>0 ) { + m_inputType = "db"; + m_smk = joSvc->superMasterKey(); + m_dbConnection = joSvc->server(); + m_configSourceString = "NONE"; + } + } else { + ATH_MSG_INFO("Did not locate TrigConf::JobOptionsSvc, not running athenaHLT"); + } StatusCode sc = writeConfigToDetectorStore(); if( !sc.isSuccess() ) { ATH_MSG_INFO( "This previous WARNING message is being ignored in the current transition phase. Once we rely entirely on the new menu providing mechanism, this will become a reason to abort."); } + + CHECK(ConfigSvcBase::initialize()); // could be that this is needed when running from DB CHECK(setProperties()); @@ -122,7 +159,7 @@ LVL1ConfigSvc::initialize() { ATH_MSG_INFO(" DB BunchGroupSetKey = " << m_bunchgroupSetID); } - CHECK(initStorageMgr()); + CHECK( initStorageMgr() ); try { diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/LVL1ConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.h similarity index 90% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/LVL1ConfigSvc.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.h index 18ed5f3e7a5e85fdc0d7b075cc8c55420af3be28..a478154f3c7aea895ae9d45cd29940ea934f31fc 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/LVL1ConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TrigConfigSvc_LVL1ConfigSvc @@ -7,10 +7,12 @@ #include <string> -#include "TrigConfigSvc/ConfigSvcBase.h" +#include "./ConfigSvcBase.h" #include "TrigConfInterfaces/ILVL1ConfigSvc.h" +#include "TrigConfData/L1Menu.h" + class StoreGateSvc; namespace TrigConf { @@ -50,7 +52,11 @@ namespace TrigConf { Gaudi::Property< std::string > m_l1FileName { this, "JsonFileName", "L1Menu.json", "file name of L1 json file, needed if InputType is file" }; Gaudi::Property< std::string > m_dbConnection { this, "TriggerDB", "TRIGGERDB", "DB connection alias, needed if InputType is db" }; Gaudi::Property< unsigned int > m_smk { this, "SMK", 0, "DB smk, needed if InputType is db" }; - + + //SG::WriteHandleKey<TrigConf::L1Menu> m_l1MenuKey{"DetectorStore+L1TriggerMenu"}; + + + ::StoreGateSvc* m_detectorStore; // the configuration diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx index 5498fed429e469feb361e200d5fee3eac9df70c0..95a439e3d2167a0e337c018f2fc6bec737baea38 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx @@ -24,7 +24,7 @@ ** **************************************************************************/ -#include "TrigConfigSvc/TrigConfDataIOVChanger.h" +#include "./TrigConfDataIOVChanger.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfDataIOVChanger.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.h similarity index 100% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfDataIOVChanger.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.h diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.cxx index 07cb85c6b2ca8896296fb9dc54d566f48120a1f2..69393c1fe68765d02797961d605007a0e9c598e7 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.cxx @@ -9,6 +9,9 @@ #include "GaudiKernel/IProperty.h" #include "GaudiKernel/Property.h" +#include "TrigConfIO/TrigDBJobOptionsLoader.h" +#include "TrigConfData/DataStructure.h" + #include "TrigConfJobOptionsSvc.h" TrigConf::JobOptionsSvc::JobOptionsSvc(const std::string& name, ISvcLocator* pSvcLocator) : @@ -32,8 +35,7 @@ StatusCode TrigConf::JobOptionsSvc::initialize() else if (m_sourceType == "DB") { parseDBString(m_sourcePath); ATH_MSG_INFO("Reading SMK " << m_smk << " from '" << m_server << "'"); - ATH_MSG_FATAL("Reading from DB not implemented yet"); - return StatusCode::FAILURE; + ATH_CHECK(readOptionsDB(m_server, m_smk)); } else if (m_sourceType == "PYTHON") { /* "PYTHON" refers to loading properties directly from Python files @@ -98,6 +100,31 @@ StatusCode TrigConf::JobOptionsSvc::readOptions(const std::string& file, const s return StatusCode::SUCCESS; } +StatusCode TrigConf::JobOptionsSvc::readOptionsDB(const std::string& db_server, int smk) +{ + // db job options loader + TrigConf::TrigDBJobOptionsLoader jodbloader(db_server); + + TrigConf::DataStructure jo; + jodbloader.loadJobOptions( smk, jo ); + if (jo) { + unsigned int nClients(0), nProps(0); + for( const auto client : jo.getObject("properties").data()) { + nClients++; + for( const auto property : client.second ) { + nProps++; + ATH_CHECK(addPropertyToCatalogue(client.first, Gaudi::Property<std::string>(property.first, property.second.data()))); + } + } + ATH_MSG_INFO("Loaded job options from " << nClients << " clients with " << nProps << " in total"); + } else { + ATH_MSG_FATAL("Could not load job options from database " << db_server << " with SMK " << smk); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + + /** * This is mainly for debugging purposes and to compare the JobOptions * as seen by the JobOptionSvc to the ones extracted directly in Python. diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.h index 81130ca4020c76a8ce601b0a71d405fee29c2ed4..7efa1688bdbd6fea573a4bc0a398dc8d03fb8ca0 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfJobOptionsSvc.h @@ -73,6 +73,8 @@ namespace TrigConf { virtual std::vector<std::string> getClients() const override { return m_josvc->getClients(); } virtual StatusCode readOptions(const std::string& file, const std::string& path = "") override; + + StatusCode readOptionsDB(const std::string& db_server, int smk); ///@} /// @name TrigConf::IJobOptionsSvc interface diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.cxx index d7cc5c27f6e3d6b1abf0259cc6cda1b1e3ffccd2..9b01a28e6953df3a18b8932d481b3f2610216537 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.cxx @@ -1,13 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/ServiceHandle.h" #include "AthAnalysisBaseComps/AthAnalysisHelper.h" // for AAH::setProperty. Header only, not linked -#include "TrigConfigSvc/TrigConfigSvc.h" -#include "TrigConfigSvc/HLTConfigSvc.h" +#include "./TrigConfigSvc.h" +#include "./HLTConfigSvc.h" #include "TrigConfHLTData/HLTChainList.h" #include "TrigConfL1Data/BunchGroupSet.h" diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfigSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.h similarity index 94% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfigSvc.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.h index babc7e3d3c5e1ec401edac4a99a7375a157e78e0..4e6389045cf36f01f5cf8e6f78dd8702de2e3ba7 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////// @@ -63,7 +63,9 @@ namespace TrigConf { uint32_t masterKey() const ; uint32_t lvl1PrescaleKey() const ; uint32_t hltPrescaleKey() const ; - std::string configurationSource() const; + std::string configurationSource() const override { + return ""; + } StatusCode updatePrescaleSets(uint requestcount); diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfigSvcDict.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvcDict.h similarity index 100% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/TrigConfigSvcDict.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfigSvcDict.h diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.cxx index bf736d0f0610e28dc07dd6ed6ba8d8d6a37fb983..f2992f22e63d6d5ded2c4ca20cc69b674a105121 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -13,7 +13,7 @@ #include "TrigConfL1Data/TriggerThreshold.h" #include "TrigConfL1Data/L1DataDef.h" -#include "TrigConfigSvc/Verifyer.h" +#include "./Verifyer.h" using namespace std; diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/Verifyer.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.h similarity index 100% rename from Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/Verifyer.h rename to Trigger/TrigConfiguration/TrigConfigSvc/src/Verifyer.h diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx index 88e612693f801a683748725fd2f8808c9937e60f..5234bc2034c978028cbe94d5751ec66f990d9fb5 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/components/TrigConfigSvc_entries.cxx @@ -1,10 +1,10 @@ -#include "TrigConfigSvc/L1TopoConfigSvc.h" -#include "TrigConfigSvc/LVL1ConfigSvc.h" -#include "TrigConfigSvc/DSConfigSvc.h" -#include "TrigConfigSvc/HLTConfigSvc.h" +#include "../L1TopoConfigSvc.h" +#include "../LVL1ConfigSvc.h" +#include "../DSConfigSvc.h" +#include "../HLTConfigSvc.h" #include "../TrigConfJobOptionsSvc.h" -#include "TrigConfigSvc/TrigConfigSvc.h" -#include "TrigConfigSvc/TrigConfDataIOVChanger.h" +#include "../TrigConfigSvc.h" +#include "../TrigConfDataIOVChanger.h" DECLARE_COMPONENT( TrigConf::TrigConfDataIOVChanger ) DECLARE_COMPONENT( TrigConf::L1TopoConfigSvc ) diff --git a/Trigger/TrigConfiguration/TrigConfxAOD/src/xAODConfigSvc.h b/Trigger/TrigConfiguration/TrigConfxAOD/src/xAODConfigSvc.h index 987cfe9476a17d0e7938ebf3895bd84a1627e68f..59b11a76f9e3a283ac4d35cdae1ca378020911a2 100644 --- a/Trigger/TrigConfiguration/TrigConfxAOD/src/xAODConfigSvc.h +++ b/Trigger/TrigConfiguration/TrigConfxAOD/src/xAODConfigSvc.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // $Id: xAODConfigSvc.h 631651 2014-11-27 18:33:16Z lheinric $ @@ -134,6 +134,10 @@ namespace TrigConf { /// Function handling the incoming incidents virtual void handle( const Incident& inc ); + std::string configurationSource() const override { + return ""; + } + private: /// Function reading in a new metadata object from the input StatusCode readMetadata(); diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt index 902000fd447b6eb8430b53aaa8adbebe9e07b493..c8612b38fb14b7463ec91c1703808c4bb5e87fc2 100644 --- a/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt +++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/CMakeLists.txt @@ -13,7 +13,6 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel LumiBlock/LumiCalc Trigger/TrigAnalysis/TrigDecisionTool - Trigger/TrigConfiguration/TrigConfigSvc Trigger/TrigEvent/TrigSteeringEvent PRIVATE Control/AthenaKernel @@ -31,7 +30,7 @@ atlas_add_library( TrigHLTMonitoringLib src/*.cxx PUBLIC_HEADERS TrigHLTMonitoring PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES xAODLuminosity GaudiKernel TrigSteeringEvent AthenaMonitoringLib StoreGateLib SGtests LumiBlockCoolQuery TrigDecisionToolLib TrigConfigSvcLib + LINK_LIBRARIES xAODLuminosity GaudiKernel TrigSteeringEvent AthenaMonitoringLib StoreGateLib SGtests LumiBlockCoolQuery TrigDecisionToolLib PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel EventInfo xAODTrigger ) atlas_add_component( TrigHLTMonitoring diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/TrigHLTMonitoring/IHLTMonTool.h b/Trigger/TrigMonitoring/TrigHLTMonitoring/TrigHLTMonitoring/IHLTMonTool.h index d871a65e035c5969c3001711017bda9b688d8b53..70138bcd3c871c248662554ea77a592c8f5cdeab 100755 --- a/Trigger/TrigMonitoring/TrigHLTMonitoring/TrigHLTMonitoring/IHLTMonTool.h +++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/TrigHLTMonitoring/IHLTMonTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef IHLTMONTOOL_H @@ -12,7 +12,7 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "StoreGate/StoreGateSvc.h" #include "TrigDecisionTool/TrigDecisionTool.h" -#include "TrigConfigSvc/TrigConfigSvc.h" +#include "TrigConfInterfaces/ITrigConfigSvc.h" #include "GaudiKernel/ServiceHandle.h" #include "TrigConfInterfaces/ITrigConfigTool.h" diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.cxx index 3ddb431d1246f987daa2ca0d0c9b29a8189f8e1a..bf6e066d124b149a57198d61690b9ecf1eece6e7 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.cxx @@ -3,8 +3,6 @@ */ #include "StreamTagMakerTool.h" -#include "TrigConfIO/JsonFileLoader.h" -#include "TrigConfData/DataStructure.h" #include "TrigConfData/HLTMenu.h" #include "TrigConfData/HLTChain.h" #include "eformat/StreamTag.h" @@ -14,7 +12,8 @@ using namespace TrigCompositeUtils; // ============================================================================= StreamTagMakerTool::StreamTagMakerTool( const std::string& type, const std::string& name, const IInterface* parent ): - base_class( type, name, parent ) {} + base_class( type, name, parent ) +{} // ============================================================================= @@ -27,13 +26,16 @@ StatusCode StreamTagMakerTool::initialize() { ATH_CHECK( m_pebDecisionKeys.initialize() ); ATH_CHECK( m_finalChainDecisions.initialize() ); - TrigConf::JsonFileLoader fileLoader; - TrigConf::HLTMenu hltMenu; - ATH_CHECK( fileLoader.loadFile(m_menuJSON, hltMenu) ); + ATH_CHECK( m_hltMenuKey.initialize() ); - ATH_MSG_INFO("Configuring from " << m_menuJSON << " with " << hltMenu.size() << " chains"); + auto hltMenu = SG::makeHandle( m_hltMenuKey ); + if( ! hltMenu.isValid() ) { + ATH_MSG_FATAL("Failed to get the HLT menu from the DetectorStore"); + return StatusCode::FAILURE; + } - for (const TrigConf::Chain & chain : hltMenu) { + ATH_MSG_INFO("Configuring from HLTMenu from DetStore with " << hltMenu->size() << " chains"); + for (const TrigConf::Chain & chain : *hltMenu) { std::vector<TrigConf::DataStructure> streams = chain.streams(); if (streams.empty()) { ATH_MSG_ERROR("Chain " << chain.name() << " has no streams assigned"); @@ -62,7 +64,6 @@ StatusCode StreamTagMakerTool::initialize() { } } } - return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.h b/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.h index dc38a3c8a782e88b4908be93c52d3f143f74fbac..a652a67ecc427e1b3f1256b108d906c8130040de 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.h +++ b/Trigger/TrigSteer/TrigOutputHandling/src/StreamTagMakerTool.h @@ -5,6 +5,7 @@ #define TRIGOUTPUTHANDLING_STREAMTAGMAKERTOOL_H // Trigger includes +#include "TrigConfData/HLTMenu.h" #include "DecisionHandling/TrigCompositeUtils.h" #include "TrigOutputHandling/HLTResultMTMakerTool.h" #include "TrigPartialEventBuilding/PEBInfoWriterToolBase.h" // Defines PEBInfo and keys to retrieve it @@ -33,12 +34,16 @@ public: virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override; virtual StatusCode initialize() override; + virtual StatusCode finalize() override; /// Type describing StreamTag information needed by the tool: {name, type, obeysLumiBlock, forceFullEventBuilding} typedef std::tuple<std::string, std::string, bool, bool> StreamTagInfo; private: + + SG::ReadHandleKey<TrigConf::HLTMenu> m_hltMenuKey{"DetectorStore+HLTTriggerMenu"}; + SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> m_finalChainDecisions {this, "ChainDecisions", "HLTNav_Summary", "Container with final chain decisions" }; diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py index e38771ff79248aec925a734840b75f0a0edcc02e..1e0c6cdc411d9eb5299c0eacb9d2fb1ee5d2175a 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_cf.py @@ -10,6 +10,9 @@ from RecExConfig.RecFlags import rec rec.doESD=True rec.doWriteESD=True +from TriggerJobOpts.TriggerFlags import TriggerFlags +TriggerFlags.triggerMenuSetup = "LS2_v1" + include("TrigUpgradeTest/testHLT_MT.py") ########################################## diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py index 6f607b912675fd065867be944e328288e7e74f4d..ebb55c8c87efbbe57f4191cb2a32bffe70aea32b 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py @@ -8,8 +8,6 @@ from AthenaCommon.CFElements import parOR, seqOR, seqAND, stepSeq, findAlgorithm from AthenaCommon.AlgSequence import dumpMasterSequence from AthenaCommon.AppMgr import theApp - - from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 @@ -28,18 +26,16 @@ flags.Trigger.CostMonitoring.doCostMonitoring = True import importlib -setupMenuPath = "TriggerMenuMT.HLTMenuConfig.Menu."+flags.Trigger.triggerMenuSetup +setupMenuPath = "TriggerMenuMT.HLTMenuConfig.Menu."+flags.Trigger.triggerMenuSetup+"_newJO" setupMenuModule = importlib.import_module( setupMenuPath ) assert setupMenuModule != None, "Could not import module {}".format(setupMenuPath) assert setupMenuModule.setupMenu != None, "Could not import setupMenu from {}".format(setupMenuPath) flags.needFlagsCategory('Trigger') setupMenuModule.setupMenu(flags) - flags.Input.isMC = False flags.Input.Files= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"] -flags.Trigger.LVL1ConfigFile = "LVL1config_Physics_pp_v7.xml" flags.Trigger.L1Decoder.forceEnableAllChains = True @@ -55,10 +51,9 @@ acc.merge(TrigBSReadCfg(flags )) from TrigUpgradeTest.TriggerHistSvcConfig import TriggerHistSvcConfig acc.merge(TriggerHistSvcConfig(flags )) - -from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu +from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu as generateHLTMenu from TriggerJobOpts.TriggerConfig import triggerRunCfg -acc.merge( triggerRunCfg( flags, generateMenu ) ) +acc.merge( triggerRunCfg( flags, menu=generateHLTMenu ) ) from RegionSelector.RegSelConfig import regSelCfg acc.merge( regSelCfg( flags ) ) diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py index 220560676def06e2bcc0afa7e5eb7ae217d93c8e..5f6a5ee62116ce590402c7d8e0a5f8ae7946aa6f 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py @@ -1,3 +1,4 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration ################################################################################ # TrigUpgradeTest/testHLT_MT.py # @@ -365,28 +366,27 @@ elif globalflags.InputFormat.is_bytestream(): # --------------------------------------------------------------- # Trigger config # --------------------------------------------------------------- -TriggerFlags.inputLVL1configFile = opt.setLVL1XML TriggerFlags.readLVL1configFromXML = True TriggerFlags.outputLVL1configFile = None -from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, HLTConfigSvc, findFileInXMLPATH -svcMgr += LVL1ConfigSvc() -svcMgr.LVL1ConfigSvc.XMLMenuFile = findFileInXMLPATH(TriggerFlags.inputLVL1configFile()) -svcMgr.LVL1ConfigSvc.InputType = "file" -l1JsonFile = TriggerFlags.inputLVL1configFile().replace(".xml",".json") -l1JsonFile = findFileInXMLPATH(l1JsonFile) -svcMgr.LVL1ConfigSvc.JsonFileName = l1JsonFile -log.info("Configured LVL1ConfigSvc with InputType='file' and JsonFileName=%s" % l1JsonFile) -svcMgr += HLTConfigSvc() -hltJsonFile = TriggerFlags.inputHLTconfigFile().replace(".xml",".json").replace("HLTconfig","HLTmenu") -hltJsonFile = findFileInXMLPATH(hltJsonFile) -svcMgr.HLTConfigSvc.JsonFileName = hltJsonFile -log.info("Configured HLTConfigSvc with InputType='file' and JsonFileName=%s" % hltJsonFile) +from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu +l1JsonFile = generateL1Menu() +from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc, getHLTConfigSvc +svcMgr += getL1ConfigSvc() +svcMgr += getHLTConfigSvc() + +# --------------------------------------------------------------- +# Level 1 simulation +# --------------------------------------------------------------- if opt.doL1Sim: from TriggerJobOpts.Lvl1SimulationConfig import Lvl1SimulationSequence topSequence += Lvl1SimulationSequence() + +# --------------------------------------------------------------- +# HLT prep: RoIBResult and L1Decoder +# --------------------------------------------------------------- if opt.doL1Unpacking: if globalflags.InputFormat.is_bytestream(): from TrigT1ResultByteStream.TrigT1ResultByteStreamConf import RoIBResultByteStreamDecoderAlg diff --git a/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt b/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt index db9b326dafec91e5cc57be1992f50a28f93a9b99..512f791ba31c6e12b2021818cfde870807ae7add 100644 --- a/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigValAlgs/CMakeLists.txt @@ -49,7 +49,6 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkEvent/VxSecVertex Trigger/TrigEvent/TrigNavStructure Trigger/TrigConfiguration/TrigConfHLTData - Trigger/TrigConfiguration/TrigConfigSvc Trigger/TrigEvent/TrigDecisionEvent Trigger/TrigEvent/TrigMissingEtEvent Trigger/TrigSteer/DecisionHandling @@ -65,7 +64,7 @@ atlas_add_component( TrigValAlgs src/*.cxx src/components/*.cxx INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthAnalysisBaseCompsLib GaudiKernel TrigDecisionToolLib TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigNavToolsLib TrigNavigationLib TrigParticle TrigSteeringEvent AthenaKernel CxxUtils EventInfo xAODEventInfo xAODBTagging xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigBphys xAODTrigCalo xAODTrigEgamma xAODTrigMinBias xAODTrigMissingET xAODTrigMuon xAODCore xAODTrigger AnalysisTriggerEvent MuonCombinedToolInterfaces Particle tauEvent VxSecVertex TrigConfigSvcLib TrigConfHLTData TrigRoiConversionLib TrigDecisionEvent TrigMissingEtEvent TrigInDetTruthEvent TrigT1Interfaces DecisionHandlingLib AthViews ) + LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthAnalysisBaseCompsLib GaudiKernel TrigDecisionToolLib TrigCaloEvent TrigInDetEvent TrigMuonEvent TrigNavToolsLib TrigNavigationLib TrigParticle TrigSteeringEvent AthenaKernel CxxUtils EventInfo xAODEventInfo xAODBTagging xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigBphys xAODTrigCalo xAODTrigEgamma xAODTrigMinBias xAODTrigMissingET xAODTrigMuon xAODCore xAODTrigger AnalysisTriggerEvent MuonCombinedToolInterfaces Particle tauEvent VxSecVertex TrigConfHLTData TrigRoiConversionLib TrigDecisionEvent TrigMissingEtEvent TrigInDetTruthEvent TrigT1Interfaces DecisionHandlingLib AthViews ) # Install files from the package: atlas_install_headers( TrigValAlgs ) diff --git a/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigCountDumper.h b/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigCountDumper.h index 851db7f76437467590f668956a6e32d4e4d9aaa4..4b51218f11c22af9760169679d57cb7cdead76ef 100644 --- a/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigCountDumper.h +++ b/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigCountDumper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -245,8 +245,6 @@ class TrigCountDumper : public AthAlgorithm { ToolHandle<Trig::TrigDecisionTool> m_trigDec; /// The trigger configuration service to get the information from ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc; - /// Handle used (sometimes) when reading MC files - ServiceHandle< TrigConf::ITrigConfigSvc > m_dsSvc; /// Type definition for the menu map typedef std::map<uint32_t,trigcount::TriggerMenu> MenuMap_t; /// Map of super master keys to trigger menus diff --git a/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigDecisionChecker.h b/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigDecisionChecker.h index 7f0a733c515581ee9268747380fcfceb591fba07..e25455aadcd4cecb54ef20a2d7272c7fd0256aa6 100755 --- a/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigDecisionChecker.h +++ b/Trigger/TrigValidation/TrigValAlgs/TrigValAlgs/TrigDecisionChecker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -119,8 +119,6 @@ class TrigDecisionChecker : public AthAlgorithm ToolHandle<Trig::TrigDecisionTool> m_trigDec; //!< interface to use the trigger data: TriggerTool /// The trigger configuration service to get the information from ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc; - /// Handle used (sometimes) when reading MC files - ServiceHandle< TrigConf::ITrigConfigSvc > m_dsSvc; /// Muon triggers to test output for std::vector<std::string> m_muonItems; diff --git a/Trigger/TrigValidation/TrigValAlgs/src/TrigCountDumper.cxx b/Trigger/TrigValidation/TrigValAlgs/src/TrigCountDumper.cxx index 210a38505ac91e97645b1338e83a09bd85c67dde..6aee8ac8ac564cf276e1624a5705977b5306085a 100644 --- a/Trigger/TrigValidation/TrigValAlgs/src/TrigCountDumper.cxx +++ b/Trigger/TrigValidation/TrigValAlgs/src/TrigCountDumper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* @@ -31,9 +31,6 @@ #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" #include "TrigValAlgs/TrigCountDumper.h" - -#include "TrigConfigSvc/DSConfigSvc.h" - #include "TrigSteeringEvent/Lvl1Item.h" using namespace xercesc; @@ -170,8 +167,7 @@ namespace trigcount { TrigCountDumper::TrigCountDumper(const std::string &name, ISvcLocator *pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), - m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name), - m_dsSvc( "TrigConf::DSConfigSvc/DSConfigSvc", name) { + m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name) { declareProperty("OutputFile",m_ofname="trigger_counts.xml","Name of the output file"); declareProperty("Release",m_release="","Release version"); declareProperty("Dataset",m_dataset="","Dataset name"); @@ -292,21 +288,7 @@ StatusCode TrigCountDumper::execute(void) { // use something else as the SMK. (Needed mostly for MC test jobs.) if(((smk==0) && (l1psk==0) && (hltpsk==0)) || (static_cast<int>(smk) < 0 ) || (static_cast<int>(l1psk) < 0 ) || (static_cast<int>(hltpsk) < 0 ) ) { - // See if we are reading an AOD: - if(!m_dsSvc) { - ATH_MSG_FATAL("The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."); - return StatusCode::FAILURE; - } - TrigConf::DSConfigSvc *dsSvc=dynamic_cast<TrigConf::DSConfigSvc *>(m_dsSvc.operator->()); - if(!dsSvc) { - ATH_MSG_FATAL("The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."); - return StatusCode::FAILURE; - } - // Turn the configuration source name (probably an XML file in this case) into an - // imaginary Super Master Key: - smk = CxxUtils::crc64(dsSvc->configurationSource()) & 0xffff; + smk = CxxUtils::crc64(m_configSvc->configurationSource()) & 0xffff; l1psk = 0; hltpsk = 0; } diff --git a/Trigger/TrigValidation/TrigValAlgs/src/TrigDecisionChecker.cxx b/Trigger/TrigValidation/TrigValAlgs/src/TrigDecisionChecker.cxx index 9a52ad315dd92b4f49a581953d551af24754bac3..c3c6200fe2e6bd05e17b722a017a36dac27510a5 100755 --- a/Trigger/TrigValidation/TrigValAlgs/src/TrigDecisionChecker.cxx +++ b/Trigger/TrigValidation/TrigValAlgs/src/TrigDecisionChecker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** R.Goncalo - 21/10/2007 - add tests for TrigDecisionTool: @@ -53,7 +53,6 @@ #include "VxSecVertex/VxSecVertexInfo.h" #include "VxSecVertex/VxSecVKalVertexInfo.h" -#include "TrigConfigSvc/DSConfigSvc.h" #include "TrigConfHLTData/HLTTriggerElement.h" #include "CxxUtils/crc64.h" @@ -85,7 +84,6 @@ TrigDecisionChecker::TrigDecisionChecker(const std::string &name, ISvcLocator *p m_mu_sum(0.0), m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ), - m_dsSvc( "TrigConf::DSConfigSvc/DSConfigSvc", name ), m_muonPrinter("Rec::MuonPrintingTool/MuonPrintingTool") { @@ -307,25 +305,8 @@ StatusCode TrigDecisionChecker::execute() ( static_cast< int >( m_smk ) < 0 ) || ( static_cast< int >( m_l1psk ) < 0 ) || ( static_cast< int >( m_hltpsk ) < 0 ) ) { - - // See if we are reading an AOD: - if( ! m_dsSvc ) { - msg() << MSG::FATAL - << "The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."; - return StatusCode::FAILURE; - } - TrigConf::DSConfigSvc* dsSvc = dynamic_cast< TrigConf::DSConfigSvc* >( m_dsSvc.operator->() ); - if( ! dsSvc ) { - msg() << MSG::FATAL - << "The trigger configuration keys don't seem to make sense, and we're not using " - << "TrigConf::DSConfigSvc..."; - return StatusCode::FAILURE; - } - - // Turn the configuration source name (probably an XML file in this case) into an - // imaginary Super Master Key: - m_smk = CxxUtils::crc64( dsSvc->configurationSource() ) & 0xffff; + + m_smk = CxxUtils::crc64( m_configSvc->configurationSource() ) & 0xffff; m_l1psk = 0; m_hltpsk = 0; } diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py index ee30381aa7dca849326594f2b2cf666f8bf29594..632852017f8dcefa3302e4c370bf4db163ee5733 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py @@ -25,19 +25,9 @@ def Lvl1SimulationSequence( flags = None ): # this configuration of the LVL1ConfigSvc is only temporary TriggerFlags.readLVL1configFromXML = True TriggerFlags.outputLVL1configFile = None - from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, findFileInXMLPATH - svcMgr += LVL1ConfigSvc() - svcMgr.LVL1ConfigSvc.XMLMenuFile = findFileInXMLPATH(TriggerFlags.inputLVL1configFile()) - svcMgr.LVL1ConfigSvc.InputType = "file" - l1JsonFile = TriggerFlags.inputLVL1configFile().replace(".xml",".json") - svcMgr.LVL1ConfigSvc.JsonFileName = l1JsonFile - log.info("Configured LVL1ConfigSvc with InputType='file' and JsonFileName=%s", l1JsonFile) - - # L1 menu provider Run 3 - from TrigConfIO.TrigConfCondSetup import setupMenuProvider - setupMenuProvider() - - + log.info("setting up LVL1ConfigSvc, including the menu generation") + from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc + svcMgr += getL1ConfigSvc() from TrigT1CaloSim.TrigT1CaloSimRun2Config import Run2TriggerTowerMaker caloTowerMaker = Run2TriggerTowerMaker("Run2TriggerTowerMaker25ns") @@ -163,7 +153,7 @@ def Lvl1SimulationSequence( flags = None ): ctp.DoLUCID = False ctp.DoBCM = False ctp.DoL1Topo = False - ctp.UseCondL1Menu = True + ctp.UseCondL1Menu = False ctp.TrigConfigSvc = svcMgr.LVL1ConfigSvc ctpSim = seqAND("ctpSim", [ctp, RoIBuilder("RoIBuilder")]) diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index fdafff20e77927b508130c94dba5a89c5023ef39..1faa4ed918b0982ef9637b6a57d8b3dc3e24f39c 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -343,12 +343,13 @@ def triggerRunCfg( flags, menu=None ): top of the trigger config (for real triggering online or on MC) Returns: ca only """ - if flags.Trigger.doLVL1: - # conigure L1 simulation - pass - acc = ComponentAccumulator() + if flags.Trigger.doLVL1: + from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu, L1ConfigSvcCfg + generateL1Menu( flags ) + acc.merge( L1ConfigSvcCfg(flags) ) + acc.merge( triggerIDCCacheCreatorsCfg( flags ) ) from L1Decoder.L1DecoderConfig import L1DecoderCfg diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py index f7ec638e4c9e7c615ec78c8ee9c076fc0c7017cc..dcc04bfefec107fb29628972f4259b0a12eedaab 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py @@ -87,7 +87,7 @@ def createTriggerFlags(): flags.addFlag('Trigger.triggerConfig', 'MCRECO:DEFAULT') # name of the trigger menu - flags.addFlag('Trigger.triggerMenuSetup', 'LS2_v1_newJO') + flags.addFlag('Trigger.triggerMenuSetup', 'LS2_v1') # version of the menu from AthenaCommon.AppMgr import release_metadata @@ -95,21 +95,22 @@ def createTriggerFlags(): lambda prevFlags: release_metadata()['release'] ) # generate or not the HLT configuration - flags.addFlag('Trigger.generateHLTConfig', False) + flags.addFlag('Trigger.generateHLTMenu', False) # HLT XML file name - flags.addFlag('Trigger.HLTConfigFile', - lambda prevFlags: 'HLTconfig_'+prevFlags.Trigger.triggerMenuSetup+'_' + prevFlags.Trigger.menuVersion + '.xml') + flags.addFlag('Trigger.HLTMenuFile', + lambda prevFlags: 'HLTMenu_'+prevFlags.Trigger.triggerMenuSetup+'_' + prevFlags.Trigger.menuVersion + '.xml') # generate or not the L1 configuration - flags.addFlag('Trigger.generateLVL1Config', False) + flags.addFlag('Trigger.generateL1Menu', False) # L1 XML file name flags.addFlag('Trigger.LVL1ConfigFile', - lambda prevFlags: 'LVL1config_'+prevFlags.Trigger.triggerMenuSetup+'_' + prevFlags.Trigger.menuVersion + '.xml') + lambda prevFlags: 'LVL1config_'+prevFlags.Trigger.triggerMenuSetup+'_' + prevFlags.Trigger.menuVersion + '.xml') - # generate or not the L1 topo configuration - flags.addFlag('Trigger.generateLVL1TopoConfig', False) + # L1 Json file name + flags.addFlag('Trigger.L1MenuFile', + lambda prevFlags: 'L1Menu_'+prevFlags.Trigger.triggerMenuSetup+'_' + prevFlags.Trigger.menuVersion + '.json') # L1 topo XML file name def _deriveTopoConfigName(prevFlags): diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py index c966b294b9f2299e8efb6d019a476391bd67979a..c8faab0188ac762afc5c0109c4fa4d419ae81a2d 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py @@ -894,7 +894,7 @@ class outputHLTmenuJsonFile(JobProperty): def __call__(self): if self.get_Value() == "": - return "HLTmenu_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".json" + return "HLTMenu_"+TriggerFlags.triggerMenuSetup()+"_" + TriggerFlags.menuVersion() + ".json" else: return self.get_Value() diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py index d988edece8498ba1d6e87e70da47bacb336619ca..c15f0aa3703ec5d0140251dbfaa954eb457905ab 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py @@ -1,14 +1,17 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration import json +from collections import OrderedDict as odict +from TrigConfigSvc.TrigConfigSvcCfg import getHLTMenuFileName + from AthenaCommon.Logging import logging __log = logging.getLogger( 'HLTMenuJSON.py' ) -def __generateJSON( chainDicts, chainConfigs, menuName ): +def __generateJSON( chainDicts, chainConfigs, menuName, fileName ): """ Generates JSON given the ChainProps and sequences """ - menuDict = {"name": menuName, "chains": []} + menuDict = odict([("filetype", "hltmenu"), ("name", menuName), ("chains", [])]) from TriggerMenuMT.HLTMenuConfig.Menu import StreamInfo for chain in chainDicts: @@ -43,25 +46,23 @@ def __generateJSON( chainDicts, chainConfigs, menuName ): - chainDict = { "counter": chain["chainCounter"], - "name": chain["chainName"], - "nameHash": chain["chainNameHash"], - "l1item": chain["L1item"], - "l1thresholds": l1Thresholds, - "groups": chain["groups"], - "streams": streamDicts, - # "sequences": sequences - } + chainDict = odict([ + ("counter", chain["chainCounter"]), + ("name", chain["chainName"]), + ("nameHash", chain["chainNameHash"]), + ("l1item", chain["L1item"]), + ("l1thresholds", l1Thresholds), + ("groups", chain["groups"]), + ("streams", streamDicts), + #("sequences", sequences) + ]) menuDict["chains"].append( chainDict ) - from AthenaCommon.AppMgr import release_metadata - fileName = "HLTmenu_%s_%s.json" % (menuName, release_metadata()['release']) - __log.info( "Writing trigger menu to %s", fileName ) with open( fileName, 'w' ) as fp: - json.dump( menuDict, fp, indent=4, sort_keys=True ) + json.dump( menuDict, fp, indent=4, sort_keys=False ) def generateJSON(): __log.info("Generating HLT JSON config in the rec-ex-common job") @@ -69,10 +70,10 @@ def generateJSON(): from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT - return __generateJSON( TriggerConfigHLT.dictsList(), TriggerConfigHLT.configsList(), TriggerFlags.triggerMenuSetup() ) + return __generateJSON( TriggerConfigHLT.dictsList(), TriggerConfigHLT.configsList(), TriggerFlags.triggerMenuSetup(), getHLTMenuFileName() ) def generateJSON_newJO( chainDicts, chainConfigs ): __log.info("Generating HLT JSON config in the new JO") from AthenaConfiguration.AllConfigFlags import ConfigFlags - - return __generateJSON( chainDicts, chainConfigs, ConfigFlags.Trigger.triggerMenuSetup ) + + return __generateJSON( chainDicts, chainConfigs, ConfigFlags.Trigger.triggerMenuSetup, getHLTMenuFileName( ConfigFlags) ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu2JSON.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu2JSON.py index b0a710863b334ffff4816759f322c0d968193aad..319777d539fc5592243487e196a0c1cfe8d82fcf 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu2JSON.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu2JSON.py @@ -32,6 +32,8 @@ class L1MenuJSONConverter(object): from collections import OrderedDict as odict confObj = odict() + confObj["filetype"] = "l1menu" + confObj["name"] = self.menu.menuName # items diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py index d253cfd519035cf2589d99897bda24aefd779c80..c5f7396a2368541e618d54c1def560d7ba858ffe 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py @@ -35,6 +35,14 @@ class ItemDef: def registerItems(tc): """Register L1 items for further use""" + # define local flag for menu version + isV6 = '_v6' in TriggerFlags.triggerMenuSetup() + isV7 = '_v7' in TriggerFlags.triggerMenuSetup() + isV8 = '_v8' in TriggerFlags.triggerMenuSetup() or 'LS2_v1'==TriggerFlags.triggerMenuSetup() + isHI = '_HI' in TriggerFlags.triggerMenuSetup() + isHIV5 = 'HI_v5' in TriggerFlags.triggerMenuSetup() + isPhaseII = '_PhaseII' in TriggerFlags.triggerMenuSetup() + # ... and make them accessible by their name for thr in tc.getDefinedThresholds(): exec("%s = ThrCondition(thr)" % thr.getVarName()) @@ -86,15 +94,15 @@ class ItemDef: MenuItem('L1_EM10' ).setLogic( EM10 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM24VHI' ).setLogic( EM24VHI & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM8' ).setLogic( EM8 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_EM8I' ).setLogic( EM8I & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM12' ).setLogic( EM12 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM14' ).setLogic( EM14 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15' ).setLogic( EM15 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15_BGRP7').setLogic( EM15 & bgrp7cond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_EM15I' ).setLogic( EM15 & EM8I & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_eEM3' ).setLogic( eEM3 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_eEM8' ).setLogic( eEM8 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_eEM10' ).setLogic( eEM10 & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -116,11 +124,11 @@ class ItemDef: MenuItem('L1_EM10VH' ).setLogic( EM10VH & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM20A' ).setLogic( EM20A & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM20C' ).setLogic( EM20C & physcond).setTriggerType( TT.calo ) # noqa: F821 - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: MenuItem('L1_EM13VH' ).setLogic( EM13VH & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VH' ).setLogic( EM15VH & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM18' ).setLogic( EM18 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_EM18VHI' ).setLogic( EM18VHI & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM20' ).setLogic( EM20 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM20VH' ).setLogic( EM20VH & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -142,9 +150,9 @@ class ItemDef: MenuItem('L1_2eEM20VH' ).setLogic( eEM20VH.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2eEM8' ).setLogic( eEM8.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2eEM10' ).setLogic( eEM10.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_2EM8I').setLogic( EM8I.x(2) & physcond).setTriggerType(TT.calo) # noqa: F821 - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: MenuItem('L1_2EM13VH' ).setLogic( EM13VH.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2EM18VH' ).setLogic( EM18VH.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2EM12' ).setLogic( EM12.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -152,7 +160,7 @@ class ItemDef: MenuItem('L1_2EM16' ).setLogic( EM16.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2EM22' ).setLogic( EM22.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2EM15VH' ).setLogic( EM15VH.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_2EM15VHI' ).setLogic( EM15VHI.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_2EM20VH' ).setLogic( EM20VH.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM7_2EM3' ).setLogic( EM7 & EM3.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -163,9 +171,9 @@ class ItemDef: MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( EM20VH & EM10VH.x(2) & EM8VH.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 #ATR-19302 - if '_v8' in TriggerFlags.triggerMenuSetup(): - MenuItem('L1_EM10VHI' ).setLogic( EM10VHI & physcond).setTriggerType( TT.calo ) # noqa: F821 - MenuItem('L1_2EM10VHI' ).setLogic( EM10VHI.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 + if isV8: + MenuItem('L1_EM10VHI') .setLogic( EM10VHI & physcond).setTriggerType( TT.calo ) # noqa: F821 + MenuItem('L1_2EM10VHI').setLogic( EM10VHI.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 # 4xEM MenuItem('L1_EM15VH_3EM7' ).setLogic( EM15VH & EM7.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -173,7 +181,7 @@ class ItemDef: MenuItem('L1_EM15VH_3EM10VH' ).setLogic( EM15VH & EM10VH.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VH_2EM10VH_3EM7' ).setLogic( EM15VH & EM10VH.x(2) & EM7.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_eEM20VH_3eEM10VH' ).setLogic( eEM20VH & eEM10VH.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: MenuItem('L1_EM18VH_3EM8VH' ).setLogic( EM18VH & EM8VH.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM18VH_2EM10VH_3EM7' ).setLogic( EM18VH & EM10VH.x(2) & EM7.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -216,7 +224,7 @@ class ItemDef: MenuItem('L1_2EM3_VTE70').setLogic( EM3.x(2) & Not(TE70) & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_2EM3_VTE50').setLogic( EM3.x(2) & Not(TE50) & physcond).setTriggerType(TT.calo) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_2EM8I_J50').setLogic( EM8I.x(2) & J50 & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_2EM8I_J75').setLogic( EM8I.x(2) & J75 & physcond).setTriggerType(TT.calo) # noqa: F821 @@ -333,7 +341,7 @@ class ItemDef: MenuItem('L1_MU4_TE120' ).setLogic( MU4 & TE120 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_MU4_TE160' ).setLogic( MU4 & TE160 & physcond).setTriggerType(TT.muon) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_MU4_TE10.24ETA49' ).setLogic( MU4 & TE1024ETA49 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_MU4_TE15.24ETA49' ).setLogic( MU4 & TE1524ETA49 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_MU4_TE20.24ETA49' ).setLogic( MU4 & TE2024ETA49 & physcond).setTriggerType(TT.muon) # noqa: F821 @@ -399,7 +407,7 @@ class ItemDef: MenuItem('L1_EM7_MU11' ).setLogic( EM7 & MU11 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_EM8_MU10' ).setLogic( EM8 & MU10 & physcond).setTriggerType(TT.muon) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_EM8I_MU10' ).setLogic( EM8I & MU10 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_EM15I_MU4' ).setLogic( EM15 & EM8I & MU4 & physcond).setTriggerType(TT.muon) # noqa: F821 MenuItem('L1_EM15VH_MU10').setLogic( EM15VH & MU10 & physcond).setTriggerType(TT.muon) # noqa: F821 @@ -425,7 +433,7 @@ class ItemDef: MenuItem('L1_TAU12IL').setLogic( HA12IL & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU12IM').setLogic( HA12IM & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() : + if not isV8 : MenuItem('L1_TAU12IT').setLogic( HA12IT & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU12I').setLogic( HA12I & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -434,14 +442,14 @@ class ItemDef: MenuItem('L1_TAU20' ).setLogic( HA20 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IL' ).setLogic( HA20IL & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IM' ).setLogic( HA20IM & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() : + if not isV8 : MenuItem('L1_TAU20IT' ).setLogic( HA20IT & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20A' ).setLogic( HA20A & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20C' ).setLogic( HA20C & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU25' ).setLogic( HA25 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: MenuItem('L1_TAU25IT' ).setLogic( HA25IT & physcond).setTriggerType( TT.calo ) # noqa: F821 else: MenuItem('L1_TAU25IM' ).setLogic( HA25IM & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -449,7 +457,7 @@ class ItemDef: MenuItem('L1_TAU40' ).setLogic( HA40 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU60' ).setLogic( HA60 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU100' ).setLogic( HA100 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() : + if isV8 : MenuItem('L1_TAU90' ).setLogic( HA90 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU8_UNPAIRED_ISO' ).setLogic( HA8 & unpaired_isocond ).setTriggerType( TT.calo ) # noqa: F821 @@ -492,7 +500,7 @@ class ItemDef: MenuItem('L1_EM15_TAU40_2TAU15' ).setLogic( EM15 & HA40 & HA15.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15_2TAU12_J25_2J15_3J12' ).setLogic( EM15 & HA12.x(2) & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_EM15VHI_2TAU12' ).setLogic( EM15VHI & HA12.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VHI_2TAU12IL' ).setLogic( EM15VHI & HA12IL.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VHI_2TAU12IM' ).setLogic( EM15VHI & HA12IM.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -530,7 +538,7 @@ class ItemDef: MenuItem('L1_MU10_TAU12IM_J25_2J12' ).setLogic( MU10 & HA12IM & J25 & J12.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_MU10_TAU12IL_J25_2J12' ).setLogic( MU10 & HA12IL & J25 & J12.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU12I_MU10_J20.31ETA49' ).setLogic( HA12I & MU10 & J2031ETA49 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_MU10_TAU12IM_3J12' ).setLogic( MU10 & HA12IM & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20_2TAU12I_J25_2J15_3J12' ).setLogic( HA20 & HA12I.x(2) & J25 & J15.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -538,7 +546,7 @@ class ItemDef: MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12').setLogic( HA20IM & HA12IM.x(2) & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IL_2TAU12IL_J25_2J20_3J12').setLogic( HA20IL & HA12IL.x(2) & J25 & J20.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: MenuItem('L1_TAU25IT_2TAU12IT_2J25_3J12').setLogic( HA25IT & HA12IT.x(2) & J25.x(2) & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 else: MenuItem('L1_TAU25IM_2TAU12IM_J25_3J12' ).setLogic( HA25IM & HA12IM.x(2) & J25 & J12.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -560,7 +568,7 @@ class ItemDef: MenuItem('L1_TAU20_2TAU12_XE35' ).setLogic( HA20 & HA12.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IM_2TAU12IM_XE35' ).setLogic( HA20IM & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IL_2TAU12IL_XE35' ).setLogic( HA20IL & HA12IL.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() : + if not isV8 : MenuItem('L1_TAU20IT_2TAU12IT_XE35' ).setLogic( HA20IT & HA12IT.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU20IM_2TAU12IM_XE40' ).setLogic( HA20IM & HA12IM.x(2) & XE40 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_TAU40_2TAU12IM_XE40' ).setLogic( HA40 & HA12IM.x(2) & XE40 & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -569,7 +577,7 @@ class ItemDef: MenuItem('L1_MU10_TAU12_XE35' ).setLogic( MU10 & HA12 & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_MU10_TAU12IL_XE35' ).setLogic( MU10 & HA12IL & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_MU10_TAU12IM_XE35' ).setLogic( MU10 & HA12IM & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() : + if not isV8 : MenuItem('L1_MU10_TAU12IT_XE35' ).setLogic( MU10 & HA12IT & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_MU10_TAU12IM_XE40' ).setLogic( MU10 & HA12IM & XE40 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_MU10_eTAU12IM_gXERHO35' ).setLogic( MU10 & eTAU12IM & gXERHO35 & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -580,7 +588,7 @@ class ItemDef: MenuItem('L1_eTAU40_2eTAU12IM_gXERHO40' ).setLogic( eTAU40 & eTAU12IM.x(2) & gXERHO40 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_eTAU60_2eTAU40' ).setLogic( eTAU60 & eTAU40.x(2) & physcond).setTriggerType( TT.calo ) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_EM15VHI_TAU20IM_2TAU15_J25_2J20_3J15' ).setLogic( EM15VHI & HA20IM & HA15.x(2) & J25 & J20.x(2) & J15.x(3) & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VHI_2TAU12I_XE35' ).setLogic( EM15VHI & HA12I.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 MenuItem('L1_EM15VHI_2TAU12IM_XE35' ).setLogic( EM15VHI & HA12IM.x(2) & XE35 & physcond).setTriggerType( TT.calo ) # noqa: F821 @@ -747,11 +755,11 @@ class ItemDef: MenuItem('L1_3J15.0ETA25_XE40').setLogic( J150ETA25.x(3) & XE40 & physcond).setTriggerType(TT.calo) # noqa: F821 # combined em - jet - #if '_v7' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + #if isV7 or isPhaseII: #MenuItem('L1_EM15VH_JJ15.23ETA49' ).setLogic( EM15VH & JJ1523ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 # MenuItem('L1_EM18VHI_JJ15.23ETA49' ).setLogic( EM18VHI & JJ1523ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 # MenuItem('L1_EM20VHI_JJ15.23ETA49' ).setLogic( EM20VHI & JJ1523ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_EM18VHI_3J20' ).setLogic( EM18VHI & J20.x(3) & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_EM20VH_3J20' ).setLogic( EM20VH & J20.x(3) & physcond).setTriggerType(TT.calo) # noqa: F821 else: @@ -872,7 +880,7 @@ class ItemDef: MenuItem('L1_TE12000').setLogic( TE12000 & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_TE14000').setLogic( TE14000 & physcond).setTriggerType(TT.calo) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_TE0.24ETA49').setLogic( TE024ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_TE3.24ETA49').setLogic( TE324ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 MenuItem('L1_TE5.24ETA49').setLogic( TE524ETA49 & physcond).setTriggerType(TT.calo) # noqa: F821 @@ -1384,7 +1392,7 @@ class ItemDef: #AFP #new naming convention ATR-15881 AFP_C = AFP_NSC && AFP_FSC_SIT, AFP_C_SPECTOF = AFP_FSC_TOF - if not '_v6' in TriggerFlags.triggerMenuSetup(): + if not isV6: AFP_A = (AFP_NSA & AFP_FSA_SIT) # noqa: F821 AFP_C = (AFP_NSC & AFP_FSC_SIT) # noqa: F821 AFP_A_AND_C_SPECTOF = (AFP_FSA_TOF & AFP_FSC_TOF) # noqa: F821 @@ -1634,27 +1642,27 @@ class ItemDef: #ATR-19355 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_BPH-0M10-3MU4' ).setLogic( TOPO_0INVM10_3MU4ab & physcond)# noqa: F821 #ATR-18815 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_LFV-EM8I-MU11' ).setLogic( TOPO_0INVM10_0DR15_EM8abi_MU10ab & MU11 & physcond) # noqa: F821 MenuItem('L1_LFV-EM12I-MU6' ).setLogic( TOPO_0INVM10_0DR15_EM12abi_MU6ab & physcond) # noqa: F821 #ATR-18824 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_ZAFB-04DPHI-EM15I' ).setLogic( TOPO_60INVM9999_04DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821 MenuItem('L1_ZAFB-25DPHI-EM15I' ).setLogic( TOPO_60INVM9999_25DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821 MenuItem('L1_ZAFB-25DPHI-EM18I' ).setLogic( TOPO_60INVM9999_25DPHI32_EM15abhi_FJj15s623ETA49 & EM18VHI & physcond) # noqa: F821 #ATR-19302: - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_DPHI-M70-2EM10I' ).setLogic( TOPO_0INVM70_27DPHI32_EM10his1_EM10his6 & physcond) # noqa: F821 MenuItem('L1_DPHI-M70-2EM12I' ).setLogic( TOPO_0INVM70_27DPHI32_EM12his1_EM12his6 & physcond) # noqa: F821 #ATR-19510 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_DY-BOX-2MU4' ).setLogic( TOPO_5DETA99_5DPHI99_2MU4ab & MU4.x(2) & physcond) # noqa: F821 @@ -1740,33 +1748,7 @@ class ItemDef: MenuItem("L1_JPSI-1M5-EM7" ).setLogic( TOPO_1INVM5_EM7s1_EMs6 & physcond) # noqa: F821 MenuItem("L1_JPSI-1M5-EM12").setLogic( TOPO_1INVM5_EM12s1_EMs6 & physcond) # noqa: F821 - # # W T&P - # if not '_v6' in TriggerFlags.triggerMenuSetup(): - # MenuItem("L1_W-05DPHI-JXE-0" ).setLogic( TOPO_05MINDPHI_AJj20s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-10DPHI-JXE-0" ).setLogic( TOPO_10MINDPHI_AJj20s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-15DPHI-JXE-0" ).setLogic( TOPO_15MINDPHI_AJj20s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-10DPHI-EMXE-0" ).setLogic( TOPO_10MINDPHI_EM10s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-15DPHI-EMXE-0" ).setLogic( TOPO_15MINDPHI_EM10s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-05DPHI-EMXE-1" ).setLogic( TOPO_05MINDPHI_EM15s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_W-05RO-XEHT-0" ).setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_W-08RO-XEHT-0" ).setLogic( TOPO_08RATIO_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_W-90RO2-XEHT-0" ).setLogic( TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_W-250RO2-XEHT-0" ).setLogic( TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( TOPO_HT20_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_W-NOMATCH" ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT25").setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT30").setLogic( TOPO_30MT_EM10s6_XE0 & EM10 & physcond) # noqa: F821 - # MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS30 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & XS20 & physcond) # noqa: F821 - # MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" ).setLogic( TOPO_25MT_EM10s6_XE0 & EM10 & TOPO_15MINDPHI_AJj20s6_XE0 & TOPO_15MINDPHI_EM10s6_XE0 & physcond) # noqa: F821 - # MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - # MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS60 & physcond) # noqa: F821 - # MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond) # noqa: F821 - # MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj20s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond) # noqa: F821 - #else: - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem("L1_W-05DPHI-JXE-0" ).setLogic( TOPO_05MINDPHI_AJj10s6_XE0 & physcond) # noqa: F821 MenuItem("L1_W-10DPHI-JXE-0" ).setLogic( TOPO_10MINDPHI_AJj10s6_XE0 & physcond) # noqa: F821 MenuItem("L1_W-15DPHI-JXE-0" ).setLogic( TOPO_15MINDPHI_AJj10s6_XE0 & physcond) # noqa: F821 @@ -1778,9 +1760,9 @@ class ItemDef: MenuItem("L1_W-90RO2-XEHT-0" ).setLogic( R2TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 MenuItem("L1_W-250RO2-XEHT-0" ).setLogic( R2TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( R2TOPO_HT20_AJj15allETA49 & physcond) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() and not '_v7' in TriggerFlags.triggerMenuSetup() and not 'HI_v5' in TriggerFlags.triggerMenuSetup() and not '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if not isV8 and not isV7 and not isHIV5 and not isPhaseII: MenuItem("L1_W-NOMATCH" ).setLogic( TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem("L1_EM12_W-MT25").setLogic( TOPO_25MT_EM12s6_XE0 & EM12 & physcond) # noqa: F821 MenuItem("L1_EM15_W-MT35").setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & physcond) # noqa: F821 @@ -1815,37 +1797,6 @@ class ItemDef: MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & XS30 & physcond) # noqa: F821 MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( TOPO_35MT_EM15s6_XE0 & EM15 & TOPO_05MINDPHI_AJj10s6_XE0 & TOPO_05MINDPHI_EM15s6_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-10DPHI-JXE-0").setLogic( TOPO_10MINDPHI_AJj15s2_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-20DPHI-JXE-1").setLogic( TOPO_20MINDPHI_AJjs6_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-20DPHI-JXE-0").setLogic( TOPO_20MINDPHI_AJj15s2_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-10DPHI-EMXE-0").setLogic( TOPO_10MINDPHI_EM6s1_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-20DPHI-EMXE-1").setLogic( TOPO_20MINDPHI_EM9s6_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-20DPHI-EMXE-0").setLogic( TOPO_20MINDPHI_EM6s1_XE0 & physcond) # noqa: F821 - #MenuItem("L1_W-05RO-XEHT-0").setLogic( TOPO_05RATIO_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-08RO-XEHT-1").setLogic( TOPO_08RATIO_XE0_HT0_AJj0allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-40RO2-XEHT-0").setLogic( TOPO_40RATIO2_XE0_HT0_AJj15allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-90RO2-XEHT-1").setLogic( TOPO_90RATIO2_XE0_HT0_AJj0allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-HT20-JJ0.ETA49").setLogic( TOPO_HT20_AJj0allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-NOMATCH").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & physcond) # noqa: F821 - #MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & TOPO_05RATIO_XE0_SUM0_EM9s1_HT0_AJj15allETA49 & physcond) # noqa: F821 - #MenuItem("L1_EM3_W-MT20").setLogic( TOPO_20MT_EM6s6_XE0 & EM3 & physcond) # noqa: F821 - #MenuItem("L1_EM3_W-MT30").setLogic( TOPO_30MT_EM6s6_XE0 & EM3 & physcond) # noqa: F821 - #MenuItem("L1_EM3_W-MT40").setLogic( TOPO_40MT_EM6s6_XE0 & EM3 & physcond) # noqa: F821 - - # Bphysics triggers - # if not '_v6' in TriggerFlags.triggerMenuSetup(): - # #SX - # MenuItem("L1_BPH-DR-2MU4").setLogic( TOPO_2DR15_2MU4ab & physcond) - # MenuItem("L1_BPH-2M-2MU4").setLogic( TOPO_2INVM999_2MU4ab & physcond) - # MenuItem("L1_BPH-4M8-2MU4").setLogic( TOPO_4INVM8_2MU4ab & physcond) - # MenuItem("L1_BPH-DR-2MU4_BPH-2M-2MU4").setLogic( TOPO_2DR15_2MU4ab & TOPO_2INVM999_2MU4ab & physcond) - # MenuItem("L1_BPH-DR-2MU4_BPH-4M8-2MU4").setLogic( TOPO_2DR15_2MU4ab & TOPO_4INVM8_2MU4ab & physcond) - # MenuItem("L1_BPH-DR-2MU6").setLogic( TOPO_2DR15_2MU6ab & physcond) - # MenuItem("L1_BPH-2M-2MU6").setLogic( TOPO_2INVM999_2MU6ab & physcond) - # MenuItem("L1_BPH-4M8-2MU6").setLogic( TOPO_4INVM8_2MU6ab & physcond) - # MenuItem("L1_BPH-DR-2MU6_BPH-2M-2MU6").setLogic( TOPO_2DR15_2MU6ab & TOPO_2INVM999_2MU6ab & physcond) - # MenuItem("L1_BPH-DR-2MU6_BPH-4M8-2MU6").setLogic( TOPO_2DR15_2MU6ab & TOPO_4INVM8_2MU6ab & physcond) - ##Combined L1Top MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( TOPO_0DR28_MU10ab_TAU12abi & TOPO_1DISAMB_TAU12abi_J25ab & MU10 & physcond) # noqa: F821 MenuItem('L1_MU10_TAU12I-J25').setLogic( MU10 & TOPO_1DISAMB_TAU12abi_J25ab & physcond) # noqa: F821 @@ -1875,27 +1826,11 @@ class ItemDef: MenuItem('L1_XE35_MJJ-200').setLogic( XE35 & R2TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 ### ATR-15062 - if not '_v6' in TriggerFlags.triggerMenuSetup() and not '_HI' in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: MenuItem('L1_EM18VHI_MJJ-300').setLogic( EM18VHI & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 else: MenuItem('L1_EM18VH_MJJ-300').setLogic( EM18VH & TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 # CTP items for L1Topo streamers - #MenuItem('L1_DPhi_AJsAJs').setLogic( TOPO_DPhi_AJsAJs & physcond) # noqa: F821 - #MenuItem('L1_DPhi_EMsTAUs').setLogic( TOPO_DPhi_EMsTAUs & physcond) # noqa: F821 - #MenuItem('L1_DEta_AJabAJab').setLogic( TOPO_DEta_AJabAJab & physcond) # noqa: F821 - #MenuItem('L1_DEta_EMabTAUab').setLogic( TOPO_DEta_EMabTAUab & physcond) # noqa: F821 - # if not '_v6' in TriggerFlags.triggerMenuSetup(): - # #SX - # MenuItem('L1_BPH-2M-2MU4-B').setLogic( TOPO_2INVM999_CMU4ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-2M-2MU4-BO').setLogic( TOPO_2INVM999_2CMU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-2M-MU6MU4').setLogic( TOPO_2INVM999_MU6ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-2M-MU6MU4-B').setLogic( TOPO_2INVM999_ONEBARREL_MU6ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-2M-MU6MU4-BO').setLogic( TOPO_2INVM999_CMU6ab_CMU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-4M8-2MU4-B').setLogic( TOPO_4INVM8_CMU4ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-4M8-2MU4-BO').setLogic( TOPO_4INVM8_2CMU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-4M8-MU6MU4').setLogic( TOPO_4INVM8_MU6ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-4M8-MU6MU4-B').setLogic( TOPO_4INVM8_ONEBARREL_MU6ab_MU4ab & physcond) # noqa: F821 - # MenuItem('L1_BPH-4M8-MU6MU4-BO').setLogic( TOPO_4INVM8_CMU6ab_CMU4ab & physcond) # noqa: F821 MenuItem('L1_DY-DR-2MU4').setLogic( R2TOPO_2DR99_2MU4ab & physcond) # noqa: F821 MenuItem('L1_DY-BOX-MU6MU4').setLogic( TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & MU6 & physcond) # noqa: F821 @@ -1904,11 +1839,11 @@ class ItemDef: MenuItem('L1_LFV-MU11').setLogic( TOPO_0DR15_2MU6ab & MU11 & MU6.x(2) & physcond) # noqa: F821 MenuItem('L1_LFV-MU6').setLogic( TOPO_0DR15_2MU6ab & MU6.x(2) & physcond) # noqa: F821 MenuItem('L1_LFV-MU').setLogic( R2TOPO_0DR10_MU10ab_MU6ab & MU10 & MU6.x(2) & physcond) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() and not '_v7' in TriggerFlags.triggerMenuSetup() and not 'HI_v5' in TriggerFlags.triggerMenuSetup() and not '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if not isV8 and not isV7 and not isHIV5 and not isPhaseII: MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_0DPHI03_EM8abi_MU10ab & physcond) # noqa: F821 else: MenuItem('L1_LFV-EM8I').setLogic( TOPO_0DETA04_EM8abi_MU10ab & TOPO_0DPHI03_EM8abi_MU10ab & MU10 & physcond) #ATR-14282 # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup() and not '_v7' in TriggerFlags.triggerMenuSetup() and not 'HI_v5' in TriggerFlags.triggerMenuSetup() and not '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if not isV8 and not isV7 and not isHIV5 and not isPhaseII: MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_0DPHI03_EM15abi_MUab & physcond) # noqa: F821 else: MenuItem('L1_LFV-EM15I').setLogic( TOPO_0DETA04_EM15abi_MUab & TOPO_0DPHI03_EM15abi_MUab & physcond) #ATR-14282 # noqa: F821 @@ -1924,7 +1859,7 @@ class ItemDef: MenuItem('L1_MJJ-300').setLogic( TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-200').setLogic( R2TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-100').setLogic( R2TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_MJJ-600-NFF').setLogic( R2TOPO_600INVM9999_J30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-500-NFF').setLogic( TOPO_500INVM9999_J30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-400-NFF').setLogic( R2TOPO_400INVM9999_J30s6_AJ20s6 & physcond) # noqa: F821 @@ -1963,24 +1898,24 @@ class ItemDef: MenuItem('L1_MJJ-400-CF').setLogic( TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond) # noqa: F821 MenuItem('L1_DR-TAU20ITAU12I').setLogic( TOPO_0DR28_TAU20abi_TAU12abi & physcond) # noqa: F821 MenuItem('L1_BOX-TAU20ITAU12I').setLogic( R2TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( TOPO_2DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond) # noqa: F821 else: MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond) # noqa: F821 MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( R2TOPO_1DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond) # noqa: F821 MenuItem('L1_LAR-EM').setLogic( R2TOPO_LAR_EM20shi1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897) # noqa: F821 MenuItem('L1_LAR-J').setLogic( R2TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_LAR-ZEE').setLogic( R2TOPO_ZEE_EM20shi2 & physcond).setTriggerType( TT.calo ) # LAr demo (ATR-11897) # noqa: F821 MenuItem('L1_LAR-ZEE_LAR-EM').setLogic( R2TOPO_ZEE_EM20shi2 & R2TOPO_LAR_EM20shi1 &physcond).setTriggerType( TT.lardemo ) # noqa: F821 MenuItem('L1_FTK-EM').setLogic( R2TOPO_FTK_EM20s1 & physcond).setTriggerType( TT.ftk ) # noqa: F821 MenuItem('L1_FTK-J').setLogic( R2TOPO_FTK_J100s1 & physcond).setTriggerType( TT.ftk ) # noqa: F821 MenuItem('L1_FTK-MU').setLogic( R2TOPO_FTK_MU10s1 & MU20 & physcond).setTriggerType( TT.ftk ) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_DR-TAU20ITAU12I-J25_FTK').setLogic( TOPO_2DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond).setTriggerType(TT.ftk) # noqa: F821 else: MenuItem('L1_DR-TAU20ITAU12I-J25_FTK').setLogic( TOPO_1DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond).setTriggerType(TT.ftk) # noqa: F821 - if not '_v8' in TriggerFlags.triggerMenuSetup(): + if not isV8: MenuItem('L1_KF-XE40').setLogic( TOPO_KF_XE40_AJall & physcond) # noqa: F821 MenuItem('L1_KF-XE50').setLogic( TOPO_KF_XE50_AJall & physcond) # noqa: F821 MenuItem('L1_KF-XE55').setLogic( TOPO_KF_XE55_AJall & physcond) # noqa: F821 @@ -1988,7 +1923,7 @@ class ItemDef: MenuItem('L1_KF-XE65').setLogic( TOPO_KF_XE65_AJall & physcond) # noqa: F821 MenuItem('L1_KF-XE75').setLogic( TOPO_KF_XE75_AJall & physcond) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_MJJ-400-NFF-0DPHI20').setLogic( TOPO_400INVM9999_0DPHI20_J30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-400-NFF-0DPHI22').setLogic( TOPO_400INVM9999_0DPHI22_J30s6_AJ20s6 & physcond) # noqa: F821 MenuItem('L1_MJJ-400-NFF-0DPHI24').setLogic( TOPO_400INVM9999_0DPHI24_J30s6_AJ20s6 & physcond) # noqa: F821 @@ -2005,7 +1940,7 @@ class ItemDef: MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( R2TOPO_2INVM9_MU6ab_MU4ab & R2TOPO_0DR15_MU6ab_MU4ab & MU6 & physcond) # noqa: F821 #ATR-19720 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_BPH-8M15-0DR22-2MU6' ).setLogic( TOPO_8INVM15_0DR22_2MU6ab & MU6.x(2) & physcond) # noqa: F821 MenuItem('L1_BPH-2M9-2DR15-2MU6' ).setLogic( TOPO_2INVM9_2DR15_2MU6ab & MU6.x(2) & physcond) # noqa: F821 MenuItem('L1_BPH-2M9-0DR15-MU6MU4' ).setLogic( TOPO_2INVM9_0DR15_MU6ab_MU4ab & MU6 & physcond) # noqa: F821 @@ -2037,7 +1972,7 @@ class ItemDef: MenuItem('L1_BPH-8M15-MU6MU4' ).setLogic( R2TOPO_8INVM15_MU6ab_MU4ab & MU6 & physcond) # backup 71% for Upsi # noqa: F821 MenuItem('L1_BPH-8M15-2MU6' ).setLogic( R2TOPO_8INVM15_2MU6ab & MU6.x(2) & physcond) # backup 95% for Upsi # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_BPH-0M9-EM7-EM5' ).setLogic( TOPO_0INVM9_EM7ab_EMab & physcond) # noqa: F821 MenuItem('L1_BPH-0DR3-EM7J15').setLogic( TOPO_0DR03_EM7ab_CJ15ab & physcond) # noqa: F821 MenuItem('L1_BPH-0M9-EM7-EM5_MU6' ).setLogic( MU6 & TOPO_0INVM9_EM7ab_EMab & physcond) # noqa: F821 @@ -2052,7 +1987,7 @@ class ItemDef: MenuItem('L1_LATE-MU10_XE50').setLogic( TOPO_LATE_MU10s1 & XE50 & physcond) # noqa: F821 MenuItem('L1_LATE-MU10_XE40').setLogic( TOPO_LATE_MU10s1 & XE40 & physcond) # noqa: F821 MenuItem('L1_LATE-MU10_J50').setLogic( TOPO_LATE_MU10s1 & J50 & physcond) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup() or '_v7' in TriggerFlags.triggerMenuSetup() or 'HI_v5' in TriggerFlags.triggerMenuSetup() or '_PhaseII' in TriggerFlags.triggerMenuSetup(): + if isV8 or isV7 or isHIV5 or isPhaseII: MenuItem('L1_SC111-CJ15').setLogic( TOPO_SC111_CJ15abETA26 & physcond) # noqa: F821 MenuItem('L1_SC85-CJ15').setLogic( R2TOPO_SC85_CJ15abETA26 & physcond) # noqa: F821 @@ -2061,7 +1996,7 @@ class ItemDef: MenuItem('L1_SC85').setLogic( TOPO_SC85_CJ15abETA26 & physcond) # noqa: F821 MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( HA60 & TOPO_0DR28_TAU20abi_TAU12abi & physcond) # noqa: F821 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: MenuItem('L1_CEP-CJ60').setLogic( TOPO_CEP_CJ60s6 & physcond ) # noqa: F821 MenuItem('L1_CEP-CJ50').setLogic( TOPO_CEP_CJ50s6 & physcond ) # noqa: F821 MenuItem('L1_CEP-CJ50.ETA21').setLogic( TOPO_CEP_CJ50s6ETA21 & physcond ) # noqa: F821 diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py index 605b1d78ebe3367d607db0f04c61c44c7b314b0b..1bcc0364bd4eaa4eef84680281f9e173a2d443c3 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py @@ -17,6 +17,11 @@ class ThresholdDefLegacy: @staticmethod def registerThresholds(tc): + isV6 = '_v6' in TriggerFlags.triggerMenuSetup() + isV8 = '_v8' in TriggerFlags.triggerMenuSetup() or 'LS2_v1'==TriggerFlags.triggerMenuSetup() + isHI = '_HI' in TriggerFlags.triggerMenuSetup() + + if ThresholdDefLegacy.alreadyExecuted: return ThresholdDefLegacy.alreadyExecuted = True @@ -70,7 +75,7 @@ class ThresholdDefLegacy: .addThrValue(10, -25, -18, priority=2).addThrValue(10, 18, 25, priority=2) #ATR-19302 - if '_v8' in TriggerFlags.triggerMenuSetup(): + if isV8: LegacyThreshold( 'EM10VHI', 'EM').addThrValue(11, priority=1)\ .addThrValue(11, -8, 0, priority=2).addThrValue(11, 0, 8, priority=2)\ .addThrValue(9, -11, -8, priority=2).addThrValue(9, 8, 11, priority=2)\ @@ -130,7 +135,7 @@ class ThresholdDefLegacy: # (V)HI section # new egamma v7 menu (ATR-16089) - if '_v6' not in TriggerFlags.triggerMenuSetup() and '_HI' not in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: ThresholdValue.setDefaults('EM', {'isobits' : '00001', 'use_relIso' : True }) LegacyThreshold( 'EM22VH', 'EM').addThrValue(24, priority=1)\ @@ -157,7 +162,7 @@ class ThresholdDefLegacy: ThresholdValue.setDefaults('EM', {'isobits' : '00100', 'use_relIso' : True }) - if '_v6' not in TriggerFlags.triggerMenuSetup() and '_HI' not in TriggerFlags.triggerMenuSetup(): + if not isV6 and not isHI: LegacyThreshold( 'EM15VHI', 'EM').addThrValue(17, priority=1)\ .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\ .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\ @@ -253,7 +258,7 @@ class ThresholdDefLegacy: LegacyThreshold('HA%iIL' % thrV, 'TAU').addThrValue(thrV) ThresholdValue.setDefaults('TAU', {'isobits' : '00010', 'use_relIso' : True }) - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: for thrV in [12,20]: LegacyThreshold('HA%iIM' % thrV, 'TAU').addThrValue(thrV) else: @@ -261,7 +266,7 @@ class ThresholdDefLegacy: LegacyThreshold('HA%iIM' % thrV, 'TAU').addThrValue(thrV) ThresholdValue.setDefaults('TAU', {'isobits' : '00100', 'use_relIso' : True }) - if '_v6' in TriggerFlags.triggerMenuSetup() or '_HI' in TriggerFlags.triggerMenuSetup(): + if isV6 or isHI: for thrV in [12,20,25]: LegacyThreshold('HA%iIT' % thrV, 'TAU').addThrValue(thrV) else: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py index daf41a53f29cab499e0c0c20e9759f8fb2216404..5e255046eb6b7f3c49a6f66448d19dbdc7bb00c6 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py @@ -38,7 +38,7 @@ class L1MenuConfig(object): self.menuFullName = menuName if menuName else TriggerFlags.triggerMenuSetup() self.menuName = self._getMenuBaseName(self.menuFullName) self.inputFile = inputFile - self.outputFile = outputFile + self.outputFile = outputFile if outputFile else TriggerFlags.inputLVL1configFile() self.l1menuFromFile = (self.inputFile is not None) # all registered items @@ -58,6 +58,8 @@ class L1MenuConfig(object): self.l1menu = L1Menu(self.menuName) self.l1menu.setBunchGroupSplitting() # I like this much more, but let's see what the menu group says + log.info("=== Generating L1 menu %s ===", self.menuName) + log.info("=== Reading definition of algorithms, thresholds, and items ===") self._registerDefinedConfigurationObjects() # defines and registers all items, thresholds, ... @@ -225,13 +227,19 @@ class L1MenuConfig(object): Menu.defineMenu() defines the menu via L1MenuFlags "items", "thresholds", """ - log.info("Reading TriggerMenuMT.Menu.Menu_%s", self.menuName) - menumodule = __import__('Menu.Menu_%s' % self.menuName, globals(), locals(), ['defineMenu'], -1) + # we apply a hack here. menu group is working on LS2_v1, until ready we will use MC_pp_v8 + menuToLoad = self.menuName + if menuToLoad == "LS2_v1": + menuToLoad = "MC_pp_v8" + log.info("Menu LS2_v1 was requested but is not available yet. Will load MC_pp_v8 instead. This is a TEMPORARY meassure") + + log.info("Reading TriggerMenuMT.Menu.Menu_%s", menuToLoad) + menumodule = __import__('Menu.Menu_%s' % menuToLoad, globals(), locals(), ['defineMenu'], -1) menumodule.defineMenu() - log.info("... L1 menu '%s' contains:", self.menuName) + log.info("... L1 menu '%s' contains:", menuToLoad) - log.info("Reading TriggerMenuMT.Menu.Menu_%s_inputs", self.menuName) - topomenumodule = __import__('Menu.Menu_%s_inputs' % self.menuName, globals(), locals(), ['defineMenu'], -1) + log.info("Reading TriggerMenuMT.Menu.Menu_%s_inputs", menuToLoad) + topomenumodule = __import__('Menu.Menu_%s_inputs' % menuToLoad, globals(), locals(), ['defineMenu'], -1) topomenumodule.defineMenu() algoCount = 0 for boardName, boardDef in L1MenuFlags.boards().items(): @@ -242,13 +250,13 @@ class L1MenuConfig(object): else: for t in c["algorithmGroups"]: algoCount += len(t["algorithms"]) - log.info("... L1Topo menu '%s' contains %i algorithms", self.menuName, algoCount) + log.info("... L1Topo menu '%s' contains %i algorithms", menuToLoad, algoCount) try: - log.info("Reading TriggerMenuMT.Menu.Menu_%s_inputs_legacy", self.menuName) - legacymenumodule = __import__('Menu.Menu_%s_inputs_legacy' % self.menuName, globals(), locals(), ['defineMenu'], -1) + log.info("Reading TriggerMenuMT.Menu.Menu_%s_inputs_legacy", menuToLoad) + legacymenumodule = __import__('Menu.Menu_%s_inputs_legacy' % menuToLoad, globals(), locals(), ['defineMenu'], -1) legacymenumodule.defineLegacyMenu() - log.info("... L1 legacy menu %s contains %i legacy boards (%s)", self.menuName, len(L1MenuFlags.legacyBoards()), ', '.join(L1MenuFlags.legacyBoards().keys())) + log.info("... L1 legacy menu %s contains %i legacy boards (%s)", menuToLoad, len(L1MenuFlags.legacyBoards()), ', '.join(L1MenuFlags.legacyBoards().keys())) except ImportError: log.info("==> No menu defining the legacy inputs was found, will assume this intended") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_HLTmenu.sh.orig b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_HLTmenu.sh.orig new file mode 100755 index 0000000000000000000000000000000000000000..dd380088bd0a550782b8080a2f0d449eafad1380 --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_HLTmenu.sh.orig @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + + +<<<<<<< HEAD +athena --threads=1 --skipEvents=10 --evtMax=20 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TriggerMenuMT/generateMT.py +||||||| merged common ancestors +athena -l DEBUG --threads=1 --skipEvents=10 --evtMax=20 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TriggerMenuMT/generateMT.py +======= +athena -l INFO --threads=1 --skipEvents=10 --evtMax=20 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TriggerMenuMT/generateMT.py +>>>>>>> 2f9342f4413871348f63c9cb4ccbdf814f52ccb1 diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/generateMT.py b/Trigger/TriggerCommon/TriggerMenuMT/share/generateMT.py index 12c26afa771d42f24488cb2bfcc3d0e6b3c506c7..bbdeb01b4e6890fbdaacc6bd9d5159c5c05dc5da 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/share/generateMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/share/generateMT.py @@ -1,3 +1,5 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + # import flags from TriggerJobOpts.TriggerFlags import TriggerFlags TriggerFlags.triggerMenuSetup = "LS2_v1" @@ -12,15 +14,10 @@ include("TrigUpgradeTest/testHLT_MT.py") if globalflags.InputFormat.is_bytestream(): topSequence.L1Decoder.ctpUnpacker.OutputLevel=DEBUG - ########################################## # Menu and CF construction ########################################## - - - - from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT g = GenerateMenuMT() g.generateMT()