ATLAS Offline Software
EventFormatMetaDataTool.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 /* Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */
3 
4 #ifndef XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL
5 #define XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL
6 
7 // System include(s):
8 #include <string>
9 #include <memory>
10 #include <mutex>
11 
12 // Gaudi/Athena include(s):
13 #include "Gaudi/Property.h"
14 #include "GaudiKernel/ServiceHandle.h"
18 #include "StoreGate/StoreGateSvc.h"
19 
20 // EDM include(s):
22 
23 namespace xAODMaker {
24 
35 class EventFormatMetaDataTool : public extends<::AthAlgTool, IMetaDataTool> {
36  public:
38  EventFormatMetaDataTool(const std::string& type,
39  const std::string& name,
40  const IInterface* parent);
41 
43  virtual StatusCode initialize() override;
44 
46  virtual StatusCode beginInputFile(const SG::SourceID&) override {return beginInputFile();}
47 
49  virtual StatusCode endInputFile(const SG::SourceID&) override {return endInputFile();}
50 
52  virtual StatusCode metaDataStop(const SG::SourceID&) {return metaDataStop();}
53 
55  virtual StatusCode beginInputFile();
56 
59  virtual StatusCode endInputFile() {return StatusCode::SUCCESS;}
60 
62  virtual StatusCode metaDataStop() override;
63 
64  private:
67 
70  "StoreGateSvc/InputMetaDataStore", name()};
71 
74  "MetaDataSvc", name()};
75 
77  Gaudi::Property<std::vector<std::string> > m_keys{ this, "Keys", {},
78  "(optional) list of keys to copy, all if empty. default: empty"};
79 
82 }; // class EventFormatMetaDataTool
83 } // namespace xAODMaker
84 
85 #endif // XAODEVENTFORMATCNV_EVENTFORMATMETADATATOOL
xAODMaker::EventFormatMetaDataTool::endInputFile
virtual StatusCode endInputFile(const SG::SourceID &) override
Function collecting the metadata from a new input file.
Definition: EventFormatMetaDataTool.h:49
xAODMaker::EventFormatMetaDataTool::EventFormatMetaDataTool
EventFormatMetaDataTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: EventFormatMetaDataTool.cxx:20
IAthMetaDataSvc.h
This file contains the class definition for the IAthMetaDataSvc class.
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
xAODMaker::EventFormatMetaDataTool::m_keys
Gaudi::Property< std::vector< std::string > > m_keys
(optional) list of keys to copy, all if empty, default: empty
Definition: EventFormatMetaDataTool.h:77
IMetaDataTool.h
This file contains the class definition for the IMetaDataTool class.
xAODMaker::EventFormatMetaDataTool::m_outputMutex
std::mutex m_outputMutex
MetaDataStop need to wait for ongoing writes.
Definition: EventFormatMetaDataTool.h:81
xAODMaker
Definition: StoreGateSvc.h:70
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAODMaker::EventFormatMetaDataTool::m_outputMetaStore
ServiceHandle< IAthMetaDataSvc > m_outputMetaStore
Connection to the output metadata store.
Definition: EventFormatMetaDataTool.h:73
AthAlgTool.h
xAODMaker::EventFormatMetaDataTool::metaDataStop
virtual StatusCode metaDataStop() override
Wait for metadata write operations to finish, then return SUCCESS.
Definition: EventFormatMetaDataTool.cxx:60
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAODMaker::EventFormatMetaDataTool::m_inputMetaStore
ServiceHandle< ::StoreGateSvc > m_inputMetaStore
Connection to the input metadata store.
Definition: EventFormatMetaDataTool.h:69
xAODMaker::EventFormatMetaDataTool::beginInputFile
virtual StatusCode beginInputFile(const SG::SourceID &) override
Function collecting the metadata from a new input file.
Definition: EventFormatMetaDataTool.h:46
xAODMaker::EventFormatMetaDataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: EventFormatMetaDataTool.h:59
xAODMaker::EventFormatMetaDataTool
Tool taking care of copying the event format object from file to file.
Definition: EventFormatMetaDataTool.h:35
EventFormat.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
xAODMaker::EventFormatMetaDataTool::collectMetaData
StatusCode collectMetaData()
Function collecting the event format metadata from the input file.
Definition: EventFormatMetaDataTool.cxx:68
xAODMaker::EventFormatMetaDataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: EventFormatMetaDataTool.cxx:47
SG::SourceID
std::string SourceID
Definition: AthenaKernel/AthenaKernel/SourceID.h:25
xAODMaker::EventFormatMetaDataTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: EventFormatMetaDataTool.cxx:26
xAODMaker::EventFormatMetaDataTool::metaDataStop
virtual StatusCode metaDataStop(const SG::SourceID &)
Wait for metadata write operations to finish, then returns SUCCESS.
Definition: EventFormatMetaDataTool.h:52
StoreGateSvc.h
ServiceHandle
Definition: ClusterMakerTool.h:37