From 239c96f2a074c72d2c1cfe022127f3ae7eda0aca Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:14:01 +0200 Subject: [PATCH 1/8] clarify source of statistics in dump of output --- ...enseEnvironmentsAmbiguityProcessorTool.cxx | 20 ++++++++++++------- .../DenseEnvironmentsAmbiguityProcessorTool.h | 1 - 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx index 0292578c9a4c..3784c7af139b 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx @@ -6,7 +6,6 @@ #include "TrackScoringTool.h" #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "TrkTrack/TrackCollection.h" -#include "GaudiKernel/MsgStream.h" #include "TrkParameters/TrackParameters.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "AtlasDetDescr/AtlasDetectorID.h" @@ -16,8 +15,6 @@ #include "TrkTrackSummary/TrackSummary.h" #include "TrkCaloClusterROI/CaloClusterROI_Collection.h" -#include <map> -#include <ext/functional> #include <iterator> #include "TString.h" @@ -36,7 +33,7 @@ bool Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack( const Trk::Track if (param && param->covariance() && param->covariance()->determinant() < 0) { ATH_MSG_DEBUG( " negative determinant for track param " << counter << " " << *(param) << " cov=" << *(param->covariance()) - << std::endl + << "\n" << " det=" << param->covariance()->determinant() ); error=true; } @@ -163,7 +160,7 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::statistics() { if (msgLvl(MSG::INFO)) { MsgStream &out=msg(MSG::INFO); - out << " -- statistics " << std::endl; + out << " -- statistics \n"; std::lock_guard<std::mutex> lock( m_statMutex ); m_stat.dump(out, m_tryBremFit); out << endmsg; @@ -172,9 +169,20 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::statistics() void Trk::DenseEnvironmentsAmbiguityProcessorTool::TrackStat::dump(MsgStream &out, bool try_brem_fit) const { + auto parseFileName=[](const std::string & fullname){ + auto dotPosition = fullname.rfind("."); + auto slashPosition = fullname.rfind("/"); + auto stringLength = dotPosition - slashPosition; + return fullname.substr(slashPosition, stringLength); + }; // @TODO restore ios std::streamsize ss = std::cout.precision(); int iw=9; + out << "Output from "; + out << parseFileName(__FILE__); + out << "::"; + out << __func__; + out << "\n"; out << "------------------------------------------------------------------------------------" << std::endl; out << " Number of events processed : "<< m_globalCounter[kNevents].value() << std::endl; if (m_globalCounter[kNInvalidTracks]>0) { @@ -186,8 +194,6 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::TrackStat::dump(MsgStream &ou out << " statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " << std::endl; out << "------------------------------------------------------------------------------------" << std::endl; dumpStatType(out, " Number of candidates at input :", kNcandidates,iw); - // dumpStatType(out, " - candidates rejected score 0 :", kNcandScoreZero,iw); - // dumpStatType(out, " - candidates rejected as double :", kNcandDouble,iw); out << "------------------------------------------------------------------------------------" << std::endl; dumpStatType(out, " candidates with good score :", kNscoreOk,iw); if (try_brem_fit) { diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h index c092f5410337..786b208b314b 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h @@ -28,7 +28,6 @@ #include <map> #include <set> #include <vector> -#include <functional> #include <ostream> #include "TrackPtr.h" -- GitLab From 14c31d614ef0eb4a7d965495f9c076635e867b9a Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:16:26 +0200 Subject: [PATCH 2/8] replace endl with linefeed --- ...enseEnvironmentsAmbiguityProcessorTool.cxx | 28 +++++++++---------- .../DenseEnvironmentsAmbiguityProcessorTool.h | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx index 3784c7af139b..c6c2c1ce70f8 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx @@ -183,18 +183,18 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::TrackStat::dump(MsgStream &ou out << "::"; out << __func__; out << "\n"; - out << "------------------------------------------------------------------------------------" << std::endl; - out << " Number of events processed : "<< m_globalCounter[kNevents].value() << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; + out << " Number of events processed : "<< m_globalCounter[kNevents].value() << "\n"; if (m_globalCounter[kNInvalidTracks]>0) { - out << " Number of invalid tracks : "<< m_globalCounter[kNInvalidTracks].value() << std::endl; + out << " Number of invalid tracks : "<< m_globalCounter[kNInvalidTracks].value() << "\n"; } if (m_globalCounter[kNTracksWithoutParam]>0) { - out << " Tracks without parameters : "<< m_globalCounter[kNTracksWithoutParam].value() << std::endl; + out << " Tracks without parameters : "<< m_globalCounter[kNTracksWithoutParam].value() << "\n"; } - out << " statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " << std::endl; - out << "------------------------------------------------------------------------------------" << std::endl; + out << " statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " << "\n"; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " Number of candidates at input :", kNcandidates,iw); - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " candidates with good score :", kNscoreOk,iw); if (try_brem_fit) { dumpStatType(out, " + recovered after brem refit :", kNscoreZeroBremRefit,iw); @@ -204,28 +204,28 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::TrackStat::dump(MsgStream &ou dumpStatType(out, " + m refit :", kNscoreZeroBremRefitFailed,iw); dumpStatType(out, " + rejected brem refit score 0 :", kNscoreZeroBremRefitScoreZero,iw); } - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " number of normal fits :" , kNfits,iw); if (try_brem_fit) { dumpStatType(out, " + 2nd brem fit for failed fit :", kNrecoveryBremFits,iw); dumpStatType(out, " normal brem fits for electrons :", kNbremFits,iw); } - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " sum of succesful fits :", kNgoodFits,iw); dumpStatType(out, " sum of failed fits :", kNfailedFits,iw); - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " Number of subtracks created :", kNsubTrack,iw); dumpStatType(out, " Number of candidates excluded :", kNnoSubTrack,iw); - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " Number of tracks accepted :", kNaccepted,iw); if (try_brem_fit) { dumpStatType(out, " including number of brem fits :", kNacceptedBrem,iw); } - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setprecision(2) << " definition: ( 0.0 < Barrel < " << (*m_etabounds)[iBarrel-1] << " < Transition < " << (*m_etabounds)[iTransi-1] - << " < Endcap < " << (*m_etabounds)[iEndcap-1] << " < Forward < " << (*m_etabounds)[iForwrd-1] << " )" << std::endl; - out << "------------------------------------------------------------------------------------" << std::endl; + << " < Endcap < " << (*m_etabounds)[iEndcap-1] << " < Forward < " << (*m_etabounds)[iForwrd-1] << " )" << "\n"; + out << "------------------------------------------------------------------------------------" << "\n"; out << std::setprecision(ss); } diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h index 786b208b314b..3551399b138b 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h @@ -381,7 +381,7 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::TrackStat::dumpStatType(MsgSt for (unsigned region_i=0; region_i<kNStatRegions; ++region_i) { out << std::setw(iw) << m_counter[type][region_i].value(); } - out << std::endl; + out << "\n"; } #endif // TrackAmbiguityProcessorTool_H -- GitLab From 84146aee46b6c3bd55f2886b4192679c02d5c2d9 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:19:08 +0200 Subject: [PATCH 3/8] remove some unneeded headers --- .../src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx | 1 - .../src/DenseEnvironmentsAmbiguityScoreProcessorTool.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx index 41e9bcbe367e..1a49d877b608 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx @@ -14,7 +14,6 @@ #include "TrkTrackSummary/TrackSummary.h" #include <map> -#include <ext/functional> #include <iterator> #include "TString.h" diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h index 73e016ce01a3..a64481f3b548 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h @@ -25,7 +25,6 @@ #include <map> #include <set> #include <vector> -#include <functional> #include <ostream> @@ -215,7 +214,7 @@ void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::TrackStat::dumpStatType( for (unsigned region_i=0; region_i<kNStatRegions; ++region_i) { out << std::setw(iw) << m_counter[type][region_i].value(); } - out << std::endl; + out << "\n"; } #endif // TrackAmbiguityProcessorTool_H -- GitLab From b2b7a141bbf5b8ca82a3bed2fe6c832c947d6463 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:19:39 +0200 Subject: [PATCH 4/8] remove some unneeded headers --- .../src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx index 1a49d877b608..9267720aa948 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx @@ -6,7 +6,6 @@ #include "TrackScoringTool.h" #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "TrkTrack/TrackCollection.h" -#include "GaudiKernel/MsgStream.h" #include "TrkParameters/TrackParameters.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "TrkTrack/TrackInfo.h" -- GitLab From 5e20a7448aa1e39bd7ea2df56fa2cdd75483eb81 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:22:27 +0200 Subject: [PATCH 5/8] clarify source of dump output --- ...nvironmentsAmbiguityScoreProcessorTool.cxx | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx index 9267720aa948..439b41a80661 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx @@ -86,7 +86,7 @@ StatusCode Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::finalize() void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::statistics() { if (msgLvl(MSG::INFO)) { MsgStream &out=msg(MSG::INFO); - out << " -- statistics " << std::endl; + out << " -- statistics " << "\n"; std::lock_guard<std::mutex> lock( m_statMutex ); m_stat.dump(out); out << endmsg; @@ -98,24 +98,29 @@ void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::TrackStat::dump(MsgStrea // @TODO restore ios std::streamsize ss = out.precision(); int iw=9; - out << "------------------------------------------------------------------------------------" << std::endl; - out << " Number of events processed : "<< m_globalCounter[kNevents].value() << std::endl; + out << "Output from "; + out << parseFileName(__FILE__); + out << "::"; + out << __func__; + out << "\n"; + out << "------------------------------------------------------------------------------------" << "\n"; + out << " Number of events processed : "<< m_globalCounter[kNevents].value() << "\n"; if (m_globalCounter[kNInvalidTracks]>0) { - out << " Number of invalid tracks : "<< m_globalCounter[kNInvalidTracks].value() << std::endl; + out << " Number of invalid tracks : "<< m_globalCounter[kNInvalidTracks].value() << "\n"; } if (m_globalCounter[kNTracksWithoutParam]>0) { - out << " Tracks without parameters : "<< m_globalCounter[kNTracksWithoutParam].value() << std::endl; + out << " Tracks without parameters : "<< m_globalCounter[kNTracksWithoutParam].value() << "\n"; } - out << " statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " << std::endl; - out << "------------------------------------------------------------------------------------" << std::endl; + out << " statistics by eta range ------All---Barrel---Trans.-- Endcap-- Forwrd-- " << "\n"; + out << "------------------------------------------------------------------------------------" << "\n"; dumpStatType(out, " Number of candidates at input :", kNcandidates,iw); dumpStatType(out, " - candidates rejected score 0 :", kNcandScoreZero,iw); dumpStatType(out, " - candidates rejected as double :", kNcandDouble,iw); - out << "------------------------------------------------------------------------------------" << std::endl; + out << "------------------------------------------------------------------------------------" << "\n"; out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setprecision(2) << " definition: ( 0.0 < Barrel < " << (*m_etabounds)[iBarrel-1] << " < Transition < " << (*m_etabounds)[iTransi-1] - << " < Endcap < " << (*m_etabounds)[iEndcap-1] << " < Forward < " << (*m_etabounds)[iForwrd-1] << " )" << std::endl; - out << "------------------------------------------------------------------------------------" << std::endl; + << " < Endcap < " << (*m_etabounds)[iEndcap-1] << " < Forward < " << (*m_etabounds)[iForwrd-1] << " )" << "\n"; + out << "------------------------------------------------------------------------------------" << "\n"; out << std::setprecision(ss); } -- GitLab From 4e9e50ed836f627e1da8ecfc92d209fb0e8223fb Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:40:08 +0200 Subject: [PATCH 6/8] clarify source of dump output --- ...nvironmentsAmbiguityScoreProcessorTool.cxx | 6 +++ .../src/SimpleAmbiguityProcessorTool.cxx | 43 ++++++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx index 439b41a80661..abbceb5ece92 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx @@ -95,6 +95,12 @@ void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::statistics() { void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::TrackStat::dump(MsgStream &out) const { + auto parseFileName=[](const std::string & fullname){ + auto dotPosition = fullname.rfind("."); + auto slashPosition = fullname.rfind("/"); + auto stringLength = dotPosition - slashPosition; + return fullname.substr(slashPosition, stringLength); + }; // @TODO restore ios std::streamsize ss = out.precision(); int iw=9; diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx index 35b8aaa868a1..cb1ff70e70a2 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx @@ -144,23 +144,36 @@ void Trk::SimpleAmbiguityProcessorTool::statistics() if (msgLvl(MSG::INFO)) { MsgStream &out=msg(MSG::INFO); - out << " -- statistics:" << std::endl; + out << " -- statistics:" << "\n"; dumpStat(out); out << endmsg; } } void Trk::SimpleAmbiguityProcessorTool::dumpStat(MsgStream &out) const { - std::lock_guard<std::mutex> lock( m_statMutex ); - std::streamsize ss = out.precision(); - out << "---------------------------------------------------------------------------------" << std::endl; - out << " Number of events processed : "<< m_Nevents << std::endl; - out << " statistics by eta range ------All---Barrel---Trans.--- Endcap---DBM---" << std::endl; - out << "---------------------------------------------------------------------------------" << std::endl; + std::lock_guard<std::mutex> lock( m_statMutex ); + auto parseFileName=[](const std::string & fullname){ + auto dotPosition = fullname.rfind("."); + auto slashPosition = fullname.rfind("/"); + auto stringLength = dotPosition - slashPosition; + return fullname.substr(slashPosition, stringLength); + }; + // @TODO restore ios + std::streamsize ss = std::cout.precision(); + int iw=9; + out << "Output from "; + out << parseFileName(__FILE__); + out << "::"; + out << __func__; + out << "\n"; + out << "---------------------------------------------------------------------------------" << "\n"; + out << " Number of events processed : "<< m_Nevents << "\n"; + out << " statistics by eta range ------All---Barrel---Trans.--- Endcap---DBM---" << "\n"; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " Number of candidates at input :", Trk::SimpleAmbiguityProcessorTool::Counter::kNcandidates); dumpRegions(out, " - candidates rejected score 0 :", Trk::SimpleAmbiguityProcessorTool::Counter::kNcandScoreZero); dumpRegions(out, " - candidates rejected as double :", Trk::SimpleAmbiguityProcessorTool::Counter::kNcandDouble); - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " candidates with good score :", Trk::SimpleAmbiguityProcessorTool::Counter::kNscoreOk); if (m_tryBremFit) { dumpRegions(out," + recovered after brem refit :", Trk::SimpleAmbiguityProcessorTool::Counter::kNscoreZeroBremRefit); @@ -169,28 +182,28 @@ void Trk::SimpleAmbiguityProcessorTool::dumpStat(MsgStream &out) const { if (m_tryBremFit) { dumpRegions(out," + rejected failed brem refit :", Trk::SimpleAmbiguityProcessorTool::Counter::kNscoreZeroBremRefitFailed); } - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " number of normal fits :", Trk::SimpleAmbiguityProcessorTool::Counter::kNfits); if (m_tryBremFit) { dumpRegions(out," + 2nd brem fit for failed fit :", Trk::SimpleAmbiguityProcessorTool::Counter::kNrecoveryBremFits); dumpRegions(out," normal brem fits for electrons :", Trk::SimpleAmbiguityProcessorTool::Counter::kNbremFits); } - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " sum of succesful fits :", Trk::SimpleAmbiguityProcessorTool::Counter::kNgoodFits); dumpRegions(out, " sum of failed fits :", Trk::SimpleAmbiguityProcessorTool::Counter::kNfailedFits); - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " Number of subtracks created :", Trk::SimpleAmbiguityProcessorTool::Counter::kNsubTrack); dumpRegions(out, " Number of candidates excluded :", Trk::SimpleAmbiguityProcessorTool::Counter::kNnoSubTrack); - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; dumpRegions(out, " Number of tracks accepted :", Trk::SimpleAmbiguityProcessorTool::Counter::kNaccepted); if (m_tryBremFit) { dumpRegions(out," including number of brem fits :", Trk::SimpleAmbiguityProcessorTool::Counter::kNacceptedBrem); } - out << "---------------------------------------------------------------------------------" << std::endl; + out << "---------------------------------------------------------------------------------" << "\n"; out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setprecision(2) << " definition: ( 0.0 < Barrel < " << m_etabounds[iBarrel-1] << " < Transition < " << m_etabounds[iTransi-1] - << " < Endcap < " << m_etabounds[iEndcap-1] << " DBM )" << std::endl; - out << "-------------------------------------------------------------------------------" << std::endl; + << " < Endcap < " << m_etabounds[iEndcap-1] << " DBM )" << "\n"; + out << "-------------------------------------------------------------------------------" << "\n"; out.precision (ss); } -- GitLab From d3327aef27cb138cb6938ecb813e29ef654b8266 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 16:43:49 +0200 Subject: [PATCH 7/8] replace a few endl with linefeed --- .../src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx | 4 ++-- .../src/SimpleAmbiguityProcessorTool.cxx | 1 - .../TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx index abbceb5ece92..7b96be420d19 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx @@ -247,9 +247,9 @@ void Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::updatePixelSplitInformat ATH_MSG_DEBUG ( "---- "<< pixelCluster->globalPosition().perp() <<" Updating split probs 1: Old " << pixelCluster->splitProbability1() << " New " << splitProb.splitProbability(2) <<" Probs 2: Old " << pixelCluster->splitProbability2() << " New " << splitProb.splitProbability(3) - << std::endl + << "\n" << " --- pixelCluster: " << *pixelCluster - << std::endl + << "\n" << " --- trk params: " << *clusterTrkPara.second ); if ( splitProb.splitProbability(2) < 0 ){ diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx index cb1ff70e70a2..5abd655dd347 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx @@ -160,7 +160,6 @@ void Trk::SimpleAmbiguityProcessorTool::dumpStat(MsgStream &out) const { }; // @TODO restore ios std::streamsize ss = std::cout.precision(); - int iw=9; out << "Output from "; out << parseFileName(__FILE__); out << "::"; diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.h index 1cb5ecb9add2..deeaa910ead8 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.h @@ -296,7 +296,7 @@ namespace Trk { assert( eta_bin_i < m_stat.m_counter[stat_i].size() ); out << std::setiosflags(std::ios::dec) << std::setw(iw) << m_stat.m_counter[stat_i][eta_bin_i]; } - out << std::endl; + out << "\n"; } } //end ns -- GitLab From fee4ee44e2650730bc5894e5dc5a445a172da6f5 Mon Sep 17 00:00:00 2001 From: Shaun Roe <shaun.roe@cern.ch> Date: Wed, 6 May 2020 17:02:06 +0200 Subject: [PATCH 8/8] clarify source of statistics outpu --- .../src/DenseEnvironmentsAmbiguityProcessorTool.cxx | 2 +- .../src/DenseEnvironmentsAmbiguityProcessorTool.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx index c6c2c1ce70f8..15bdfca674fa 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx @@ -23,7 +23,7 @@ #include "InDetIdentifier/PixelID.h" //TODO: to be improved -bool Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack( const Trk::Track *track) const { +bool Trk::DenseEnvironmentsAmbiguityProcessorTool::checkTrack( const Trk::Track *track) const { if (!track )return true; bool error=false; diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h index 3551399b138b..9ea3b8ded714 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h @@ -198,7 +198,7 @@ namespace Trk { const TrackParameters ¶m, bool flag, Trk::ParticleHypothesis hypo) const; template<typename... Args> Trk::Track *fit(const Track &track, Args... args) const; - bool _checkTrack(const Trk::Track *) const; + bool checkTrack(const Trk::Track *) const; // private data members @@ -287,7 +287,7 @@ namespace Trk { delete new_track; new_track=nullptr; new_track = a_fitter->fit(raw, param, flag,hypo); - if (Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack(new_track)) { + if (Trk::DenseEnvironmentsAmbiguityProcessorTool::checkTrack(new_track)) { return new_track; } ATH_MSG_WARNING( "The track fitter, " << a_fitter->name() << ", produced a track with an invalid covariance matrix." ); @@ -311,7 +311,7 @@ namespace Trk { delete new_track; new_track=nullptr; new_track = a_fitter->fit(measurements, param, flag, hypo); - if (Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack(new_track)) { + if (Trk::DenseEnvironmentsAmbiguityProcessorTool::checkTrack(new_track)) { return new_track; } ATH_MSG_WARNING( "The track fitter, " << a_fitter->name() << ", produced a track with an invalid covariance matrix." ); @@ -333,7 +333,7 @@ namespace Trk { delete new_track; new_track=nullptr; new_track = a_fitter->fit(track,args...); - if (Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack(new_track)) { + if (Trk::DenseEnvironmentsAmbiguityProcessorTool::checkTrack(new_track)) { return new_track; } ATH_MSG_WARNING( "The track fitter, " << a_fitter->name() << ", produced a track with an invalid covariance matrix." ); -- GitLab