Tool creating and maintaining xAOD::EventFormat
at the end-of-events.
More...
#include <EventFormatStreamHelperTool.h>
Tool creating and maintaining xAOD::EventFormat
at the end-of-events.
This tool is meant to be added to every xAOD output stream, so that it would maintain xAOD::EventFormat
object every time a new event is written out.
- Author
- Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
-
Frank Berghaus fberg.nosp@m.haus.nosp@m.@anl..nosp@m.gov
Definition at line 29 of file EventFormatStreamHelperTool.h.
◆ sgkey_t
◆ collectFormatMetadata()
StatusCode xAODMaker::EventFormatStreamHelperTool::collectFormatMetadata |
( |
| ) |
|
|
private |
Definition at line 48 of file EventFormatStreamHelperTool.cxx.
54 auto p_event_format = std::make_unique< xAOD::EventFormat >();
55 event_format = p_event_format.
get();
64 if (!dataHeader.isValid()) {
66 return StatusCode::SUCCESS;
73 const std::string&
key = elem.getKey();
74 const CLID classID = elem.getPrimaryClassID();
78 bool ignoreObject =
false;
79 for (
const std::string& ignorePattern :
m_ignoreKeys.value()) {
85 if (ignoreObject)
continue;
104 bool ignoreObject =
true;
105 for (
const std::string& typePattern :
m_typeNames.value()) {
107 ignoreObject =
false;
111 if (ignoreObject)
continue;
117 lookUpHash(classID, elem.getClassIDs(), elem.getHashes());
121 std::lock_guard< std::mutex > lock(
m_efMutex);
130 <<
", typeName = \"" <<
typeName <<
"\""
131 <<
", hash = 0x" << std::hex << std::setw(8)
132 << std::setfill(
'0') <<
hash);
139 return StatusCode::SUCCESS;
◆ initialize()
StatusCode xAODMaker::EventFormatStreamHelperTool::initialize |
( |
| ) |
|
|
override |
Initialise the tool.
Definition at line 21 of file EventFormatStreamHelperTool.cxx.
27 const Gaudi::Algorithm *parentAlg =
28 dynamic_cast< const Gaudi::Algorithm*
>(
parent());
33 return StatusCode::SUCCESS;
◆ lookUpHash()
look up hash corresponding to primary class ID
We can retrieve the list of all class IDs and hashes corresponding to an element in the output stream. The two collections should be of the same size. Element one of the classIDs
corresponds to element one of the hashes
and so on. This function steps through the two collections and returns the hash corresponding to the classID matching the primaryClassID
.
- Parameters
-
[in] | primaryClassID | the primary class ID |
[in] | classIDs | the set of classIDs associated with a DataHeaderElement |
[in] | hashes | the vector of hashes associated with a DataHeaderElement |
- Warning
- classIDs and hashes must have the same number of entries
- Exceptions
-
std::runtime_error | classIDs and hashes not the same size |
std::range_error | primaryClassID not found in classIDs |
- Returns
- the hash corresponding to the primaryClassID
Definition at line 143 of file EventFormatStreamHelperTool.cxx.
148 if (classIDs.size() !=
hashes.size())
149 throw(std::runtime_error(
"CLID and hash sets not equal in size"));
151 auto it = classIDs.find(primaryClassID);
154 if (
it == classIDs.end())
155 throw(std::range_error(
"Primary class ID not in list of class IDs"));
◆ postExecute()
StatusCode xAODMaker::EventFormatStreamHelperTool::postExecute |
( |
| ) |
|
|
override |
◆ postInitialize()
StatusCode xAODMaker::EventFormatStreamHelperTool::postInitialize |
( |
| ) |
|
|
inlineoverride |
◆ preExecute()
StatusCode xAODMaker::EventFormatStreamHelperTool::preExecute |
( |
| ) |
|
|
inlineoverride |
◆ preFinalize()
StatusCode xAODMaker::EventFormatStreamHelperTool::preFinalize |
( |
| ) |
|
|
inlineoverride |
◆ preStream()
StatusCode xAODMaker::EventFormatStreamHelperTool::preStream |
( |
| ) |
|
|
inlineoverride |
◆ m_clidSvc
ServiceHandle< IClassIDSvc > xAODMaker::EventFormatStreamHelperTool::m_clidSvc |
|
private |
Initial value:{ this, "ClassIDSvc", "ClassIDSvc",
"The ClassID service instance to use" }
Connection to the CLID service.
Definition at line 70 of file EventFormatStreamHelperTool.h.
◆ m_dataHeaderKey
Gaudi::Property< std::string > xAODMaker::EventFormatStreamHelperTool::m_dataHeaderKey |
|
private |
◆ m_efMutex
std::mutex xAODMaker::EventFormatStreamHelperTool::m_efMutex |
|
mutableprivate |
◆ m_ignoreKeys
Gaudi::Property< std::vector< std::string > > xAODMaker::EventFormatStreamHelperTool::m_ignoreKeys |
|
private |
Initial value:{ this,
"IgnoreKeys", { "HLTAutoKey_.*" },
"SG keys that should be ignored during the metadata collection" }
StoreGate keys that should be ignored during the metadata collection.
Definition at line 82 of file EventFormatStreamHelperTool.h.
◆ m_key
Gaudi::Property< std::string > xAODMaker::EventFormatStreamHelperTool::m_key |
|
private |
◆ m_metadataStore
Initial value:{ this, "MetaDataSvc",
"MetaDataSvc", "The metadata service use to record the xAOD::EventFormat" }
Use the metadata tool interface to store the EventFormat object.
Definition at line 66 of file EventFormatStreamHelperTool.h.
◆ m_typeNames
Gaudi::Property< std::vector< std::string > > xAODMaker::EventFormatStreamHelperTool::m_typeNames |
|
private |
Initial value:{ this,
"TypeNames", { ".*xAOD::.*", "DataVector<SG::AuxElement>" },
"Type names for which metadata entries are added" }
Type names for which a metadata entry should be added.
Definition at line 77 of file EventFormatStreamHelperTool.h.
◆ m_warnedCLIDs
std::set< CLID > xAODMaker::EventFormatStreamHelperTool::m_warnedCLIDs |
|
private |
◆ m_warnedCLIDsMutex
std::mutex xAODMaker::EventFormatStreamHelperTool::m_warnedCLIDsMutex |
|
private |
The documentation for this class was generated from the following files: