Commit 483420e2 authored by Joerg Stelzer's avatar Joerg Stelzer
Browse files

Addressing more comments

parent 6724cab0
...@@ -168,7 +168,7 @@ def getHLTConfigSvc( flags = None ): ...@@ -168,7 +168,7 @@ def getHLTConfigSvc( flags = None ):
return hltConfigSvc return hltConfigSvc
# configuration of HLTConfigSvc # configuration of CondAlg providing the HLTPrescalesSet
@memoize @memoize
def setupHLTPrescaleCondAlg( flags = None ): def setupHLTPrescaleCondAlg( flags = None ):
log = logging.getLogger('TrigConfigSvcCfg') log = logging.getLogger('TrigConfigSvcCfg')
......
...@@ -16,7 +16,7 @@ TrigConf::HLTPrescaleCondAlg::HLTPrescaleCondAlg(const std::string& name, ISvcLo ...@@ -16,7 +16,7 @@ TrigConf::HLTPrescaleCondAlg::HLTPrescaleCondAlg(const std::string& name, ISvcLo
{} {}
TrigConf::HLTPrescalesSetPtr std::shared_ptr<TrigConf::HLTPrescalesSet>
TrigConf::HLTPrescaleCondAlg::createFromFile( const std::string & filename ) const { TrigConf::HLTPrescaleCondAlg::createFromFile( const std::string & filename ) const {
auto pss = std::make_shared<HLTPrescalesSet>(); auto pss = std::make_shared<HLTPrescalesSet>();
// load the file into the HLT prescales set // load the file into the HLT prescales set
...@@ -34,7 +34,7 @@ TrigConf::HLTPrescaleCondAlg::createFromFile( const std::string & filename ) con ...@@ -34,7 +34,7 @@ TrigConf::HLTPrescaleCondAlg::createFromFile( const std::string & filename ) con
} }
TrigConf::HLTPrescalesSetPtr std::shared_ptr<TrigConf::HLTPrescalesSet>
TrigConf::HLTPrescaleCondAlg::createFromDB( unsigned int psk, bool isRun3 ) const { TrigConf::HLTPrescaleCondAlg::createFromDB( unsigned int psk, bool isRun3 ) const {
if( ! isRun3 ) { if( ! isRun3 ) {
ATH_MSG_WARNING( "Currently it is not possible to load run 2 prescale sets from the database. Will not load HLT psk " << psk ); ATH_MSG_WARNING( "Currently it is not possible to load run 2 prescale sets from the database. Will not load HLT psk " << psk );
...@@ -146,6 +146,7 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const { ...@@ -146,6 +146,7 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const {
} }
std::shared_ptr<HLTPrescalesSet> pss; std::shared_ptr<HLTPrescalesSet> pss;
if( m_configSource == "FILE" ) { if( m_configSource == "FILE" ) {
pss = m_pssMap.at(0); pss = m_pssMap.at(0);
...@@ -158,10 +159,13 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const { ...@@ -158,10 +159,13 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const {
bool isRun3 = range.start().run_number()>350000; bool isRun3 = range.start().run_number()>350000;
m_pssMap[hltPsk] = createFromDB( hltPsk, isRun3 ); pss = m_pssMap[hltPsk] = createFromDB( hltPsk, isRun3 );
}
} else {
pss = m_pssMap.at( hltPsk ); pss = pssi->second;
}
} else { } else {
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
namespace TrigConf { namespace TrigConf {
using HLTPrescalesSetPtr = std::shared_ptr<HLTPrescalesSet>;
/** /**
* @brief Condition algorithm to provide the L1 trigger menu * @brief Condition algorithm to provide the L1 trigger menu
* *
...@@ -42,13 +40,13 @@ namespace TrigConf { ...@@ -42,13 +40,13 @@ namespace TrigConf {
private: private:
// helper function to load a HLT prescales set from a file // helper function to load a HLT prescales set from a file
HLTPrescalesSetPtr createFromFile( const std::string & filename ) const; std::shared_ptr<HLTPrescalesSet> createFromFile( const std::string & filename ) const;
// helper function to load a HLT prescales set from a prescale key // helper function to load a HLT prescales set from a prescale key
HLTPrescalesSetPtr createFromDB( unsigned int psk, bool isRun3 ) const; std::shared_ptr<HLTPrescalesSet> createFromDB( unsigned int psk, bool isRun3 ) const;
// map the prescale key to a HLTPrescalesSet // map the prescale key to a HLTPrescalesSet
mutable tbb::concurrent_unordered_map<unsigned int, HLTPrescalesSetPtr> m_pssMap; mutable tbb::concurrent_unordered_map<unsigned int, std::shared_ptr<HLTPrescalesSet>> m_pssMap;
// input key to the HLT Prescale Key folder // input key to the HLT Prescale Key folder
SG::ReadCondHandleKey<AthenaAttributeList> m_pskFolderInputKey{ this, "PSKFolder", "/TRIGGER/HLT/PrescaleKey", "SG Key of AthenaAttributeList containing hlt psk"}; SG::ReadCondHandleKey<AthenaAttributeList> m_pskFolderInputKey{ this, "PSKFolder", "/TRIGGER/HLT/PrescaleKey", "SG Key of AthenaAttributeList containing hlt psk"};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment