ATLAS Offline Software
Loading...
Searching...
No Matches
MetaReaderAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
3 */
10
11
12#include "MetaReaderAlg.h"
15
16namespace DMTest {
17
18
24MetaReaderAlg::MetaReaderAlg (const std::string &name, ISvcLocator *pSvcLocator)
25 : AthReentrantAlgorithm (name, pSvcLocator),
26 m_s1Key ("MetaS1"),
27 m_cKey ("MetaC")
28{
29}
30
31
36{
37 ATH_CHECK( m_s1Key.initialize() );
38 ATH_CHECK( m_cKey.initialize() );
39 return StatusCode::SUCCESS;
40}
41
42
47StatusCode MetaReaderAlg::execute (const EventContext& ctx) const
48{
49 // Get proper dbkey.
50 const DataHeader* thisDH = nullptr;
51 ATH_CHECK( evtStore()->retrieve(thisDH, "EventSelector") );
52 std::string sid = thisDH->begin()->getToken()->dbID().toString();
53
54 // Make a new key with the correct dbkey.
56 ATH_CHECK( s1Key.initialize() );
57 SG::ReadMetaHandle<DMTest::S1> s1 (s1Key, ctx);
58 ATH_MSG_INFO ("MetaS1: {}", s1->m_x);
59
60 // Make a new key with the correct dbkey.
62 ATH_CHECK( cKey.initialize() );
64 ATH_MSG_INFO ("MetaC: {} {}", c->anInt(), c->aFloat());
65 return StatusCode::SUCCESS;
66}
67
68
69} // namespace DMTest
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
This file contains the class definition for the DataHeader and DataHeaderElement classes.
For symlink tests.
ServiceHandle< StoreGateSvc > & evtStore()
An algorithm that can be simultaneously executed in multiple threads.
MetaReaderAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadMetaHandleKey< DMTest::C > m_cKey
SG::ReadMetaHandleKey< DMTest::S1 > m_s1Key
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute method.
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
This class provides the layout for summary information stored for data written to POOL.
Definition DataHeader.h:123
std::vector< DataHeaderElement >::const_iterator begin() const
StatusCode initialize()
Definition B.h:23