ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODEventFormatCnv
src
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 <regex>
8
#include <set>
9
#include <string>
10
#include <vector>
11
12
// Gaudi/Athena include(s).
13
#include "Gaudi/Property.h"
14
#include "GaudiKernel/ServiceHandle.h"
15
#include "
AthenaBaseComps/AthAlgTool.h
"
16
#include "
AthenaKernel/IAthenaOutputTool.h
"
17
#include "
AthenaKernel/IAthMetaDataSvc.h
"
18
#include "
CxxUtils/checker_macros.h
"
19
20
namespace
xAODMaker
{
30
class
EventFormatStreamHelperTool
:
public
extends< AthAlgTool, IAthenaOutputTool > {
31
public
:
32
using
sgkey_t
=
SG::sgkey_t
;
33
34
// Inherit the base class's constructor(s).
35
using
extends::extends;
36
39
41
StatusCode
initialize
()
override
;
42
44
47
49
StatusCode
postInitialize
()
override
{
return
StatusCode::SUCCESS;}
50
52
StatusCode
preExecute
()
override
{
return
StatusCode::SUCCESS;}
53
55
StatusCode
postExecute
()
override
;
56
58
StatusCode
preFinalize
()
override
{
return
StatusCode::SUCCESS;}
59
61
StatusCode
preStream
()
override
{
return
StatusCode::SUCCESS;}
62
64
65
private
:
67
ServiceHandle< IAthMetaDataSvc >
m_metadataStore
{
this
,
"MetaDataSvc"
,
68
"MetaDataSvc"
,
"The metadata service use to record the xAOD::EventFormat"
};
69
71
ServiceHandle< IClassIDSvc >
m_clidSvc
{
this
,
"ClassIDSvc"
,
"ClassIDSvc"
,
72
"The ClassID service instance to use"
};
73
74
Gaudi::Property< std::string >
m_key
{
this
,
"Key"
,
"EventInfo"
,
75
"Key for EventFormat object in metadata store"
};
76
78
Gaudi::Property< std::vector< std::string > >
m_typeNames
{
this
,
79
"TypeNames"
, {
".*xAOD::.*"
,
"DataVector<SG::AuxElement>"
},
80
"Type names for which metadata entries are added"
};
81
83
Gaudi::Property< std::vector< std::string > >
m_ignoreKeys
{
this
,
84
"IgnoreKeys"
, {
"HLTAutoKey_.*"
},
85
"SG keys that should be ignored during the metadata collection"
};
86
87
Gaudi::Property< std::string >
m_dataHeaderKey
{
this
,
"DataHeaderKey"
,
""
,
88
"Key of DataHeader produced by output stream"
};
89
90
StatusCode
collectFormatMetadata
();
91
93
std::vector< std::regex >
m_ignoreKeyRegexes
;
95
std::vector< std::regex >
m_typeNameRegexes
;
96
119
sgkey_t
lookUpHash
(
120
CLID
primaryClassID,
121
const
std::set< CLID >& classIDs,
122
const
std::vector< sgkey_t >& hashes)
const
;
123
125
std::set< CLID >
m_warnedCLIDs
;
127
std::mutex
m_warnedCLIDsMutex
;
128
130
mutable
std::mutex
m_efMutex
;
131
};
// class EventFormatStreamHelperTool
132
}
// namespace xAODMaker
133
134
#endif
// XAODEVENTFORMATCNV_EVENTFORMATSTREAMHELPERTOOL
AthAlgTool.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IAthMetaDataSvc.h
This file contains the class definition for the IAthMetaDataSvc class.
IAthenaOutputTool.h
This file contains the class definition for the IAthenaOutputTool class.
checker_macros.h
Define macros for attributes used to control the static checker.
ServiceHandle< IAthMetaDataSvc >
xAODMaker::EventFormatStreamHelperTool
Tool creating and maintaining xAOD::EventFormat at the end-of-events.
Definition
EventFormatStreamHelperTool.h:30
xAODMaker::EventFormatStreamHelperTool::m_efMutex
std::mutex m_efMutex
Mutex for the m_ef variable.
Definition
EventFormatStreamHelperTool.h:130
xAODMaker::EventFormatStreamHelperTool::sgkey_t
SG::sgkey_t sgkey_t
Definition
EventFormatStreamHelperTool.h:32
xAODMaker::EventFormatStreamHelperTool::preFinalize
StatusCode preFinalize() override
Called at the beginning of finalize.
Definition
EventFormatStreamHelperTool.h:58
xAODMaker::EventFormatStreamHelperTool::m_dataHeaderKey
Gaudi::Property< std::string > m_dataHeaderKey
Definition
EventFormatStreamHelperTool.h:87
xAODMaker::EventFormatStreamHelperTool::postInitialize
StatusCode postInitialize() override
Called at the end of initialize.
Definition
EventFormatStreamHelperTool.h:49
xAODMaker::EventFormatStreamHelperTool::preExecute
StatusCode preExecute() override
Called at the beginning of execute.
Definition
EventFormatStreamHelperTool.h:52
xAODMaker::EventFormatStreamHelperTool::m_ignoreKeyRegexes
std::vector< std::regex > m_ignoreKeyRegexes
m_ignoreKeys, compiled once in initialize()
Definition
EventFormatStreamHelperTool.h:93
xAODMaker::EventFormatStreamHelperTool::m_typeNames
Gaudi::Property< std::vector< std::string > > m_typeNames
Type names for which a metadata entry should be added.
Definition
EventFormatStreamHelperTool.h:78
xAODMaker::EventFormatStreamHelperTool::collectFormatMetadata
StatusCode collectFormatMetadata()
Definition
EventFormatStreamHelperTool.cxx:57
xAODMaker::EventFormatStreamHelperTool::postExecute
StatusCode postExecute() override
Called at the end of execute.
Definition
EventFormatStreamHelperTool.cxx:46
xAODMaker::EventFormatStreamHelperTool::m_typeNameRegexes
std::vector< std::regex > m_typeNameRegexes
m_typeNames, compiled once in initialize()
Definition
EventFormatStreamHelperTool.h:95
xAODMaker::EventFormatStreamHelperTool::m_metadataStore
ServiceHandle< IAthMetaDataSvc > m_metadataStore
Use the metadata tool interface to store the EventFormat object.
Definition
EventFormatStreamHelperTool.h:67
xAODMaker::EventFormatStreamHelperTool::m_warnedCLIDs
std::set< CLID > m_warnedCLIDs
CLIDs about which warnings have already been printed.
Definition
EventFormatStreamHelperTool.h:125
xAODMaker::EventFormatStreamHelperTool::m_key
Gaudi::Property< std::string > m_key
Definition
EventFormatStreamHelperTool.h:74
xAODMaker::EventFormatStreamHelperTool::m_ignoreKeys
Gaudi::Property< std::vector< std::string > > m_ignoreKeys
StoreGate keys that should be ignored during the metadata collection.
Definition
EventFormatStreamHelperTool.h:83
xAODMaker::EventFormatStreamHelperTool::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
Connection to the CLID service.
Definition
EventFormatStreamHelperTool.h:71
xAODMaker::EventFormatStreamHelperTool::m_warnedCLIDsMutex
std::mutex m_warnedCLIDsMutex
Mutex for the m_warnedCLIDs variable.
Definition
EventFormatStreamHelperTool.h:127
xAODMaker::EventFormatStreamHelperTool::initialize
StatusCode initialize() override
Initialise the tool.
Definition
EventFormatStreamHelperTool.cxx:21
xAODMaker::EventFormatStreamHelperTool::preStream
StatusCode preStream() override
Called at the.
Definition
EventFormatStreamHelperTool.h:61
xAODMaker::EventFormatStreamHelperTool::lookUpHash
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
Definition
EventFormatStreamHelperTool.cxx:152
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition
sgkey_t.h:32
xAODMaker
Definition
StoreGateSvc.h:70
Generated on
for ATLAS Offline Software by
1.17.0