ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
SCT_ConditionsAlgorithms
src
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
14
#include "
SCT_TdaqEnabledTestAlg.h
"
15
16
//Gaudi includes
17
18
// Athena
19
#include "
Identifier/IdentifierHash.h
"
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
29
StatusCode
30
SCT_TdaqEnabledTestAlg::initialize
() {
31
ATH_MSG_INFO
(
"Calling initialize"
);
32
ATH_CHECK
(
m_pTdaqEnabledTool
.retrieve());
33
return
StatusCode::SUCCESS;
34
}
35
36
//Execute
37
StatusCode
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
71
StatusCode
72
SCT_TdaqEnabledTestAlg::finalize
() {
73
ATH_MSG_INFO
(
"Calling finalize"
);
74
return
StatusCode::SUCCESS;
75
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
IdentifierHash.h
SCT_TdaqEnabledTestAlg.h
Header file for the SCT_TdaqEnabledTestAlg class in package SCT_ConditionsAlgorithms*.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
SCT_TdaqEnabledTestAlg::initialize
virtual StatusCode initialize() override
Definition
SCT_TdaqEnabledTestAlg.cxx:30
SCT_TdaqEnabledTestAlg::SCT_TdaqEnabledTestAlg
SCT_TdaqEnabledTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SCT_TdaqEnabledTestAlg.cxx:22
SCT_TdaqEnabledTestAlg::finalize
virtual StatusCode finalize() override
Definition
SCT_TdaqEnabledTestAlg.cxx:72
SCT_TdaqEnabledTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
SCT_TdaqEnabledTestAlg.cxx:38
SCT_TdaqEnabledTestAlg::m_pTdaqEnabledTool
ToolHandle< ISCT_ConditionsTool > m_pTdaqEnabledTool
Definition
SCT_TdaqEnabledTestAlg.h:41
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0