29 return StatusCode::SUCCESS;
35 int eventNumber = ctx.eventID().event_number();
36 int runNumber = ctx.eventID().run_number();
37 ATH_MSG_INFO(
"EventInfo event: " << eventNumber <<
" run: " << runNumber);
40 ATH_CHECK( hits.record( std::make_unique<ExampleHitContainer>() ) );
41 for (
int i = 0; i < 10; i++) {
42 auto hitObj = std::make_unique<ExampleHit>();
43 hitObj->setX(1.2346 + eventNumber * 100 + 3.21 * i);
44 hitObj->setY(-2.346 + runNumber * 100 - 5.6789 * i);
45 hitObj->setZ(34.567 - eventNumber * 100 + 87.6 / (i + 0.456));
46 hitObj->setDetector(
"DummyHitDetector");
47 hits->push_back(std::move (hitObj));
50 if (eventNumber == 14) {
51 ATH_MSG_INFO(
"Now creating ExampleHit alias for event: " << eventNumber);
55 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
This file contains the class definition for the WriteData class.
This file contains the class definition for the ExampleHitContainer class.
Handle class for recording to StoreGate.
SG::WriteHandleKey< ExampleHitContainer > m_exampleHitKey
WriteData(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< ExampleHitContainer > m_aliasKey
virtual StatusCode finalize() override final
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations:
An algorithm that can be simultaneously executed in multiple threads.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual StatusCode execute() override