ATLAS Offline Software
SCT_ModuleVetoTestAlg.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_ModuleVetoTestAlg.h"
15 
17 #include "Identifier/Identifier.h"
18 
19 SCT_ModuleVetoTestAlg::SCT_ModuleVetoTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
20  AthReentrantAlgorithm(name, pSvcLocator)
21 {
22  //nop
23 }
24 
25 //Initialize
28  ATH_MSG_INFO("Calling initialize");
29  ATH_CHECK(m_pModuleVetoTool.retrieve());
30  return StatusCode::SUCCESS;
31 }
32 
33 //Execute
35 SCT_ModuleVetoTestAlg::execute(const EventContext& ctx) const {
36  //This method is only used to test the summary service, and only used within this package,
37  // so the INFO level messages have no impact on performance of these services when used by clients
38 
39  ATH_MSG_INFO("Calling execute");
40 
41  ATH_MSG_INFO("Dummy call to module id 0: module is ");
42  bool result{m_pModuleVetoTool->isGood(Identifier{0}, ctx)};
43  ATH_MSG_INFO((result ? "good" : "bad"));
44 
45  ATH_MSG_INFO("Dummy call to module id 1: module is ");
46  result=m_pModuleVetoTool->isGood(Identifier{1}, ctx);
47  ATH_MSG_INFO((result ? "good" : "bad"));
48 
49  ATH_MSG_INFO("Dummy call to module id 2: module is ");
50  result=m_pModuleVetoTool->isGood(Identifier{2}, ctx);
51  ATH_MSG_INFO((result ? "good" : "bad"));
52 
53  ATH_MSG_INFO("Dummy call to module id 3: module is ");
54  result=m_pModuleVetoTool->isGood(Identifier{3}, ctx);
55  ATH_MSG_INFO((result ? "good" : "bad"));
56 
57  ATH_MSG_INFO("Dummy call to module id 151040000: module is ");
58  result=m_pModuleVetoTool->isGood(Identifier{151040000}, ctx);
59  ATH_MSG_INFO((result ? "good" : "bad"));
60 
61  ATH_MSG_INFO("Using Identifier Hash method: with number 2137 ");
62  result=m_pModuleVetoTool->isGood(IdentifierHash{2137}, ctx);
63  ATH_MSG_INFO((result ? "good" : "bad"));
64 
65  return StatusCode::SUCCESS;
66 }
67 
68 //Finalize
71  ATH_MSG_INFO("Calling finalize");
72 
73  return StatusCode::SUCCESS;
74 }
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SCT_ModuleVetoTestAlg::SCT_ModuleVetoTestAlg
SCT_ModuleVetoTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SCT_ModuleVetoTestAlg.cxx:19
SCT_ModuleVetoTestAlg::initialize
virtual StatusCode initialize() override
Definition: SCT_ModuleVetoTestAlg.cxx:27
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
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
SCT_ModuleVetoTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: SCT_ModuleVetoTestAlg.cxx:35
SCT_ModuleVetoTestAlg::finalize
virtual StatusCode finalize() override
Definition: SCT_ModuleVetoTestAlg.cxx:70
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IdentifierHash.h
SCT_ModuleVetoTestAlg::m_pModuleVetoTool
ToolHandle< ISCT_ConditionsTool > m_pModuleVetoTool
Definition: SCT_ModuleVetoTestAlg.h:43
SCT_ModuleVetoTestAlg.h
Header file for the SCT_ModuleVetoTestAlg class in package SCT_ConditionsAlgorithms.
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
Identifier
Definition: IdentifierFieldParser.cxx:14