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 ):
return hltConfigSvc
# configuration of HLTConfigSvc
# configuration of CondAlg providing the HLTPrescalesSet
@memoize
def setupHLTPrescaleCondAlg( flags = None ):
log = logging.getLogger('TrigConfigSvcCfg')
......
......@@ -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 {
auto pss = std::make_shared<HLTPrescalesSet>();
// load the file into the HLT prescales set
......@@ -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 {
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 );
......@@ -146,6 +146,7 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const {
}
std::shared_ptr<HLTPrescalesSet> pss;
if( m_configSource == "FILE" ) {
pss = m_pssMap.at(0);
......@@ -158,10 +159,13 @@ TrigConf::HLTPrescaleCondAlg::execute(const EventContext& ctx) const {
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 {
......
......@@ -19,8 +19,6 @@
namespace TrigConf {
using HLTPrescalesSetPtr = std::shared_ptr<HLTPrescalesSet>;
/**
* @brief Condition algorithm to provide the L1 trigger menu
*
......@@ -42,13 +40,13 @@ namespace TrigConf {
private:
// 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
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
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
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