ATLAS Offline Software
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 
14 #include "SCT_TdaqEnabledTestAlg.h"
15 
16 //Gaudi includes
17 
18 // Athena
20 #include "Identifier/Identifier.h"
21 
22 SCT_TdaqEnabledTestAlg::SCT_TdaqEnabledTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
23  AthReentrantAlgorithm(name, pSvcLocator)
24 {
25  //nop
26 }
27 
28 //Initialize
31  ATH_MSG_INFO("Calling initialize");
32  ATH_CHECK(m_pTdaqEnabledTool.retrieve());
33  return StatusCode::SUCCESS;
34 }
35 
36 //Execute
38 SCT_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 ");
52  result=m_pTdaqEnabledTool->isGood(IdentifierHash{3}, ctx);
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
73  ATH_MSG_INFO("Calling finalize");
74  return StatusCode::SUCCESS;
75 }
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SCT_TdaqEnabledTestAlg::finalize
virtual StatusCode finalize() override
Definition: SCT_TdaqEnabledTestAlg.cxx:72
SCT_TdaqEnabledTestAlg::initialize
virtual StatusCode initialize() override
Definition: SCT_TdaqEnabledTestAlg.cxx:30
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IdentifierHash.h
SCT_TdaqEnabledTestAlg.h
Header file for the SCT_TdaqEnabledTestAlg class in package SCT_ConditionsAlgorithms*.
SCT_TdaqEnabledTestAlg::SCT_TdaqEnabledTestAlg
SCT_TdaqEnabledTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SCT_TdaqEnabledTestAlg.cxx:22
SCT_TdaqEnabledTestAlg::m_pTdaqEnabledTool
ToolHandle< ISCT_ConditionsTool > m_pTdaqEnabledTool
Definition: SCT_TdaqEnabledTestAlg.h:41
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
SCT_TdaqEnabledTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SCT_TdaqEnabledTestAlg.cxx:38
Identifier
Definition: IdentifierFieldParser.cxx:14