Skip to content
Snippets Groups Projects
Commit 25d40f69 authored by Susumu Oda's avatar Susumu Oda
Browse files

Replace a static local variable by a mutable atomic memeber variable in the TRT_StrawStatus class.

parent bfcbebae
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -27,6 +27,7 @@
#include <string>
#include <vector>
#include <array>
#include <atomic>
class AtlasDetectorID;
class Identifier;
......@@ -112,6 +113,8 @@ namespace InDet
/** member variables for algorithm properties: */
int m_printDetailedInformation;
mutable std::atomic<int> m_printStatusCount{0};
};
} // end of namespace
......
......@@ -358,12 +358,11 @@ void InDet::TRT_StrawStatus::printDetailedInformation() {
int chip, HVpad;
m_TRTStrawNeighbourSvc->getChip(id, chip);
m_TRTStrawNeighbourSvc->getPad(id, HVpad);
static int printStatusCount(0);
if (!printStatusCount) {
if (!m_printStatusCount) {
ATH_MSG_INFO( "if the code crashes on the next line, there is a problem with m_TRTStrawStatusSummarySvc not being loaded " );
ATH_MSG_INFO( "in that case, running with reco turned on normally solves the problem, know of no better solution at the moment" );
ATH_MSG_INFO( "if you do not need the detailed print information, you can also just set printDetailedInformation to 0 to avoid this crash" );
printStatusCount++;
m_printStatusCount++;
}
int status = m_TRTStrawStatusSummaryTool->get_status( id );
int statusTemporary = m_TRTStrawStatusSummaryTool->getStatus( id );
......
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