ATLAS Offline Software
Loading...
Searching...
No Matches
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
21namespace 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 private:
42
43 // helper function to load a HLT prescales set from a file
44 std::shared_ptr<HLTPrescalesSet> createFromFile( const std::string & filename ) const;
45
46 // helper function to load a HLT prescales set from a prescale key
47 std::shared_ptr<HLTPrescalesSet> createFromDB( unsigned int psk, bool isRun3 ) const;
48
49 // map the prescale key to a HLTPrescalesSet
50 mutable tbb::concurrent_unordered_map<unsigned int, std::shared_ptr<const HLTPrescalesSet>> m_pssMap ATLAS_THREAD_SAFE;
51
52 // input key to the HLT Prescale Key folder
53 SG::ReadCondHandleKey<AthenaAttributeList> m_pskFolderInputKey{ this, "PSKFolder", "/TRIGGER/HLT/PrescaleKey", "SG Key of AthenaAttributeList containing hlt psk"};
54
55 // output key to store the HLTPrescalesSet
56 SG::WriteCondHandleKey<TrigConf::HLTPrescalesSet> m_hltPrescalesSetOutputKey{ this, "HLTPrescales", "HLTPrescales", "HLT prescales"};
57
58 // properties
59 Gaudi::Property< std::string > m_configSource { this, "Source", "FILE", "Configuration source, can be 'FILE', 'DB', or 'COOL'" };
60 Gaudi::Property< std::string > m_dbConnection { this, "TriggerDB", "", "DB connection alias or 'JOSVC', used when property Source set to 'DB' or set to 'COOL'." };
61 Gaudi::Property< unsigned int > m_psk { this, "HLTPsk", 0, "HLT prescale key, used when property 'Source' set to 'DB' or 'FILE'" };
62 Gaudi::Property< std::string > m_filename { this, "Filename", "", "HLT prescale json file, used when property 'Source' set to 'FILE'" };
63
64 };
65
66}
67#endif
Base class for conditions algorithms.
Define macros for attributes used to control the static checker.
Base class for conditions algorithms.
virtual ~HLTPrescaleCondAlg() override=default
HLTPrescaleCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteCondHandleKey< TrigConf::HLTPrescalesSet > m_hltPrescalesSetOutputKey
SG::ReadCondHandleKey< AthenaAttributeList > m_pskFolderInputKey
std::shared_ptr< HLTPrescalesSet > createFromDB(unsigned int psk, bool isRun3) const
Gaudi::Property< unsigned int > m_psk
Gaudi::Property< std::string > m_configSource
Gaudi::Property< std::string > m_dbConnection
std::shared_ptr< HLTPrescalesSet > createFromFile(const std::string &filename) const
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::string > m_filename
virtual StatusCode initialize() override
tbb::concurrent_unordered_map< unsigned int, std::shared_ptr< const HLTPrescalesSet > > m_pssMap ATLAS_THREAD_SAFE
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22