ATLAS Offline Software
Loading...
Searching...
No Matches
AlgT.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "AlgT.h"
8
9AlgT::AlgT( const std::string& name,
10 ISvcLocator* pSvcLocator ) :
11 ::AthAlgorithm( name, pSvcLocator )
12{}
13
14//---------------------------------------------------------------------------
15
16StatusCode AlgT::initialize() {
17 ATH_MSG_DEBUG("initialize " << name());
18
19 if (m_rdh1.key() != "") ATH_CHECK( m_rdh1.initialize() );
20 ATH_CHECK( m_wrh1.initialize() );
21 ATH_CHECK( m_evt.initialize() );
22
23 ATH_CHECK( m_tool1.retrieve() );
24 ATH_CHECK( m_tool2.retrieve() );
25 ATH_CHECK( m_tool3.retrieve() );
26
27 return StatusCode::SUCCESS;
28}
29
30//---------------------------------------------------------------------------
31
32StatusCode AlgT::execute() {
33
34 ATH_MSG_DEBUG("execute " << name());
35
37 ATH_MSG_INFO(" EventInfo: r: " << evt->runNumber()
38 << " e: " << evt->eventNumber() );
39
40
42 ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> (10000 + evt->eventNumber())));
43
44 ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() );
45
46
47 ATH_CHECK(m_tool1->doSomething());
48 ATH_CHECK(m_tool2->doSomething());
49 ATH_CHECK(m_tool3->doSomething());
50
51
52 return StatusCode::SUCCESS;
53
54}
55
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
virtual StatusCode initialize() override
Definition AlgT.cxx:16
ToolHandle< IHiveTool > m_tool1
Definition AlgT.h:37
virtual StatusCode execute() override
Definition AlgT.cxx:32
ToolHandle< IHiveTool > m_tool2
Definition AlgT.h:38
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition AlgT.h:34
AlgT(const std::string &name, ISvcLocator *pSvcLocator)
Definition AlgT.cxx:9
ToolHandle< IHiveTool > m_tool3
Definition AlgT.h:39
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition AlgT.h:32
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition AlgT.h:33
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.