ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigValidation
TrigValAlgs
src
TrigChainNameParserChecker.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigChainNameParserChecker.h
"
6
#include "
TrigCompositeUtils/ChainNameParser.h
"
7
8
StatusCode
TrigChainNameParserChecker::initialize
() {
9
ATH_CHECK
(
m_HLTMenuKey
.initialize() );
10
return
StatusCode::SUCCESS;
11
}
12
13
StatusCode
TrigChainNameParserChecker::execute
(
const
EventContext& ctx)
const
{
14
15
// Validate the ChainNameParser against the JSON menu.
16
// Expecting to run in a trigger production job hence the menu comes from the detector store.
17
18
// Only needs to run once per job, on the first event.
19
static
const
bool
error
= [&](){
20
21
SG::ReadHandle<TrigConf::HLTMenu>
hltMenuHandle(
m_HLTMenuKey
, ctx);
22
const
TrigConf::HLTMenu
& hltMenu = *hltMenuHandle;
23
bool
isErr =
false
;
24
for
(
const
auto
& chain : hltMenu) {
25
const
std::vector<size_t> legMultiplicitesA = chain.legMultiplicities();
26
const
std::vector<int> legMultiplicitesB =
ChainNameParser::multiplicities
(chain.name());
27
if
(!legMultiplicitesB.size()) {
28
ATH_MSG_ERROR
(
"Zero parsed legs for chain:"
<< chain.name());
29
isErr =
true
;
30
}
else
if
(legMultiplicitesA.size() != legMultiplicitesB.size()) {
31
ATH_MSG_ERROR
(
"Inconsistent N Legs, Menu:"
<< legMultiplicitesA.size() <<
" Parser:"
<< legMultiplicitesB.size() <<
" chain:"
<< chain.name());
32
isErr =
true
;
33
}
else
{
34
for
(
size_t
i = 0; i < legMultiplicitesA.size(); ++i) {
35
if
(legMultiplicitesA.at(i) != (
size_t
)legMultiplicitesB.at(i)) {
36
ATH_MSG_ERROR
(
"Inconsistency in Leg "
<< i <<
", Menu multi:"
<< legMultiplicitesA.at(i) <<
" Parser multi:"
<< legMultiplicitesB.at(i) <<
" chain:"
<< chain.name());
37
isErr =
true
;
38
}
39
}
40
}
41
}
42
43
if
(isErr) {
44
ATH_MSG_ERROR
(
"One or more chains (above) in the menu were parsed incorrectly by the ChainNameParser with respect to the menu."
);
45
ATH_MSG_ERROR
(
"Please update the parser in TrigCompositeUtils to bring it into agreement with the menu."
);
46
ATH_MSG_ERROR
(
"You may need to update the lists of identifiers in allSignatures() or allSignaturePostfixQualifiers()."
);
47
}
else
{
48
ATH_MSG_INFO
(
"TrigChainNameParserChecker did not find any issues over "
<< hltMenu.
size
() <<
" chains."
);
49
}
50
return
isErr;
51
52
}();
53
54
return
(
error
? StatusCode::FAILURE : StatusCode::SUCCESS);
55
56
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ChainNameParser.h
TrigChainNameParserChecker.h
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
TrigChainNameParserChecker::m_HLTMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
Definition
TrigChainNameParserChecker.h:26
TrigChainNameParserChecker::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
TrigChainNameParserChecker.cxx:13
TrigChainNameParserChecker::initialize
virtual StatusCode initialize() override
Definition
TrigChainNameParserChecker.cxx:8
TrigConf::HLTMenu
HLT menu configuration.
Definition
HLTMenu.h:21
TrigConf::HLTMenu::size
std::size_t size() const
Accessor to the number of HLT chains.
Definition
HLTMenu.cxx:35
ChainNameParser::multiplicities
std::vector< int > multiplicities(const std::string &chain)
Definition
ChainNameParser.cxx:226
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0