ATLAS Offline Software
TriggerMenuMetaDataTool.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: TriggerMenuMetaDataTool.h 683395 2015-07-16 11:11:56Z krasznaa $
8 #ifndef XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H
9 #define XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H
10 
11 // System include(s):
12 #include <string>
13 #include <memory>
14 #include <mutex>
15 
16 // Gaudi/Athena include(s):
18 #ifndef XAOD_STANDALONE
20 #endif // XAOD_STANDALONE
21 
22 // EDM include(s):
25 
29 
30 namespace xAODMaker {
31 
43 #ifndef XAOD_STANDALONE
44  , public virtual ::IMetaDataTool
45 #endif // XAOD_STANDALONE
46  {
47 
50 
51  public:
53  TriggerMenuMetaDataTool( const std::string& name =
54  "TriggerMenuMetaDataTool" );
55 
57  virtual StatusCode initialize();
58 
59  protected:
62 
65  virtual StatusCode beginInputFile();
66  virtual StatusCode endInputFile();
67 
69  virtual StatusCode beginEvent();
70 
72  virtual StatusCode metaDataStop();
73 
74 #ifndef XAOD_STANDALONE
75  virtual StatusCode beginInputFile(const SG::SourceID&) {return beginInputFile();}
77 
79  virtual StatusCode endInputFile(const SG::SourceID&) {return endInputFile();}
80 
82  virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();}
83 #endif // XAOD_STANDALONE
84 
86 
87  private:
88 
96 
97 
103  StatusCode doCopyxAODTriggerMenuJson(const std::string& inputMetaSGKey,
104  const xAOD::TriggerMenuJsonContainer* copyFrom,
106 
108  StatusCode checkCopyJson(const std::string& inputMetaSGKey,
109  std::unique_ptr< xAOD::TriggerMenuJsonContainer >& internalContainer,
110  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer >& internalAuxContainer);
111 
112  // Helper function to move the internal store to the output file for a given JSON
113  StatusCode checkExportJson(const std::string& outputMetaSGKey,
114  std::unique_ptr< xAOD::TriggerMenuJsonContainer >& internalContainer,
115  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer >& internalAuxContainer);
116 
119 
121  std::string m_inputKey;
123  std::string m_outputKey;
124 
126  std::unique_ptr< xAOD::TriggerMenuContainer > m_menu;
128  std::unique_ptr< xAOD::TriggerMenuAuxContainer > m_menuAux;
129 
131 
134 
135  std::string m_inputKeyJSON_HLT;
136  std::string m_outputKeyJSON_HLT;
137 
140 
141  std::string m_inputKeyJSON_L1;
142  std::string m_outputKeyJSON_L1;
143 
144  std::string m_inputKeyJSON_HLTPS;
146 
147  std::string m_inputKeyJSON_L1PS;
148  std::string m_outputKeyJSON_L1PS;
149 
150  std::string m_inputKeyJSON_BG;
151  std::string m_outputKeyJSON_BG;
152 
153  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hlt;
154  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltAux;
155 
156  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltmonitoring;
157  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltmonitoringAux;
158 
159  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1;
160  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1Aux;
161 
162  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltps;
163  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltpsAux;
164 
165  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1ps;
166  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1psAux;
167 
168  std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_bg;
169  std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_bgAux;
170 
172 
176 
179 
180  }; // class TriggerMenuMetaDataTool
181 
182 } // namespace xAODMaker
183 
184 #endif // XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H
xAODMaker::TriggerMenuMetaDataTool::endInputFile
virtual StatusCode endInputFile(const SG::SourceID &)
Function collecting the metadata from a new input file.
Definition: TriggerMenuMetaDataTool.h:79
xAODMaker::TriggerMenuMetaDataTool::m_inputKey
std::string m_inputKey
The key of the trigger menu in the input file.
Definition: TriggerMenuMetaDataTool.h:121
xAODMaker::TriggerMenuMetaDataTool::m_beginFileIncidentSeen
bool m_beginFileIncidentSeen
Internal status flag showing whether a BeginInputFile incident was seen already.
Definition: TriggerMenuMetaDataTool.h:175
xAODMaker::TriggerMenuMetaDataTool::m_menu
std::unique_ptr< xAOD::TriggerMenuContainer > m_menu
The merged trigger menu container.
Definition: TriggerMenuMetaDataTool.h:126
xAODMaker::TriggerMenuMetaDataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: TriggerMenuMetaDataTool.cxx:79
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_l1Aux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1Aux
Definition: TriggerMenuMetaDataTool.h:160
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_HLTMonitoring
std::string m_outputKeyJSON_HLTMonitoring
Definition: TriggerMenuMetaDataTool.h:139
TriggerMenuJson.h
xAODMaker::TriggerMenuMetaDataTool::beginInputFile
virtual StatusCode beginInputFile()
Function collecting the trigger configuration metadata from the input file.
Definition: TriggerMenuMetaDataTool.cxx:83
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
xAODMaker::TriggerMenuMetaDataTool::metaDataStop
virtual StatusCode metaDataStop(const SG::SourceID &)
Function writing the collected metadata to the output.
Definition: TriggerMenuMetaDataTool.h:82
TriggerMenuAuxContainer.h
xAODMaker::TriggerMenuMetaDataTool::m_menuAux
std::unique_ptr< xAOD::TriggerMenuAuxContainer > m_menuAux
The merged trigger menu auxiliary container.
Definition: TriggerMenuMetaDataTool.h:128
IMetaDataTool.h
This file contains the class definition for the IMetaDataTool class.
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hltmonitoringAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltmonitoringAux
Definition: TriggerMenuMetaDataTool.h:157
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_HLT
std::string m_inputKeyJSON_HLT
Definition: TriggerMenuMetaDataTool.h:135
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_L1PS
std::string m_inputKeyJSON_L1PS
Definition: TriggerMenuMetaDataTool.h:147
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hltmonitoring
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltmonitoring
Definition: TriggerMenuMetaDataTool.h:156
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::TriggerMenuMetaDataTool::checkxAODTriggerMenu
StatusCode checkxAODTriggerMenu()
Perform the R2 data copy from the input metastore to the internal metastore.
Definition: TriggerMenuMetaDataTool.cxx:91
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hltps
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltps
Definition: TriggerMenuMetaDataTool.h:162
xAODMaker::TriggerMenuMetaDataTool::doCopyxAODTriggerMenu
StatusCode doCopyxAODTriggerMenu(const xAOD::TriggerMenuContainer *copyFrom, xAOD::TriggerMenuContainer *copyTo)
Common code to copy and de-duplicate menus from the copyFrom collection into the copyTo collection.
Definition: TriggerMenuMetaDataTool.cxx:118
xAODMaker::TriggerMenuMetaDataTool::endxAODTriggerMenu
StatusCode endxAODTriggerMenu()
Perform the R2 data copy from the internal metastore to the output metastore.
Definition: TriggerMenuMetaDataTool.cxx:233
xAODMaker::TriggerMenuMetaDataTool::beginEvent
virtual StatusCode beginEvent()
Function used to make sure that file openings are not missed.
Definition: TriggerMenuMetaDataTool.cxx:210
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_HLTPS
std::string m_inputKeyJSON_HLTPS
Definition: TriggerMenuMetaDataTool.h:144
xAODMaker::TriggerMenuMetaDataTool::checkCopyJson
StatusCode checkCopyJson(const std::string &inputMetaSGKey, std::unique_ptr< xAOD::TriggerMenuJsonContainer > &internalContainer, std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > &internalAuxContainer)
Helper function to do the R3 data copy to the internal store for a given JSON.
Definition: TriggerMenuMetaDataTool.cxx:157
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_L1PS
std::string m_outputKeyJSON_L1PS
Definition: TriggerMenuMetaDataTool.h:148
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_HLTMonitoring
std::string m_inputKeyJSON_HLTMonitoring
Definition: TriggerMenuMetaDataTool.h:138
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_L1
std::string m_inputKeyJSON_L1
Definition: TriggerMenuMetaDataTool.h:141
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_L1
std::string m_outputKeyJSON_L1
Definition: TriggerMenuMetaDataTool.h:142
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_BG
std::string m_outputKeyJSON_BG
Definition: TriggerMenuMetaDataTool.h:151
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hltpsAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltpsAux
Definition: TriggerMenuMetaDataTool.h:163
xAODMaker::TriggerMenuMetaDataTool::endxAODTriggerMenuJson
StatusCode endxAODTriggerMenuJson()
Perform the R3 data copy from the internal metastore to the output metastore.
Definition: TriggerMenuMetaDataTool.cxx:264
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAODMaker::TriggerMenuMetaDataTool::m_inputKeyJSON_BG
std::string m_inputKeyJSON_BG
Definition: TriggerMenuMetaDataTool.h:150
TriggerMenuJsonAuxContainer.h
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition: AsgToolMacros.h:62
xAODMaker::TriggerMenuMetaDataTool::metaDataStop
virtual StatusCode metaDataStop()
Function writing out the collected metadata.
Definition: TriggerMenuMetaDataTool.cxx:223
TriggerMenuJsonContainer.h
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hltAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltAux
Definition: TriggerMenuMetaDataTool.h:154
xAODMaker::TriggerMenuMetaDataTool::m_outputKey
std::string m_outputKey
The key of the trigger menu for the output file.
Definition: TriggerMenuMetaDataTool.h:123
xAODMaker::TriggerMenuMetaDataTool::checkExportJson
StatusCode checkExportJson(const std::string &outputMetaSGKey, std::unique_ptr< xAOD::TriggerMenuJsonContainer > &internalContainer, std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > &internalAuxContainer)
Definition: TriggerMenuMetaDataTool.cxx:274
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TriggerMenuContainer.h
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_l1ps
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1ps
Definition: TriggerMenuMetaDataTool.h:165
FPEAudit::s_mutex
std::mutex s_mutex
Definition: FPEAuditor.cxx:43
xAODMaker::TriggerMenuMetaDataTool::TriggerMenuMetaDataTool
TriggerMenuMetaDataTool(const std::string &name="TriggerMenuMetaDataTool")
Declare the correct constructor for Athena.
Definition: TriggerMenuMetaDataTool.cxx:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAODMaker::TriggerMenuMetaDataTool::checkxAODTriggerMenuJson
StatusCode checkxAODTriggerMenuJson()
Perform the R3 data copy from the input metastore to the internal metastore.
Definition: TriggerMenuMetaDataTool.cxx:147
xAODMaker::TriggerMenuMetaDataTool::doCopyxAODTriggerMenuJson
StatusCode doCopyxAODTriggerMenuJson(const std::string &inputMetaSGKey, const xAOD::TriggerMenuJsonContainer *copyFrom, xAOD::TriggerMenuJsonContainer *copyTo)
Common code to copy and de-duplicate menus from the copyFrom collection into the copyTo collection.
Definition: TriggerMenuMetaDataTool.cxx:183
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_l1
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1
Definition: TriggerMenuMetaDataTool.h:159
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_bgAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_bgAux
Definition: TriggerMenuMetaDataTool.h:169
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:23
AsgMetadataTool.h
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_bg
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_bg
Definition: TriggerMenuMetaDataTool.h:168
IMetaDataTool
This class provides the interface for MetaDataTools.
Definition: IMetaDataTool.h:21
xAODMaker::TriggerMenuMetaDataTool
Tool taking care of copying the trigger configuration from file to file.
Definition: TriggerMenuMetaDataTool.h:46
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_HLTPS
std::string m_outputKeyJSON_HLTPS
Definition: TriggerMenuMetaDataTool.h:145
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_l1psAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1psAux
Definition: TriggerMenuMetaDataTool.h:166
xAODMaker::TriggerMenuMetaDataTool::initialize
virtual StatusCode initialize()
Function initialising the tool.
Definition: TriggerMenuMetaDataTool.cxx:51
xAODMaker::TriggerMenuMetaDataTool::ATLAS_THREAD_SAFE
static std::mutex s_mutex ATLAS_THREAD_SAFE
Global serial protection over writing to the output store for MP.
Definition: TriggerMenuMetaDataTool.h:178
xAODMaker::TriggerMenuMetaDataTool::m_outputKeyJSON_HLT
std::string m_outputKeyJSON_HLT
Definition: TriggerMenuMetaDataTool.h:136
xAODMaker::TriggerMenuMetaDataTool::m_menuJSON_hlt
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hlt
Definition: TriggerMenuMetaDataTool.h:153