ATLAS Offline Software
xAODMenuWriterMT.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TRIGCONFXAOD_XAODMENUWRITERMT_H
8 #define TRIGCONFXAOD_XAODMENUWRITERMT_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  xAODMenuWriterMT( const std::string& name, ISvcLocator* svcLoc );
59 
60  virtual ~xAODMenuWriterMT() 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;
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 xAODMenuWriterMT
133 
134 } // namespace TrigConf
135 
136 #endif // TRIGCONFXAOD_XAODMENUWRITERMT_H
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_l1psk ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:126
HLTPrescalesSet.h
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
TrigConf::xAODMenuWriterMT::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition: xAODMenuWriterMT.cxx:139
TrigConf::xAODMenuWriterMT::m_keyWriterTool
ToolHandle< IKeyWriterTool > m_keyWriterTool
Definition: xAODMenuWriterMT.h:109
TrigConf::xAODMenuWriterMT::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Definition: xAODMenuWriterMT.h:106
TrigConf::xAODMenuWriterMT::m_L1PrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetInputKey
Definition: xAODMenuWriterMT.h:82
TrigConf::xAODMenuWriterMT::m_metaNameJSON_hltps
Gaudi::Property< std::string > m_metaNameJSON_hltps
Definition: xAODMenuWriterMT.h:97
L1PrescalesSet.h
SG::ReadHandleKey< TrigConf::HLTMenu >
TrigConf::xAODMenuWriterMT::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: xAODMenuWriterMT.cxx:45
TrigConf::xAODMenuWriterMT::m_HLTMonitoringKey
SG::ReadHandleKey< TrigConf::HLTMonitoring > m_HLTMonitoringKey
Definition: xAODMenuWriterMT.h:73
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TrigConf::xAODMenuWriterMT::m_bgInputKey
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgInputKey
Definition: xAODMenuWriterMT.h:85
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_l1ps ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:120
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::xAODMenuWriterMT::m_metaNameJSON_l1
Gaudi::Property< std::string > m_metaNameJSON_l1
Definition: xAODMenuWriterMT.h:94
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_smk ATLAS_THREAD_SAFE
Trigger configuration keys that are already converted.
Definition: xAODMenuWriterMT.h:124
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_bg ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:121
TrigConf::xAODMenuWriterMT::m_metaNameJSON_hltmonitoring
Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring
Definition: xAODMenuWriterMT.h:91
TrigConf::xAODMenuWriterMT::~xAODMenuWriterMT
virtual ~xAODMenuWriterMT() override=default
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_l1 ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:118
TrigConf::xAODMenuWriterMT
Algorithm used to write the light-weight xAOD configuration in the Run3 JSON format.
Definition: xAODMenuWriterMT.h:54
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_hltmonitoring ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:117
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TriggerMenuJsonContainer.h
TrigConf::xAODMenuWriterMT::m_L1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
Definition: xAODMenuWriterMT.h:76
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_bg ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:127
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
std::set< uint32_t > m_converted_hltpsk ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:125
TrigConf::name
Definition: HLTChainList.h:35
AthReentrantAlgorithm.h
L1BunchGroupSet.h
TrigConf::xAODMenuWriterMT::m_HLTMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
Definition: xAODMenuWriterMT.h:70
TrigConf::xAODMenuWriterMT::m_metaNameJSON_hlt
Gaudi::Property< std::string > m_metaNameJSON_hlt
Definition: xAODMenuWriterMT.h:88
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet >
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_hlt ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:116
TrigConf::xAODMenuWriterMT::m_mutex
std::mutex m_mutex
The mutex to prevent us from writing more than one configuration at a time.
Definition: xAODMenuWriterMT.h:130
TrigConf::xAODMenuWriterMT::m_metaNameJSON_l1ps
Gaudi::Property< std::string > m_metaNameJSON_l1ps
Definition: xAODMenuWriterMT.h:100
IKeyWriterTool.h
TrigConf::xAODMenuWriterMT::ATLAS_THREAD_SAFE
xAOD::TriggerMenuJsonContainer *m_menuJSON_hltps ATLAS_THREAD_SAFE
Definition: xAODMenuWriterMT.h:119
HLTMenu.h
L1Menu.h
checker_macros.h
Define macros for attributes used to control the static checker.
TrigConf::xAODMenuWriterMT::m_HLTPrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetInputKey
Definition: xAODMenuWriterMT.h:79
TrigConf::xAODMenuWriterMT::xAODMenuWriterMT
xAODMenuWriterMT(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: xAODMenuWriterMT.cxx:38
TrigConf::xAODMenuWriterMT::TrigKey_t
std::pair< uint32_t, std::pair< uint32_t, uint32_t > > TrigKey_t
Trigger configuration key type (used just internally)
Definition: xAODMenuWriterMT.h:113
TrigConf::xAODMenuWriterMT::m_metaNameJSON_bg
Gaudi::Property< std::string > m_metaNameJSON_bg
Definition: xAODMenuWriterMT.h:103
ServiceHandle< StoreGateSvc >
HLTMonitoring.h