ATLAS Offline Software
Loading...
Searching...
No Matches
AlgE.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "AlgE.h"
8
9//---------------------------------------------------------------------------
10
11StatusCode AlgE::initialize() {
12 ATH_MSG_DEBUG("initialize " << name());
13
14 ATH_CHECK( m_rdh1.initialize() );
15 ATH_CHECK( m_rch1.initialize() );
16 ATH_CHECK( m_rch2.initialize() );
17 ATH_CHECK( m_rch3.initialize() );
18 ATH_CHECK( m_rch4.initialize() );
19
20 ATH_MSG_INFO( "m_rdh1 id: " << m_rdh1.fullKey() );
21 ATH_MSG_INFO( "m_rch1 id: " << m_rch1.fullKey() );
22 ATH_MSG_INFO( "m_rch2 id: " << m_rch2.fullKey() );
23 ATH_MSG_INFO( "m_rch3 id: " << m_rch3.fullKey() );
24 ATH_MSG_INFO( "m_rch4 id: " << m_rch4.fullKey() );
25
26 return StatusCode::SUCCESS;
27}
28
29//---------------------------------------------------------------------------
30
31StatusCode AlgE::execute(const EventContext& ctx) const {
32 ATH_MSG_DEBUG("execute " << name());
33
35 if (!rh1.isValid()) {
36 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key());
37 return StatusCode::FAILURE;
38 }
39
40 ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() );
41
46
47 float val {0.0};
48
49 const CondDataObj* cdo = *ch1;
50 if (cdo != 0) {
51 ATH_MSG_INFO(" CDO1: " << *cdo );
52 val += cdo->val();
53 } else {
54 ATH_MSG_ERROR(" CDO1 ptr == zero");
55 }
56
57 const CondDataObjY* cdoy = *ch2;
58 if (cdoy != 0) {
59 ATH_MSG_INFO(" CDO2: " << *cdoy );
60 val += cdoy->val();
61 } else {
62 ATH_MSG_ERROR(" CDO2 ptr == zero");
63 }
64
65 cdoy = *ch3;
66 if (cdoy != 0) {
67 ATH_MSG_INFO(" CDO3: " << *cdoy );
68 val += cdoy->val();
69 } else {
70 ATH_MSG_ERROR(" CDO3 ptr == zero");
71 }
72
73 const CondDataObjZ *cdoz = *ch4;
74 if (cdoz != 0) {
75 ATH_MSG_INFO(" CDO4: " << *cdoz );
76
77 if (cdoz->val() != val) {
78 ATH_MSG_ERROR(" value of CDO4 is incorrect ");
79 }
80
81 } else {
82 ATH_MSG_ERROR(" CDO# ptr == zero");
83 }
84
85
86 ATH_MSG_INFO("TEST: " << ctx.eventID().event_number() << " "
87 << rh1->val() << " " << **ch1 << " " << **ch2 << " " << **ch3
88 << " " << **ch4);
89
90 return StatusCode::SUCCESS;
91
92}
93
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
SG::ReadCondHandleKey< CondDataObjY > m_rch3
Definition AlgE.h:31
virtual StatusCode initialize() override
Definition AlgE.cxx:11
virtual StatusCode execute(const EventContext &ctx) const override
Definition AlgE.cxx:31
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition AlgE.h:27
SG::ReadCondHandleKey< CondDataObj > m_rch1
Definition AlgE.h:29
SG::ReadCondHandleKey< CondDataObjY > m_rch2
Definition AlgE.h:30
SG::ReadCondHandleKey< CondDataObjZ > m_rch4
Definition AlgE.h:33
void val(float f)
void val(float f)
void val(int i)
Definition CondDataObj.h:16
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.