ATLAS Offline Software
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 
31 namespace 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  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 
141  "TagInfoMgr", name()};
142 
145 
147  void set(const xAOD::FileMetaData::MetaDataType, bool);
149  void set(const xAOD::FileMetaData::MetaDataType, float);
150  void set(const xAOD::FileMetaData::MetaDataType, const std::string&);
151 
153  void addUniqueValue(const std::string& type, uint32_t value);
154 
156  std::unique_ptr< xAOD::FileMetaData > m_info;
157 
159  std::unique_ptr< xAOD::FileMetaDataAuxInfo > m_aux;
160 
162  bool m_filledNonEvent{false};
163 
165  bool m_filledEvent{false};
166 
169 }; // class FileMetaDataCreatorTool
170 
171 } // namespace xAODMaker
172 
173 #endif // XAODMETADATACNV_FILEMETADATACREATORTOOL_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
xAODMaker::FileMetaDataCreatorTool::postExecute
StatusCode postExecute() override
Fill the FileMetaData with event information.
Definition: FileMetaDataCreatorTool.cxx:146
xAODMaker::FileMetaDataCreatorTool::finalize
StatusCode finalize() override
Called at the end of AthenaOutputStream::finalize() (via release()).
Definition: FileMetaDataCreatorTool.cxx:141
xAODMaker::FileMetaDataCreatorTool::m_toolMutex
std::mutex m_toolMutex
creation of FileMetaData should happen on a single thread
Definition: FileMetaDataCreatorTool.h:168
xAODMaker::FileMetaDataCreatorTool::m_eventStore
ServiceHandle< StoreGateSvc > m_eventStore
DataHeader is produced by another OutputTool, so need StoreGateSvc.
Definition: FileMetaDataCreatorTool.h:130
xAODMaker::FileMetaDataCreatorTool::m_aux
std::unique_ptr< xAOD::FileMetaDataAuxInfo > m_aux
The auxiliary containing the created object.
Definition: FileMetaDataCreatorTool.h:159
xAODMaker::FileMetaDataCreatorTool::preFinalize
StatusCode preFinalize() override
Write the FileMetaData object to the MetaDataStore via the MetaDataSvc.
Definition: FileMetaDataCreatorTool.cxx:88
xAODMaker::FileMetaDataCreatorTool
Tool creating xAOD::FileMetaData information.
Definition: FileMetaDataCreatorTool.h:45
xAODMaker::FileMetaDataCreatorTool::preStream
StatusCode preStream() override
Called before actually streaming objects.
Definition: FileMetaDataCreatorTool.cxx:83
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
IAthenaOutputTool.h
This file contains the class definition for the IAthenaOutputTool class.
IAthMetaDataSvc.h
This file contains the class definition for the IAthMetaDataSvc class.
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
xAODMaker::FileMetaDataCreatorTool::m_key
Gaudi::Property< std::string > m_key
output key for produced xAOD::FileMetaData in MetaDataStore
Definition: FileMetaDataCreatorTool.h:90
ITagInfoMgr.h
FileMetaDataAuxInfo.h
athena.value
value
Definition: athena.py:124
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::FileMetaDataCreatorTool::m_simInfoKey
Gaudi::Property< std::string > m_simInfoKey
Read simulation parameters.
Definition: FileMetaDataCreatorTool.h:106
xAODMaker::FileMetaDataCreatorTool::m_info
std::unique_ptr< xAOD::FileMetaData > m_info
The object created for this output stream.
Definition: FileMetaDataCreatorTool.h:156
xAODMaker::FileMetaDataCreatorTool::handle
void handle(const Incident &) override
Handle BeginInputFile incident after MetaDataSvc.
Definition: FileMetaDataCreatorTool.cxx:62
xAODMaker::FileMetaDataCreatorTool::m_eventInfoKey
Gaudi::Property< std::string > m_eventInfoKey
Key for xAOD::EventInfo to update MC channel number.
Definition: FileMetaDataCreatorTool.h:114
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAODMaker::FileMetaDataCreatorTool::updateFromNonEvent
StatusCode updateFromNonEvent()
Update from Simulation Parameters and TagInfo.
Definition: FileMetaDataCreatorTool.cxx:203
AthAlgTool.h
xAODMaker::FileMetaDataCreatorTool::m_inputMetaDataStore
ServiceHandle< StoreGateSvc > m_inputMetaDataStore
Access to the input metadata store.
Definition: FileMetaDataCreatorTool.h:136
xAODMaker::FileMetaDataCreatorTool::m_metaDataSvc
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Use MetaDataSvc store interface to support output in EventService.
Definition: FileMetaDataCreatorTool.h:133
xAOD::FileMetaData_v1::MetaDataType
MetaDataType
Pre-defined metadata value types.
Definition: FileMetaData_v1.h:54
DataHeader.h
This file contains the class definition for the DataHeader and DataHeaderElement classes.
xAODMaker::FileMetaDataCreatorTool::m_dataHeaderKey
Gaudi::Property< std::string > m_dataHeaderKey
Key for DataHeader in StoreGateSvc.
Definition: FileMetaDataCreatorTool.h:122
xAODMaker::FileMetaDataCreatorTool::postInitialize
StatusCode postInitialize() override
Definition: FileMetaDataCreatorTool.cxx:73
IOVMetaDataContainer.h
This class is a container for conditions data. It is intended to be used to store conditions data fro...
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAODMaker::FileMetaDataCreatorTool::m_tagInfoKey
Gaudi::Property< std::string > m_tagInfoKey
Read tag information.
Definition: FileMetaDataCreatorTool.h:98
EventInfo.h
xAODMaker::FileMetaDataCreatorTool::m_filledNonEvent
bool m_filledNonEvent
FileMetaData has been filled with non-event info.
Definition: FileMetaDataCreatorTool.h:162
FileMetaData.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAODMaker::FileMetaDataCreatorTool::preExecute
StatusCode preExecute() override
Called at the beginning of AthenaOutputStream::execute().
Definition: FileMetaDataCreatorTool.cxx:78
xAODMaker::FileMetaDataCreatorTool::m_tagInfoMgr
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Access to TagInfoMgr for tags.
Definition: FileMetaDataCreatorTool.h:140
xAODMaker::FileMetaDataCreatorTool::initialize
StatusCode initialize() override
Definition: FileMetaDataCreatorTool.cxx:28
xAODMaker::FileMetaDataCreatorTool::m_filledEvent
bool m_filledEvent
FileMetaData has been filled with event information.
Definition: FileMetaDataCreatorTool.h:165
xAODMaker::FileMetaDataCreatorTool::set
void set(const xAOD::FileMetaData::MetaDataType, bool)
helper method to update FileMetaDataProperty with some checks
Definition: FileMetaDataCreatorTool.cxx:346
ServiceHandle< StoreGateSvc >
xAODMaker::FileMetaDataCreatorTool::addUniqueValue
void addUniqueValue(const std::string &type, uint32_t value)
helper function to add values to lists
Definition: FileMetaDataCreatorTool.cxx:407