ATLAS Offline Software
HiveAlgR.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "HiveAlgR.h"
6 #include "GaudiKernel/ServiceHandle.h"
7 
8 HiveAlgR::HiveAlgR( const std::string& name,
9  ISvcLocator* pSvcLocator ) :
10  ::AthReentrantAlgorithm( name, pSvcLocator )
11 {}
12 
13 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18 
19  info() << "initialize: " << index() << endmsg;
20 
23 
24  return StatusCode::SUCCESS;
25 }
26 
27 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
29  info() << "finalize: " << index() << endmsg;
30  return StatusCode::SUCCESS;
31 }
32 
33 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34 StatusCode HiveAlgR::execute(const EventContext& ctx) const {
35 
36  info() << "execute: " << index() << " on " << ctx << endmsg;
37 
39  ATH_MSG_INFO(" EventInfo: r: " << evt->runNumber()
40  << " e: " << evt->eventNumber() );
41 
43  ATH_CHECK(wh1.record(std::make_unique<HiveDataObj>(10000 +evt->eventNumber()*100)));
44 
45  ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() );
46 
47  return StatusCode::SUCCESS;
48 
49 }
50 
grepfile.info
info
Definition: grepfile.py:38
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HiveAlgR::HiveAlgR
HiveAlgR(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveAlgR.cxx:8
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
HiveAlgR::execute
virtual StatusCode execute(const EventContext &) const override
Definition: HiveAlgR.cxx:34
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
HiveAlgR::~HiveAlgR
~HiveAlgR()
Definition: HiveAlgR.cxx:14
HiveAlgR::initialize
virtual StatusCode initialize() override
Definition: HiveAlgR.cxx:17
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HiveAlgR.h
Re-entrant Algorithm that reads the EventInfo obj, and writes a HiveDataObjs to the store.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
HiveAlgR::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition: HiveAlgR.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HiveAlgR::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: HiveAlgR.h:41
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DeMoScan.index
string index
Definition: DeMoScan.py:362
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
HiveDataObj::val
void val(int i)
Definition: HiveDataObj.h:22
HiveAlgR::finalize
virtual StatusCode finalize() override
Definition: HiveAlgR.cxx:28