ATLAS Offline Software
Loading...
Searching...
No Matches
EventFormatStreamHelperTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2/* Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */
3#ifndef XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL
4#define XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL
5
6#include <mutex>
7#include <set>
8#include <string>
9#include <vector>
10
11// Gaudi/Athena include(s).
12#include "Gaudi/Property.h"
13#include "GaudiKernel/ServiceHandle.h"
18
19namespace xAODMaker {
29class EventFormatStreamHelperTool : public extends< AthAlgTool, IAthenaOutputTool > {
30 public:
32
33 // Inherit the base class's constructor(s).
34 using extends::extends;
35
38
40 StatusCode initialize() override;
41
43
46
48 StatusCode postInitialize() override {return StatusCode::SUCCESS;}
49
51 StatusCode preExecute() override {return StatusCode::SUCCESS;}
52
54 StatusCode postExecute() override;
55
57 StatusCode preFinalize() override {return StatusCode::SUCCESS;}
58
60 StatusCode preStream() override {return StatusCode::SUCCESS;}
61
63
64 private:
67 "MetaDataSvc", "The metadata service use to record the xAOD::EventFormat" };
68
70 ServiceHandle< IClassIDSvc > m_clidSvc{ this, "ClassIDSvc", "ClassIDSvc",
71 "The ClassID service instance to use" };
72
73 Gaudi::Property< std::string > m_key{ this, "Key", "EventInfo",
74 "Key for EventFormat object in metadata store" };
75
77 Gaudi::Property< std::vector< std::string > > m_typeNames{ this,
78 "TypeNames", { ".*xAOD::.*", "DataVector<SG::AuxElement>" },
79 "Type names for which metadata entries are added" };
80
82 Gaudi::Property< std::vector< std::string > > m_ignoreKeys{ this,
83 "IgnoreKeys", { "HLTAutoKey_.*" },
84 "SG keys that should be ignored during the metadata collection" };
85
86 Gaudi::Property< std::string > m_dataHeaderKey{this, "DataHeaderKey", "",
87 "Key of DataHeader produced by output stream" };
88
89 StatusCode collectFormatMetadata();
90
114 CLID primaryClassID,
115 const std::set< CLID >& classIDs,
116 const std::vector< sgkey_t >& hashes) const;
117
119 std::set< CLID > m_warnedCLIDs;
122
124 mutable std::mutex m_efMutex;
125}; // class EventFormatStreamHelperTool
126} // namespace xAODMaker
127
128#endif // XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL
uint32_t CLID
The Class ID type.
This file contains the class definition for the IAthMetaDataSvc class.
This file contains the class definition for the IAthenaOutputTool class.
Define macros for attributes used to control the static checker.
Tool creating and maintaining xAOD::EventFormat at the end-of-events.
std::mutex m_efMutex
Mutex for the m_ef variable.
StatusCode preFinalize() override
Called at the beginning of finalize.
StatusCode postInitialize() override
Called at the end of initialize.
StatusCode preExecute() override
Called at the beginning of execute.
Gaudi::Property< std::vector< std::string > > m_typeNames
Type names for which a metadata entry should be added.
StatusCode postExecute() override
Called at the end of execute.
ServiceHandle< IAthMetaDataSvc > m_metadataStore
Use the metadata tool interface to store the EventFormat object.
std::set< CLID > m_warnedCLIDs
CLIDs about which warnings have already been printed.
Gaudi::Property< std::vector< std::string > > m_ignoreKeys
StoreGate keys that should be ignored during the metadata collection.
ServiceHandle< IClassIDSvc > m_clidSvc
Connection to the CLID service.
std::mutex m_warnedCLIDsMutex
Mutex for the m_warnedCLIDs variable.
StatusCode initialize() override
Initialise the tool.
StatusCode preStream() override
Called at the.
sgkey_t lookUpHash(CLID primaryClassID, const std::set< CLID > &classIDs, const std::vector< sgkey_t > &hashes) const
look up hash corresponding to primary class ID
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32