ATLAS Offline Software
Loading...
Searching...
No Matches
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
30namespace 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
76 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
90 StatusCode checkxAODTriggerMenu();
92 StatusCode endxAODTriggerMenu();
94 StatusCode doCopyxAODTriggerMenu(const xAOD::TriggerMenuContainer* copyFrom,
96
97
99 StatusCode checkxAODTriggerMenuJson();
101 StatusCode endxAODTriggerMenuJson();
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
137
140
141 std::string m_inputKeyJSON_L1;
143
146
149
150 std::string m_inputKeyJSON_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
178 static std::mutex s_mutex ATLAS_THREAD_SAFE;
179
180 }; // class TriggerMenuMetaDataTool
181
182} // namespace xAODMaker
183
184#endif // XAODTRIGGERCNV_TRIGGERMENUMETADATATOOL_H
#define ASG_TOOL_CLASS0(CLASSNAME)
This file contains the class definition for the IMetaDataTool class.
This class provides the interface for MetaDataTools.
Base class for dual-use tools that provide file metadata access.
virtual StatusCode beginEvent()
Function used to make sure that file openings are not missed.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1
virtual StatusCode endInputFile(const SG::SourceID &)
Function collecting the metadata from a new input file.
StatusCode checkxAODTriggerMenu()
Perform the R2 data copy from the input metastore to the internal metastore.
std::string m_outputKey
The key of the trigger menu for the output file.
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_bgAux
virtual StatusCode metaDataStop(const SG::SourceID &)
Function writing the collected metadata to the output.
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.
virtual StatusCode initialize()
Function initialising the tool.
virtual StatusCode beginInputFile(const SG::SourceID &)
Function collecting the metadata from a new input file.
std::unique_ptr< xAOD::TriggerMenuAuxContainer > m_menuAux
The merged trigger menu auxiliary container.
std::string m_inputKey
The key of the trigger menu in the input file.
bool m_beginFileIncidentSeen
Internal status flag showing whether a BeginInputFile incident was seen already.
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.
StatusCode checkxAODTriggerMenuJson()
Perform the R3 data copy from the input metastore to the internal metastore.
virtual StatusCode metaDataStop()
Function writing out the collected metadata.
virtual StatusCode beginInputFile()
Function collecting the trigger configuration metadata from the input file.
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.
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hlt
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltpsAux
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_bg
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltmonitoringAux
StatusCode checkExportJson(const std::string &outputMetaSGKey, std::unique_ptr< xAOD::TriggerMenuJsonContainer > &internalContainer, std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > &internalAuxContainer)
std::unique_ptr< xAOD::TriggerMenuContainer > m_menu
The merged trigger menu container.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltps
static std::mutex s_mutex ATLAS_THREAD_SAFE
Global serial protection over writing to the output store for MP.
StatusCode endxAODTriggerMenuJson()
Perform the R3 data copy from the internal metastore to the output metastore.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_l1ps
StatusCode endxAODTriggerMenu()
Perform the R2 data copy from the internal metastore to the output metastore.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_menuJSON_hltmonitoring
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1psAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_hltAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_menuJSON_l1Aux
TriggerMenuMetaDataTool(const std::string &name="TriggerMenuMetaDataTool")
Declare the correct constructor for Athena.
TriggerMenuContainer_v1 TriggerMenuContainer
Define the latest version of the trigger menu container class.
TriggerMenuJsonContainer_v1 TriggerMenuJsonContainer