ATLAS Offline Software
Loading...
Searching...
No Matches
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>
11TrigEDMAuxChecker::TrigEDMAuxChecker(const std::string& name, ISvcLocator* pSvcLocator)
12 : AthAlgorithm(name, pSvcLocator),
13 m_count(0)
14{
15 declareProperty("AuxContainerList",m_auxList);
16}
17
19
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
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
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
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
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}
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
#define x
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bit_t size() const
Count the number of 1 bits in the set.
Handle mappings between names and auxid_t.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
A set of aux data identifiers.
Definition AuxTypes.h:47
std::map< std::string, std::vector< std::string > > m_auxmap
std::vector< std::string > m_auxList
void dumpDecorators(const xAOD::AuxContainerBase *, const std::string &)
TrigEDMAuxChecker(const std::string &name, ISvcLocator *pSvcLocator)
Adapted from code by A.Hamilton to check trigger EDM; R.Goncalo 21/11/07.
std::map< std::string, std::vector< std::string > > m_dynauxmap
Common base class for the auxiliary containers.
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138