ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_TdaqEnabledTestAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
13
15
16//Gaudi includes
17
18// Athena
20#include "Identifier/Identifier.h"
21
22SCT_TdaqEnabledTestAlg::SCT_TdaqEnabledTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
23 AthReentrantAlgorithm(name, pSvcLocator)
24{
25 //nop
26}
27
28//Initialize
29StatusCode
31 ATH_MSG_INFO("Calling initialize");
32 ATH_CHECK(m_pTdaqEnabledTool.retrieve());
33 return StatusCode::SUCCESS;
34}
35
36//Execute
37StatusCode
38SCT_TdaqEnabledTestAlg::execute(const EventContext& ctx) const {
39 //This method is only used to test the summary service, and only used within this package,
40 // so the INFO level messages have no impact on performance of these services when used by clients
41 ATH_MSG_INFO("Calling execute");
42 ATH_MSG_INFO("Dummy call to module idHash 0: module is ");
43 bool result{m_pTdaqEnabledTool->isGood(IdentifierHash{0}, ctx)};
44 ATH_MSG_INFO((result ? "good" : "bad"));
45 ATH_MSG_INFO("Dummy call to module Identifier 1: module is ");
46 result=m_pTdaqEnabledTool->isGood(Identifier{1}, ctx);
47 ATH_MSG_INFO((result ? "good" : "bad"));
48 ATH_MSG_INFO("Using Identifier Hash method: with number 2137 ");
49 result=m_pTdaqEnabledTool->isGood(IdentifierHash{2137}, ctx);
50 ATH_MSG_INFO((result ? "good" : "bad"));
51 ATH_MSG_INFO("Dummy call to module idHash 3: module is ");
53 ATH_MSG_INFO((result ? "good" : "bad"));
54 unsigned int printNbad{10}, printNgood{10};
55 ATH_MSG_INFO("Printing the first " << printNbad << " bad modules, and the first " << printNgood << " good modules.");
56 for (unsigned int i{0}; i<8176; ++i) {
57 IdentifierHash idh{i};
58 if (printNbad and (not m_pTdaqEnabledTool->isGood(idh, ctx))) {
59 ATH_MSG_INFO(i << " is bad.");
60 --printNbad;
61 }
62 if (printNgood and m_pTdaqEnabledTool->isGood(idh, ctx)) {
63 ATH_MSG_INFO(i << " is good.");
64 --printNgood;
65 }
66 }
67 return StatusCode::SUCCESS;
68}
69
70//Finalize
71StatusCode
73 ATH_MSG_INFO("Calling finalize");
74 return StatusCode::SUCCESS;
75}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Header file for the SCT_TdaqEnabledTestAlg class in package SCT_ConditionsAlgorithms*.
An algorithm that can be simultaneously executed in multiple threads.
This is a "hash" representation of an Identifier.
virtual StatusCode initialize() override
SCT_TdaqEnabledTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize() override
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandle< ISCT_ConditionsTool > m_pTdaqEnabledTool