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
85 void handle(const Incident&) override;
87
88 private:
90 Gaudi::Property< std::string > m_key{
91 this,
92 "OutputKey",
93 "FileMetaData",
94 "Key used to write FileMetaData into MetaDataStore"
95 };
96
98 Gaudi::Property< std::string > m_tagInfoKey {
99 this,
100 "TagInfoKey",
101 "/TagInfo",
102 "Key to look up tags from InputMetaDataStore"
103 };
104
106 Gaudi::Property< std::string > m_simInfoKey {
107 this,
108 "SimInfoKey",
109 "/Simulation/Parameters",
110 "Key to look up simulation parameters from InputMetaDataStore"
111 };
112
114 Gaudi::Property< std::string > m_eventInfoKey {
115 this,
116 "EventInfoKey",
117 "EventInfo",
118 "Key to read xAOD::EventInfo from EventStore"
119 };
120
122 Gaudi::Property< std::string > m_dataHeaderKey {
123 this,
124 "StreamName",
125 "",
126 "Key to read data header from event store"
127 };
128
131
134
137 "InputMetaDataStore", name()};
138
140 "MetaDataStore", name()};
141
144 "TagInfoMgr", name()};
145
147 StatusCode updateFromNonEvent();
148
150 void set(const xAOD::FileMetaData::MetaDataType, bool);
151 void set(const xAOD::FileMetaData::MetaDataType, uint32_t);
152 void set(const xAOD::FileMetaData::MetaDataType, float);
153 void set(const xAOD::FileMetaData::MetaDataType, const std::string&);
154
156 void addUniqueValue(const std::string& type, uint32_t value);
157
159 std::unique_ptr< xAOD::FileMetaData > m_info;
160
162 std::unique_ptr< xAOD::FileMetaDataAuxInfo > m_aux;
163
165 bool m_filledNonEvent{false};
166
168 bool m_filledEvent{false};
169
171 std::mutex m_toolMutex;
172}; // class FileMetaDataCreatorTool
173
174} // namespace xAODMaker
175
176#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
Handle BeginInputFile incident after MetaDataSvc.
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.
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.