ATLAS Offline Software
Loading...
Searching...
No Matches
MetaReaderAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
3 */
4// $Id$
11
12
13#include "MetaReaderAlg.h"
16
17namespace DMTest {
18
19
25MetaReaderAlg::MetaReaderAlg (const std::string &name, ISvcLocator *pSvcLocator)
26 : AthReentrantAlgorithm (name, pSvcLocator),
27 m_s1Key ("MetaS1"),
28 m_cKey ("MetaC")
29{
30}
31
32
37{
38 ATH_CHECK( m_s1Key.initialize() );
39 ATH_CHECK( m_cKey.initialize() );
40 return StatusCode::SUCCESS;
41}
42
43
48StatusCode MetaReaderAlg::execute (const EventContext& ctx) const
49{
50 // Get proper dbkey.
51 const DataHeader* thisDH = nullptr;
52 ATH_CHECK( evtStore()->retrieve(thisDH, "EventSelector") );
53 std::string sid = thisDH->begin()->getToken()->dbID().toString();
54
55 // Make a new key with the correct dbkey.
57 ATH_CHECK( s1Key.initialize() );
58 SG::ReadMetaHandle<DMTest::S1> s1 (s1Key, ctx);
59 ATH_MSG_INFO ("MetaS1: " << s1->m_x);
60
61 // Make a new key with the correct dbkey.
63 ATH_CHECK( cKey.initialize() );
65 ATH_MSG_INFO ("MetaC: " << c->anInt() << " " << c->aFloat());
66 return StatusCode::SUCCESS;
67}
68
69
70} // 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.
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