From 1c97e5fce857150032ff2f07c8f38f87db8f3bcf Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 22 Dec 2020 16:25:45 +0100 Subject: [PATCH] final clean-up --- .../SiStripPlugins/interface/SiStripTkMaps.h | 26 +++++++++---------- .../SiStripApvGain_PayloadInspector.cc | 24 ++++++++--------- .../SiStripBadStrip_PayloadInspector.cc | 10 +++---- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CondCore/SiStripPlugins/interface/SiStripTkMaps.h b/CondCore/SiStripPlugins/interface/SiStripTkMaps.h index 53cdf84ce21a7..bb60f52b80ac1 100644 --- a/CondCore/SiStripPlugins/interface/SiStripTkMaps.h +++ b/CondCore/SiStripPlugins/interface/SiStripTkMaps.h @@ -16,13 +16,8 @@ #include "TCanvas.h" #include "TColor.h" #include "TGraph.h" -#include "TH1.h" -#include "TH2.h" #include "TLatex.h" #include "TH2Poly.h" -#include "TObjArray.h" -#include "TObjString.h" -#include "TProfile2D.h" #include "TStyle.h" // STL includes @@ -31,6 +26,8 @@ #include #include #include + +// boost includes #include #include @@ -148,7 +145,7 @@ class SiStripTkMaps { std::string m_mapTitle = ""; std::string m_zAxisTitle = ""; double m_axmin, m_axmax; - std::map > m_bins; + std::map> m_bins; std::vector m_detIdVector; std::vector m_values; TrackerTopology m_trackerTopo; @@ -274,10 +271,11 @@ class SiStripTkMaps { void readVertices(double& minx, double& maxx, double& miny, double& maxy) { std::ifstream in; + // TPolyline vertices stored at https://github.com/cms-data/DQM-SiStripMonitorClient in.open(edm::FileInPath("DQM/SiStripMonitorClient/data/Geometry/tracker_map_bare").fullPath().c_str()); if (!in.good()) { - throw cms::Exception("FileError") << "Problem opening corner file!!" << std::endl; + throw cms::Exception("FileError") << "SiStripTkMaps: problem opening vertices file!!" << std::endl; return; } @@ -287,14 +285,16 @@ class SiStripTkMaps { std::string line; std::getline(in, line); + typedef boost::tokenizer> tokenizer; + boost::char_separator sep{" "}; + tokenizer tok{line, sep}; - TString string(line); - TObjArray* array = string.Tokenize(" "); int ix{0}, iy{0}; bool isPixel{false}; - for (int i = 0; i < array->GetEntries(); ++i) { + for (const auto& t : tok | boost::adaptors::indexed(0)) { + int i = t.index(); if (i == 0) { - detid = static_cast(array->At(i))->String().Atoll(); + detid = atoll((t.value()).c_str()); // Drop Pixel Data DetId detId(detid); @@ -304,7 +304,7 @@ class SiStripTkMaps { } } else { if (i % 2 == 0) { - x[ix] = static_cast(array->At(i))->String().Atof(); + x[ix] = atof((t.value()).c_str()); if (x[ix] < minx) { minx = x[ix]; } @@ -313,7 +313,7 @@ class SiStripTkMaps { } ++ix; } else { - y[iy] = static_cast(array->At(i))->String().Atof(); + y[iy] = atof((t.value()).c_str()); if (y[iy] < miny) { miny = y[iy]; } diff --git a/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc index 8cc04a51eac01..93aeb2d9f7185 100644 --- a/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc +++ b/CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc @@ -552,9 +552,9 @@ namespace { *************************************************/ template - class SiStripApvGainsRatioWithPreviousIOVTrackerMapBase : public PlotImage { + class SiStripApvGainsRatioTrackerMapBase : public PlotImage { public: - SiStripApvGainsRatioWithPreviousIOVTrackerMapBase() + SiStripApvGainsRatioTrackerMapBase() : PlotImage("Tracker Map of ratio of SiStripGains with previous IOV") { PlotBase::addInputParam("nsigma"); } @@ -653,19 +653,17 @@ namespace { } }; - using SiStripApvGainsAvgDeviationRatioWithPreviousIOVTrackerMap = - SiStripApvGainsRatioWithPreviousIOVTrackerMapBase<1, MULTI_IOV>; - using SiStripApvGainsAvgDeviationRatioTrackerMapTwoTags = - SiStripApvGainsRatioWithPreviousIOVTrackerMapBase<2, SINGLE_IOV>; + using SiStripApvGainsAvgDeviationRatioWithPreviousIOVTrackerMap = SiStripApvGainsRatioTrackerMapBase<1, MULTI_IOV>; + using SiStripApvGainsAvgDeviationRatioTrackerMapTwoTags = SiStripApvGainsRatioTrackerMapBase<2, SINGLE_IOV>; /************************************************ TrackerMap of SiStripApvGains (ratio for largest deviation with previous gain per detid) *************************************************/ template - class SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase : public PlotImage { + class SiStripApvGainsRatioMaxDeviationTrackerMapBase : public PlotImage { public: - SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase() + SiStripApvGainsRatioMaxDeviationTrackerMapBase() : PlotImage( "Tracker Map of ratio (for largest deviation) of SiStripGains with previous IOV") { PlotBase::addInputParam("nsigma"); @@ -677,9 +675,11 @@ namespace { auto ip = paramValues.find("nsigma"); if (ip != paramValues.end()) { nsigma = boost::lexical_cast(ip->second); - std::cout << "using custom z-axis saturation: " << nsigma << " sigmas" << std::endl; + edm::LogPrint("SiStripApvGain_PayloadInspector") + << "using custom z-axis saturation: " << nsigma << " sigmas" << std::endl; } else { - std::cout << "using default saturation: " << nsigma << " sigmas" << std::endl; + edm::LogPrint("SiStripApvGain_PayloadInspector") + << "using default saturation: " << nsigma << " sigmas" << std::endl; } // trick to deal with the multi-ioved tag and two tag case at the same time @@ -786,10 +786,10 @@ namespace { }; using SiStripApvGainsMaxDeviationRatioWithPreviousIOVTrackerMap = - SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase<1, MULTI_IOV>; + SiStripApvGainsRatioMaxDeviationTrackerMapBase<1, MULTI_IOV>; using SiStripApvGainsMaxDeviationRatioTrackerMapTwoTags = - SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase<2, SINGLE_IOV>; + SiStripApvGainsRatioMaxDeviationTrackerMapBase<2, SINGLE_IOV>; /************************************************ TrackerMap of SiStripApvGains (maximum gain per detid) diff --git a/CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc b/CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc index 5e5af46d198a7..c9bc2f20f944a 100644 --- a/CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc +++ b/CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc @@ -929,11 +929,11 @@ namespace { } } - /* - std::cout<<"In 2 but not in 1:"<< countLastButNotFirst << std::endl; - std::cout<<"In 1 but not in 2:"<< countFirstButNotLast << std::endl; - std::cout<<"In both:"<< countBoth << std::endl; - */ +#ifdef MMDEBUG + std::cout << "In 2 but not in 1:" << countLastButNotFirst << std::endl; + std::cout << "In 1 but not in 2:" << countFirstButNotLast << std::endl; + std::cout << "In both:" << countBoth << std::endl; +#endif //=========================