ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Hypothesis
eEmMultTestComparator.cxx
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#include "
eEmMultTestComparator.h
"
7
8
#include <sstream>
9
#include <algorithm>
10
11
namespace
GlobalSim
{
12
13
eEmMultTestComparator::eEmMultTestComparator
(
const
std::string& name,
14
ISvcLocator *pSvcLocator):
15
AthReentrantAlgorithm
(name, pSvcLocator) {
16
}
17
18
StatusCode
eEmMultTestComparator::initialize
() {
19
20
CHECK
(
m_expectedTIPword_ReadKey
.initialize());
21
CHECK
(
m_generatedTIPword_ReadKey
.initialize());
22
23
ATH_MSG_INFO
(
m_expectedTIPword_ReadKey
);
24
ATH_MSG_INFO
(
m_generatedTIPword_ReadKey
);
25
26
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
31
eEmMultTestComparator::execute
(
const
EventContext& ctx)
const
{
32
ATH_MSG_DEBUG
(
"run()"
);
33
34
35
// read in the expected and the generated TIP
36
37
auto
expectedTIP =
38
SG::ReadHandle<GlobalSim::TIPword>
(
m_expectedTIPword_ReadKey
, ctx);
39
CHECK
(expectedTIP.isValid());
40
41
ATH_MSG_DEBUG
(
"read in the expected TIP word"
);
42
43
44
auto
generatedTIP =
45
SG::ReadHandle<GlobalSim::TIPword>
(
m_generatedTIPword_ReadKey
, ctx);
46
CHECK
(generatedTIP.isValid());
47
48
ATH_MSG_DEBUG
(
"read in the generated TIP word"
);
49
50
auto
esz = (*expectedTIP).size();
51
auto
gsz = (*generatedTIP).size();
52
53
if
(esz != gsz) {
54
ATH_MSG_ERROR
(
"expected TIP and generated TIP sizes differ "
55
<<esz <<
' '
<< gsz);
56
return
StatusCode::FAILURE;
57
}
58
59
if
(*generatedTIP == *expectedTIP) {
60
ATH_MSG_DEBUG
(
"Test passed"
);
61
return
StatusCode::SUCCESS;
62
}
63
64
65
ATH_MSG_INFO
(
"Expected, generated TIP word mismatch. Event "
66
<< ctx.evt());
67
68
for
(std::size_t i{0}; i != esz; ++i) {
69
if
(generatedTIP->test(i) != expectedTIP->test(i)) {
70
ATH_MSG_INFO
(
"TIP word postion "
<< i << std::boolalpha
71
<<
" expected "
<< expectedTIP->test(i)
72
<<
" generated "
<< generatedTIP->test(i));
73
}
74
}
75
76
if
(
m_abort_on_mismatch
) {
return
StatusCode::FAILURE;}
77
78
return
StatusCode::SUCCESS;
79
}
80
81
}
82
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
GlobalSim::eEmMultTestComparator::initialize
virtual StatusCode initialize() override
Definition
eEmMultTestComparator.cxx:18
GlobalSim::eEmMultTestComparator::eEmMultTestComparator
eEmMultTestComparator(const std::string &name, ISvcLocator *pSvcLocator)
Definition
eEmMultTestComparator.cxx:13
GlobalSim::eEmMultTestComparator::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
eEmMultTestComparator.cxx:31
GlobalSim::eEmMultTestComparator::m_abort_on_mismatch
Gaudi::Property< bool > m_abort_on_mismatch
Definition
eEmMultTestComparator.h:57
GlobalSim::eEmMultTestComparator::m_generatedTIPword_ReadKey
SG::ReadHandleKey< TIPword > m_generatedTIPword_ReadKey
Definition
eEmMultTestComparator.h:49
GlobalSim::eEmMultTestComparator::m_expectedTIPword_ReadKey
SG::ReadHandleKey< TIPword > m_expectedTIPword_ReadKey
Definition
eEmMultTestComparator.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
eEmMultTestComparator.h
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
Generated on
for ATLAS Offline Software by
1.17.0