ATLAS Offline Software
xAODMenuWriter.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TRIGCONFXAOD_XAODMENUWRITER_H
8 #define TRIGCONFXAOD_XAODMENUWRITER_H
9 
10 // System include(s):
11 extern "C" {
12 # include <stdint.h>
13 }
14 #include <string>
15 #include <set>
16 #include <map> // For std::pair...
17 
19 
20 // Gaudi/Athena include(s):
22 #include "GaudiKernel/ServiceHandle.h"
24 
25 // Trigger include(s):
26 #include "TrigConfData/HLTMenu.h"
28 #include "TrigConfData/L1Menu.h"
32 
33 // EDM include(s):
35 
36 namespace TrigConf {
37 
55 
56  public:
58  xAODMenuWriter( const std::string& name, ISvcLocator* svcLoc );
59 
60  virtual ~xAODMenuWriter() override = default;
61 
63  virtual StatusCode initialize() override;
64 
66  virtual StatusCode execute(const EventContext& ctx) const override;
67 
68  private:
69 
70  SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu",
71  "HLT Menu key"};
72 
73  SG::ReadHandleKey<TrigConf::HLTMonitoring> m_HLTMonitoringKey {this, "HLTMonitoringMenu", "DetectorStore+HLTMonitoringMenu",
74  "HLT Monitoring key"};
75 
76  SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey {this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu",
77  "L1 Menu key"};
78 
80  "HLT prescales set condition handle"};
81 
83  "L1 prescales set condition handle"};
84 
85  SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> m_bgInputKey{this, "L1BunchGroup", "L1BunchGroup",
86  "L1BunchGroupSet condition handl"};
87 
88  Gaudi::Property< std::string > m_metaNameJSON_hlt {this, "JSONMetaObjectNameHLT", "TriggerMenuJson_HLT",
89  "StoreGate key for the xAOD::TriggerMenuJson HLT configuration object"};
90 
91  Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring {this, "JSONMetaObjectNameHLTMonitoring", "TriggerMenuJson_HLTMonitoring",
92  "StoreGate key for the xAOD::TriggerMenuJson HLT Monitoring configuration object"};
93 
94  Gaudi::Property< std::string > m_metaNameJSON_l1 {this, "JSONMetaObjectNameL1", "TriggerMenuJson_L1",
95  "StoreGate key for the xAOD::TriggerMenuJson L1 configuration object"};
96 
97  Gaudi::Property< std::string > m_metaNameJSON_hltps {this, "JSONMetaObjectNameHLTPS", "TriggerMenuJson_HLTPS",
98  "StoreGate key for the xAOD::TriggerMenuJson HLT prescales configuration object"};
99 
100  Gaudi::Property< std::string > m_metaNameJSON_l1ps {this, "JSONMetaObjectNameL1PS", "TriggerMenuJson_L1PS",
101  "StoreGate key for the xAOD::TriggerMenuJson L1 prescales configuration object"};
102 
103  Gaudi::Property< std::string > m_metaNameJSON_bg {this, "JSONMetaObjectNameBunchgroup", "TriggerMenuJson_BG",
104  "StoreGate key for the xAOD::TriggerMenuJson BunchGroup configuration object"};
105 
106  ServiceHandle< StoreGateSvc > m_metaStore {this, "MetaDataStore", "MetaDataStore",
107  "The MetaDataStore"};
108 
109  ToolHandle<IKeyWriterTool> m_keyWriterTool{this, "KeyWriterTool", "KeyWriterTool/OfflineKeyWriterTool",
110  "Writes the keys which are configured when the trigger configuration is written to in-file metadata."};
111 
113  typedef std::pair< uint32_t, std::pair< uint32_t, uint32_t > > TrigKey_t;
114 
115  // The configuration objects that we are writing
117  mutable xAOD::TriggerMenuJsonContainer* m_menuJSON_hltmonitoring ATLAS_THREAD_SAFE {};
119  mutable xAOD::TriggerMenuJsonContainer* m_menuJSON_hltps ATLAS_THREAD_SAFE {};
122 
124  mutable std::set< uint32_t > m_converted_smk ATLAS_THREAD_SAFE;
125  mutable std::set< uint32_t > m_converted_hltpsk ATLAS_THREAD_SAFE;
126  mutable std::set< uint32_t > m_converted_l1psk ATLAS_THREAD_SAFE;
127  mutable std::set< uint32_t > m_converted_bg ATLAS_THREAD_SAFE;
128 
131 
132  }; // class xAODMenuWriter
133 
134 } // namespace TrigConf
135 
136 #endif // TRIGCONFXAOD_XAODMENUWRITER_H
TrigConf::xAODMenuWriter::m_HLTMonitoringKey
SG::ReadHandleKey< TrigConf::HLTMonitoring > m_HLTMonitoringKey
Definition: xAODMenuWriter.h:73
HLTPrescalesSet.h
TrigConf::xAODMenuWriter::m_mutex
std::mutex m_mutex
The mutex to prevent us from writing more than one configuration at a time.
Definition: xAODMenuWriter.h:130
TrigConf::xAODMenuWriter::m_metaNameJSON_hltps
Gaudi::Property< std::string > m_metaNameJSON_hltps
Definition: xAODMenuWriter.h:97
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
TrigConf::xAODMenuWriter::m_keyWriterTool
ToolHandle< IKeyWriterTool > m_keyWriterTool
Definition: xAODMenuWriter.h:109
TrigConf::xAODMenuWriter::m_metaNameJSON_hltmonitoring
Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring
Definition: xAODMenuWriter.h:91
TrigConf::xAODMenuWriter::xAODMenuWriter
xAODMenuWriter(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: xAODMenuWriter.cxx:38
L1PrescalesSet.h
SG::ReadHandleKey< TrigConf::HLTMenu >
TrigConf::xAODMenuWriter::TrigKey_t
std::pair< uint32_t, std::pair< uint32_t, uint32_t > > TrigKey_t
Trigger configuration key type (used just internally)
Definition: xAODMenuWriter.h:113
TrigConf::xAODMenuWriter::~xAODMenuWriter
virtual ~xAODMenuWriter() override=default
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::xAODMenuWriter::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: xAODMenuWriter.cxx:45
TrigConf::xAODMenuWriter::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Definition: xAODMenuWriter.h:106
TrigConf::xAODMenuWriter::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_hltpsk ATLAS_THREAD_SAFE
Definition: xAODMenuWriter.h:125
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigConf::xAODMenuWriter::m_metaNameJSON_bg
Gaudi::Property< std::string > m_metaNameJSON_bg
Definition: xAODMenuWriter.h:103
TriggerMenuJsonContainer.h
TrigConf::xAODMenuWriter::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_l1psk ATLAS_THREAD_SAFE
Definition: xAODMenuWriter.h:126
TrigConf::xAODMenuWriter::m_L1PrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetInputKey
Definition: xAODMenuWriter.h:82
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::xAODMenuWriter
Algorithm used to write the light-weight xAOD configuration in the Run3 JSON format.
Definition: xAODMenuWriter.h:54
TrigConf::xAODMenuWriter::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_hlt ATLAS_THREAD_SAFE
Definition: xAODMenuWriter.h:116
AthReentrantAlgorithm.h
L1BunchGroupSet.h
TrigConf::xAODMenuWriter::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_smk ATLAS_THREAD_SAFE
Trigger configuration keys that are already converted.
Definition: xAODMenuWriter.h:124
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet >
TrigConf::xAODMenuWriter::m_metaNameJSON_l1
Gaudi::Property< std::string > m_metaNameJSON_l1
Definition: xAODMenuWriter.h:94
TrigConf::xAODMenuWriter::m_L1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
Definition: xAODMenuWriter.h:76
TrigConf::xAODMenuWriter::m_metaNameJSON_hlt
Gaudi::Property< std::string > m_metaNameJSON_hlt
Definition: xAODMenuWriter.h:88
TrigConf::xAODMenuWriter::m_metaNameJSON_l1ps
Gaudi::Property< std::string > m_metaNameJSON_l1ps
Definition: xAODMenuWriter.h:100
IKeyWriterTool.h
HLTMenu.h
TrigConf::xAODMenuWriter::m_bgInputKey
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgInputKey
Definition: xAODMenuWriter.h:85
L1Menu.h
TrigConf::xAODMenuWriter::m_HLTPrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetInputKey
Definition: xAODMenuWriter.h:79
checker_macros.h
Define macros for attributes used to control the static checker.
TrigConf::xAODMenuWriter::m_HLTMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
Definition: xAODMenuWriter.h:70
TrigConf::xAODMenuWriter::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition: xAODMenuWriter.cxx:139
TrigConf::xAODMenuWriter::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_bg ATLAS_THREAD_SAFE
Definition: xAODMenuWriter.h:127
ServiceHandle< StoreGateSvc >
HLTMonitoring.h