diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRT_StrawStatus.h b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRT_StrawStatus.h index 5bd87a207870db9fc94589068aa35b132372e0d6..8c2bb4a916366c68cb4d65009daa293a414b026f 100644 --- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRT_StrawStatus.h +++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/TRT_CalibAlgs/TRT_StrawStatus.h @@ -1,5 +1,5 @@ /* - 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 diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx index 8c2eee00af5e30b723ceaf9922b3e8f17f484969..83ec8b08bd3ce8602b3c26ca133b2f30595ac830 100644 --- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx +++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx @@ -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 );