ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigValidation
TrigValAlgs
src
TrigEDMAuxChecker.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
#include "GaudiKernel/MsgStream.h"
8
#include "GaudiKernel/IToolSvc.h"
9
#include "
TrigEDMAuxChecker.h
"
10
#include <algorithm>
11
TrigEDMAuxChecker::TrigEDMAuxChecker
(
const
std::string& name, ISvcLocator* pSvcLocator)
12
:
AthAlgorithm
(name, pSvcLocator),
13
m_count
(0)
14
{
15
declareProperty
(
"AuxContainerList"
,
m_auxList
);
16
}
17
18
TrigEDMAuxChecker::~TrigEDMAuxChecker
() {}
19
20
StatusCode
TrigEDMAuxChecker::initialize
() {
21
ATH_MSG_INFO
(
"Initializing TrigEDMAuxChecker"
);
22
std::vector<std::string> auxvar;
23
for
(
const
auto
& key:
m_auxList
){
24
ATH_MSG_INFO
(
"REGTEST AuxStore "
<< key);
25
m_auxmap
.insert(std::make_pair(key,auxvar));
26
m_dynauxmap
.insert(std::make_pair(key,auxvar));
27
}
28
m_count
=0;
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
TrigEDMAuxChecker::finalize
() {
33
34
std::vector<std::string> auxvar;
35
for
(
const
auto
& key:
m_auxList
){
36
ATH_MSG_INFO
(
"REGTEST : Aux vars for "
<< key <<
" ============================"
);
37
auxvar=
m_auxmap
[key];
38
for
(
const
auto
& var:auxvar){
39
ATH_MSG_INFO
(
"REGTEST : "
<< key <<
" "
<< var);
40
}
41
ATH_MSG_INFO
(
" ========================================================"
);
42
ATH_MSG_INFO
(
"REGTEST : Dynamic Aux vars for "
<< key);
43
auxvar=
m_dynauxmap
[key];
44
for
(
const
auto
& var:auxvar){
45
ATH_MSG_INFO
(
"REGTEST : "
<< key <<
" "
<< var);
46
}
47
ATH_MSG_INFO
(
" ========================================================"
);
48
}
49
50
return
StatusCode::SUCCESS;
51
}
52
53
void
TrigEDMAuxChecker::dumpDecorators
(
const
xAOD::AuxContainerBase
*
x
,
const
std::string& key){
54
ATH_MSG_DEBUG
(
"REGTEST: DUMP DECORATORS"
);
55
ATH_MSG_DEBUG
(
"Container size "
<<
x
->size() );
56
//Get list of auxids
57
const
SG::auxid_set_t
& auxIds=
x
->getAuxIDs();
58
const
SG::auxid_set_t
& dyn_auxids =
x
->getDynamicAuxIDs();
59
const
std::type_info *
type
(0);
60
//Get registry to determine variable type
61
SG::AuxTypeRegistry
& reg =
SG::AuxTypeRegistry::instance
();
62
ATH_MSG_INFO
(
"Number of auxIds "
<< auxIds.size() <<
" Number of dynaux "
<< dyn_auxids.size());
63
std::vector<std::string> auxvar =
m_auxmap
.at(key);
64
std::vector<std::string> dynauxvar =
m_dynauxmap
.at(key);
65
ATH_MSG_DEBUG
(
"======== Aux store variables =========="
);
66
for
(
auto
ai: auxIds) {
67
const
std::string &auxName=
SG::AuxTypeRegistry::instance
().
getName
(ai);
68
type
= reg.getType( ai );
69
std::vector<std::string>::iterator it =
find
(auxvar.begin(), auxvar.end(), auxName);
70
if
(it == auxvar.end()) {
71
auxvar.push_back(auxName);
72
if
(
m_count
==0)
ATH_MSG_INFO
(
"Auxid="
<< ai <<
", Name="
<< auxName <<
", type= "
<<
type
->name());
73
else
ATH_MSG_WARNING
(
"REGTEST: Found new Auxid="
<< ai <<
", Name="
<< auxName <<
", type= "
<<
type
->name());
74
}
75
76
}
77
ATH_MSG_DEBUG
(
"======== Aux store dynamic variables =========="
);
78
79
for
(
auto
ai: dyn_auxids) {
80
const
std::string &auxName=
SG::AuxTypeRegistry::instance
().
getName
(ai);
81
type
= reg.getType( ai );
82
std::vector<std::string>::iterator it =
find
(dynauxvar.begin(), dynauxvar.end(), auxName);
83
if
(it == dynauxvar.end()) {
84
dynauxvar.push_back(auxName);
85
if
(
m_count
==0)
ATH_MSG_INFO
(
"Auxid="
<< ai <<
", Name="
<< auxName <<
", type= "
<<
type
->name());
86
else
ATH_MSG_WARNING
(
"REGTEST: Found new Dynamic Auxid="
<< ai <<
", Name="
<< auxName <<
", type= "
<<
type
->name());
87
}
88
89
}
90
m_auxmap
[key]=std::move(auxvar);
91
m_dynauxmap
[key]=std::move(dynauxvar);
92
}
93
94
StatusCode
TrigEDMAuxChecker::execute
(
const
EventContext&
/*ctx*/
) {
95
const
xAOD::AuxContainerBase
* aux=0;
96
StatusCode
sc
= StatusCode::SUCCESS;
97
for
(
const
auto
& key:
m_auxList
){
98
sc
=
evtStore
()->retrieve(aux,key);
99
if
(
sc
.isFailure()) {
100
ATH_MSG_WARNING
(
"REGTEST Cannot retrieve "
<< key);
101
continue
;
102
}
103
ATH_MSG_DEBUG
(
"REGTEST: Dump Aux variables for "
<< key);
104
dumpDecorators
(aux,key);
105
}
106
m_count
++;
107
return
sc
;
108
}
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
TrigEDMAuxChecker.h
x
#define x
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition
AuxTypeRegistry.h:61
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition
AuxTypeRegistry.cxx:882
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition
AuxTypeRegistry.cxx:640
SG::auxid_set_t
A set of aux data identifiers.
Definition
AuxTypes.h:47
TrigEDMAuxChecker::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
TrigEDMAuxChecker.cxx:94
TrigEDMAuxChecker::m_auxmap
std::map< std::string, std::vector< std::string > > m_auxmap
Definition
TrigEDMAuxChecker.h:34
TrigEDMAuxChecker::m_auxList
std::vector< std::string > m_auxList
Definition
TrigEDMAuxChecker.h:33
TrigEDMAuxChecker::dumpDecorators
void dumpDecorators(const xAOD::AuxContainerBase *, const std::string &)
Definition
TrigEDMAuxChecker.cxx:53
TrigEDMAuxChecker::~TrigEDMAuxChecker
~TrigEDMAuxChecker()
Definition
TrigEDMAuxChecker.cxx:18
TrigEDMAuxChecker::finalize
StatusCode finalize()
Definition
TrigEDMAuxChecker.cxx:32
TrigEDMAuxChecker::TrigEDMAuxChecker
TrigEDMAuxChecker(const std::string &name, ISvcLocator *pSvcLocator)
Adapted from code by A.Hamilton to check trigger EDM; R.Goncalo 21/11/07.
Definition
TrigEDMAuxChecker.cxx:11
TrigEDMAuxChecker::m_dynauxmap
std::map< std::string, std::vector< std::string > > m_dynauxmap
Definition
TrigEDMAuxChecker.h:35
TrigEDMAuxChecker::m_count
int m_count
Definition
TrigEDMAuxChecker.h:36
TrigEDMAuxChecker::initialize
StatusCode initialize()
Definition
TrigEDMAuxChecker.cxx:20
xAOD::AuxContainerBase
Common base class for the auxiliary containers.
Definition
AuxContainerBase.h:55
find
std::string find(const std::string &s)
return a remapped string
Definition
hcg.cxx:140
type
Generated on
for ATLAS Offline Software by
1.17.0