ATLAS Offline Software
Loading...
Searching...
No Matches
FileMetaDataCreatorTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2/*
3 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4*/
5#ifndef XAODMETADATACNV_FILEMETADATACREATORTOOL_H
6#define XAODMETADATACNV_FILEMETADATACREATORTOOL_H
7
8// System include(s):
9#include <memory>
10#include <string>
11
12// Infrastructure include(s):
13#include "Gaudi/Property.h"
14#include "GaudiKernel/extends.h"
15#include "GaudiKernel/IIncidentListener.h"
16#include "GaudiKernel/ServiceHandle.h"
21#include "CoralBase/AttributeList.h"
23
24// EDM include(s):
30
31namespace xAODMaker {
32
45 : public extends< AthAlgTool, IAthenaOutputTool, IIncidentListener > {
46 public:
47 using extends::extends;
48
52 StatusCode initialize() override;
53
55 StatusCode finalize() override;
57
61 StatusCode postInitialize() override;
62
64 StatusCode preExecute() override;
65
67 StatusCode preStream() override;
68
74 StatusCode postExecute() override;
75
77 StatusCode preFinalize() override;
79
81
82
84 void handle(const Incident&) override;
86
87 private:
89 Gaudi::Property< std::string > m_key{
90 this,
91 "OutputKey",
92 "FileMetaData",
93 "Key used to write FileMetaData into MetaDataStore"
94 };
95
97 Gaudi::Property< std::string > m_tagInfoKey {
98 this,
99 "TagInfoKey",
100 "/TagInfo",
101 "Key to look up tags from InputMetaDataStore"
102 };
103
105 Gaudi::Property< std::string > m_simInfoKey {
106 this,
107 "SimInfoKey",
108 "/Simulation/Parameters",
109 "Key to look up simulation parameters from InputMetaDataStore"
110 };
111
113 Gaudi::Property< std::string > m_eventInfoKey {
114 this,
115 "EventInfoKey",
116 "EventInfo",
117 "Key to read xAOD::EventInfo from EventStore"
118 };
119
121 Gaudi::Property< std::string > m_dataHeaderKey {
122 this,
123 "StreamName",
124 "",
125 "Key to read data header from event store"
126 };
127
130
133
136 "InputMetaDataStore", name()};
137
139 "MetaDataStore", name()};
140
143 "TagInfoMgr", name()};
144
146 StatusCode updateFromNonEvent();
147
149 void set(const xAOD::FileMetaData::MetaDataType, bool);
150 void set(const xAOD::FileMetaData::MetaDataType, uint32_t);
151 void set(const xAOD::FileMetaData::MetaDataType, float);
152 void set(const xAOD::FileMetaData::MetaDataType, const std::string&);
153
155 void addUniqueValue(const std::string& type, uint32_t value);
156
158 std::unique_ptr< xAOD::FileMetaData > m_info;
159
161 std::unique_ptr< xAOD::FileMetaDataAuxInfo > m_aux;
162
164 bool m_filledNonEvent{false};
165
167 bool m_filledEvent{false};
168
170 bool m_hasInputFile{false};
171
173 std::mutex m_toolMutex;
174}; // class FileMetaDataCreatorTool
175
176} // namespace xAODMaker
177
178#endif // XAODMETADATACNV_FILEMETADATACREATORTOOL_H
This file contains the class definition for the DataHeader and DataHeaderElement classes.
This file contains the class definition for the IAthMetaDataSvc class.
This file contains the class definition for the IAthenaOutputTool class.
This class is a container for conditions data.
Property holding a SG store/key/clid from which a ReadHandle is made.
Tool creating xAOD::FileMetaData information.
std::unique_ptr< xAOD::FileMetaData > m_info
The object created for this output stream.
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Access to TagInfoMgr for tags.
void addUniqueValue(const std::string &type, uint32_t value)
helper function to add values to lists
StatusCode preStream() override
Called before actually streaming objects.
bool m_filledEvent
FileMetaData has been filled with event information.
StatusCode finalize() override
Called at the end of AthenaOutputStream::finalize() (via release()).
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Use MetaDataSvc store interface to support output in EventService.
ServiceHandle< StoreGateSvc > m_metaDataStore
void set(const xAOD::FileMetaData::MetaDataType, bool)
helper method to update FileMetaDataProperty with some checks
StatusCode updateFromNonEvent()
Update from Simulation Parameters and TagInfo.
Gaudi::Property< std::string > m_simInfoKey
Read simulation parameters.
void handle(const Incident &) override
Calls updateFromNonEvent on EndInputFile Clears event information inherited from the parent process o...
Gaudi::Property< std::string > m_tagInfoKey
Read tag information.
ServiceHandle< StoreGateSvc > m_eventStore
DataHeader is produced by another OutputTool, so need StoreGateSvc.
ServiceHandle< StoreGateSvc > m_inputMetaDataStore
Access to the input metadata store.
Gaudi::Property< std::string > m_key
output key for produced xAOD::FileMetaData in MetaDataStore
bool m_filledNonEvent
FileMetaData has been filled with non-event info.
std::mutex m_toolMutex
creation of FileMetaData should happen on a single thread
Gaudi::Property< std::string > m_dataHeaderKey
Key for DataHeader in StoreGateSvc.
bool m_hasInputFile
Input file incident check.
Gaudi::Property< std::string > m_eventInfoKey
Key for xAOD::EventInfo to update MC channel number.
StatusCode postExecute() override
Fill the FileMetaData with event information.
StatusCode preFinalize() override
Write the FileMetaData object to the MetaDataStore via the MetaDataSvc.
StatusCode preExecute() override
Called at the beginning of AthenaOutputStream::execute().
std::unique_ptr< xAOD::FileMetaDataAuxInfo > m_aux
The auxiliary containing the created object.
MetaDataType
Pre-defined metadata value types.