Skip to content

Commit

Permalink
final clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Dec 22, 2020
1 parent c0ff2c5 commit 1c97e5f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
26 changes: 13 additions & 13 deletions CondCore/SiStripPlugins/interface/SiStripTkMaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,6 +26,8 @@
#include <map>
#include <string>
#include <vector>

// boost includes
#include <boost/tokenizer.hpp>
#include <boost/range/adaptor/indexed.hpp>

Expand Down Expand Up @@ -148,7 +145,7 @@ class SiStripTkMaps {
std::string m_mapTitle = "";
std::string m_zAxisTitle = "";
double m_axmin, m_axmax;
std::map<long, std::shared_ptr<TGraph> > m_bins;
std::map<long, std::shared_ptr<TGraph>> m_bins;
std::vector<unsigned int> m_detIdVector;
std::vector<double> m_values;
TrackerTopology m_trackerTopo;
Expand Down Expand Up @@ -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;
}

Expand All @@ -287,14 +285,16 @@ class SiStripTkMaps {

std::string line;
std::getline(in, line);
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
boost::char_separator<char> 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<TObjString*>(array->At(i))->String().Atoll();
detid = atoll((t.value()).c_str());

// Drop Pixel Data
DetId detId(detid);
Expand All @@ -304,7 +304,7 @@ class SiStripTkMaps {
}
} else {
if (i % 2 == 0) {
x[ix] = static_cast<TObjString*>(array->At(i))->String().Atof();
x[ix] = atof((t.value()).c_str());
if (x[ix] < minx) {
minx = x[ix];
}
Expand All @@ -313,7 +313,7 @@ class SiStripTkMaps {
}
++ix;
} else {
y[iy] = static_cast<TObjString*>(array->At(i))->String().Atof();
y[iy] = atof((t.value()).c_str());
if (y[iy] < miny) {
miny = y[iy];
}
Expand Down
24 changes: 12 additions & 12 deletions CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ namespace {
*************************************************/

template <int ntags, IOVMultiplicity nIOVs>
class SiStripApvGainsRatioWithPreviousIOVTrackerMapBase : public PlotImage<SiStripApvGain, nIOVs, ntags> {
class SiStripApvGainsRatioTrackerMapBase : public PlotImage<SiStripApvGain, nIOVs, ntags> {
public:
SiStripApvGainsRatioWithPreviousIOVTrackerMapBase()
SiStripApvGainsRatioTrackerMapBase()
: PlotImage<SiStripApvGain, nIOVs, ntags>("Tracker Map of ratio of SiStripGains with previous IOV") {
PlotBase::addInputParam("nsigma");
}
Expand Down Expand Up @@ -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 <int ntags, IOVMultiplicity nIOVs>
class SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase : public PlotImage<SiStripApvGain, nIOVs, ntags> {
class SiStripApvGainsRatioMaxDeviationTrackerMapBase : public PlotImage<SiStripApvGain, nIOVs, ntags> {
public:
SiStripApvGainsRatioMaxDeviationWithPreviousIOVTrackerMapBase()
SiStripApvGainsRatioMaxDeviationTrackerMapBase()
: PlotImage<SiStripApvGain, nIOVs, ntags>(
"Tracker Map of ratio (for largest deviation) of SiStripGains with previous IOV") {
PlotBase::addInputParam("nsigma");
Expand All @@ -677,9 +675,11 @@ namespace {
auto ip = paramValues.find("nsigma");
if (ip != paramValues.end()) {
nsigma = boost::lexical_cast<unsigned int>(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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

//=========================

Expand Down

0 comments on commit 1c97e5f

Please sign in to comment.