ATLAS Offline Software
HLTPrescaleCondAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCONFIGSVC__HLTPRESCALECONDALG
6 #define TRIGCONFIGSVC__HLTPRESCALECONDALG
7 
10 
14 
16 
17 #include <tbb/concurrent_unordered_map.h>
18 
19 #include <memory>
20 
21 namespace TrigConf {
22 
34  public:
35  HLTPrescaleCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
36  virtual ~HLTPrescaleCondAlg() override = default;
37 
38  virtual StatusCode initialize() override;
39  virtual StatusCode execute(const EventContext& ctx) const override;
40 
41  // avoids running CondAlg multiple times for the same input (ATEAM-617)
42  virtual bool isReEntrant() const override final { return false; }
43 
44  private:
45 
46  // helper function to load a HLT prescales set from a file
47  std::shared_ptr<HLTPrescalesSet> createFromFile( const std::string & filename ) const;
48 
49  // helper function to load a HLT prescales set from a prescale key
50  std::shared_ptr<HLTPrescalesSet> createFromDB( unsigned int psk, bool isRun3 ) const;
51 
52  // map the prescale key to a HLTPrescalesSet
53  mutable tbb::concurrent_unordered_map<unsigned int, std::shared_ptr<const HLTPrescalesSet>> m_pssMap ATLAS_THREAD_SAFE;
54 
55  // input key to the HLT Prescale Key folder
56  SG::ReadCondHandleKey<AthenaAttributeList> m_pskFolderInputKey{ this, "PSKFolder", "/TRIGGER/HLT/PrescaleKey", "SG Key of AthenaAttributeList containing hlt psk"};
57 
58  // output key to store the HLTPrescalesSet
59  SG::WriteCondHandleKey<TrigConf::HLTPrescalesSet> m_hltPrescalesSetOutputKey{ this, "HLTPrescales", "HLTPrescales", "HLT prescales"};
60 
61  // properties
62  Gaudi::Property< std::string > m_configSource { this, "Source", "FILE", "Configuration source, can be 'FILE', 'DB', or 'COOL'" };
63  Gaudi::Property< std::string > m_dbConnection { this, "TriggerDB", "", "DB connection alias or 'JOSVC', used when property Source set to 'DB' or set to 'COOL'." };
64  Gaudi::Property< unsigned int > m_psk { this, "HLTPsk", 0, "HLT prescale key, used when property 'Source' set to 'DB' or 'FILE'" };
65  Gaudi::Property< std::string > m_filename { this, "Filename", "", "HLT prescale json file, used when property 'Source' set to 'FILE'" };
66 
67  };
68 
69 }
70 #endif
TrigConf::HLTPrescaleCondAlg::m_psk
Gaudi::Property< unsigned int > m_psk
Definition: HLTPrescaleCondAlg.h:64
HLTPrescalesSet.h
TrigConf::HLTPrescaleCondAlg::HLTPrescaleCondAlg
HLTPrescaleCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HLTPrescaleCondAlg.cxx:15
TrigConf::HLTPrescaleCondAlg::m_dbConnection
Gaudi::Property< std::string > m_dbConnection
Definition: HLTPrescaleCondAlg.h:63
WriteCondHandleKey.h
TrigConf::HLTPrescaleCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: HLTPrescaleCondAlg.cxx:123
TrigConf::HLTPrescaleCondAlg::m_filename
Gaudi::Property< std::string > m_filename
Definition: HLTPrescaleCondAlg.h:65
TrigConf::HLTPrescaleCondAlg
Condition algorithm to provide the L1 trigger menu.
Definition: HLTPrescaleCondAlg.h:33
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
AthenaAttributeList.h
TrigConf::HLTPrescaleCondAlg::ATLAS_THREAD_SAFE
tbb::concurrent_unordered_map< unsigned int, std::shared_ptr< const HLTPrescalesSet > > m_pssMap ATLAS_THREAD_SAFE
Definition: HLTPrescaleCondAlg.h:53
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TrigConf::HLTPrescaleCondAlg::initialize
virtual StatusCode initialize() override
Definition: HLTPrescaleCondAlg.cxx:65
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigConf::HLTPrescaleCondAlg::isReEntrant
virtual bool isReEntrant() const override final
Definition: HLTPrescaleCondAlg.h:42
TrigConf::HLTPrescaleCondAlg::~HLTPrescaleCondAlg
virtual ~HLTPrescaleCondAlg() override=default
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::HLTPrescaleCondAlg::createFromDB
std::shared_ptr< HLTPrescalesSet > createFromDB(unsigned int psk, bool isRun3) const
Definition: HLTPrescaleCondAlg.cxx:40
ReadCondHandleKey.h
AthReentrantAlgorithm.h
TrigConf::HLTPrescaleCondAlg::m_configSource
Gaudi::Property< std::string > m_configSource
Definition: HLTPrescaleCondAlg.h:62
SG::ReadCondHandleKey< AthenaAttributeList >
TrigConf::HLTPrescaleCondAlg::m_hltPrescalesSetOutputKey
SG::WriteCondHandleKey< TrigConf::HLTPrescalesSet > m_hltPrescalesSetOutputKey
Definition: HLTPrescaleCondAlg.h:59
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
SG::WriteCondHandleKey< TrigConf::HLTPrescalesSet >
TrigConf::HLTPrescaleCondAlg::createFromFile
std::shared_ptr< HLTPrescalesSet > createFromFile(const std::string &filename) const
Definition: HLTPrescaleCondAlg.cxx:21
checker_macros.h
Define macros for attributes used to control the static checker.
TrigConf::HLTPrescaleCondAlg::m_pskFolderInputKey
SG::ReadCondHandleKey< AthenaAttributeList > m_pskFolderInputKey
Definition: HLTPrescaleCondAlg.h:56