Skip to content
Snippets Groups Projects
Commit f078a344 authored by Johannes Elmsheuser's avatar Johannes Elmsheuser
Browse files

Merge branch 'trigger.bs.dict.warnings' into 'master'

Suppress warnings about missing dictionaries for BS streamers file

See merge request atlas/athena!42185
parents fd21966c d7de61ea
No related branches found
No related tags found
No related merge requests found
......@@ -219,6 +219,12 @@ void* TBufferFileWorkaround::ReadObjectAnyNV(const TClass *clCast)
bool TrigTSerializer::s_decodingError = false;
std::vector<std::string> TrigTSerializer::s_dictsToIgnore = {
"CosmicMuonCollection_tlp1", "MdtTrackSegmentCollection_tlp1",
"CosmicMuonCollection_p1", "CosmicMuon_p1", "MdtTrackSegmentCollection_p1",
"MdtTrackSegment_p1", "MdtTrackSegmentCollection_p2", "PanTauDetails_p1",
"SG::IAuxStoreCompression"
};
TrigTSerializer::TrigTSerializer(const std::string& toolname, const std::string& type, const IInterface* parent) : AthAlgTool(toolname, type, parent) {
declareInterface<ITrigSerializerToolBase>( this );
......@@ -233,6 +239,15 @@ TrigTSerializer::~TrigTSerializer(){
StatusCode TrigTSerializer::initialize(){
ATH_MSG_DEBUG( "TrigTSerializer::initialize " << name() );
// copy missing dictionary names from the property to the static member
s_dictsToIgnore.insert( std::end(s_dictsToIgnore), std::begin(m_ignoreMissingDicts.value()), std::end(m_ignoreMissingDicts.value()) );
std::string msg;
for( auto n:s_dictsToIgnore ) {
if( not msg.empty() ) msg += ", ";
msg += n;
}
ATH_MSG_DEBUG( "Suppressing missing dictionary warnings for: " << msg );
if (!m_onlineMode)
add_previous_streamerinfos();
......@@ -258,7 +273,26 @@ StatusCode TrigTSerializer::finalize(){
return StatusCode::SUCCESS;
}
void TrigTSerializer::add_previous_streamerinfos(){
bool TrigTSerializer::bsDictWarningFilter(int level, bool abort_bool,
const char* location, const char *msg)
{
if( level == kWarning and gDebug == 0 ) {
if( strstr(msg, "no dictionary for class") ) {
for( std::string &type : s_dictsToIgnore ) {
if( strstr(msg, type.c_str()) ) {
return false;
}
}
}
}
DefaultErrorHandler(level,abort_bool, location, msg);
return false;
}
void TrigTSerializer::add_previous_streamerinfos()
{
RootUtils::WithRootErrorHandler hand( bsDictWarningFilter );
//temporary
std::string extStreamerInfos = "bs-streamerinfos.root";
std::string extFile = PathResolver::find_file (extStreamerInfos, "DATAPATH");
......
......@@ -14,6 +14,7 @@
#ifndef TRIGTSERIALIZER_H
#define TRIGTSERIALIZER_H
#include "Gaudi/Property.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "CxxUtils/checker_macros.h"
#include "TrigSerializeResult/ITrigSerializerToolBase.h"
......@@ -71,6 +72,9 @@ private:
static bool streamerErrorHandler(Int_t level, Bool_t abort_bool,
const char* location, const char *msg);
static bool bsDictWarningFilter(Int_t level, Bool_t abort_bool,
const char* location, const char *msg);
void prepareForTBuffer(const std::string &nameOfClass);
void restoreAfterTBuffer(const std::string &nameOfClass);
......@@ -83,6 +87,13 @@ private:
//static bool m_reportError;
uint32_t m_IgnoreErrLvl;
std::map<std::string, uint32_t> m_errCount;
/// IgnoreMissingDicts
StringArrayProperty m_ignoreMissingDicts {
this, "IgnoreMissingDicts", {},
"Suppress warining about missing dictionaries", "OrderedSet<std::string>" };
/// static copy of the IgnoreMissingDicts property for the static error handler
static std::vector<std::string> s_dictsToIgnore;
};
#undef REFLEX_NS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment