1 #ifndef CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H
2 #define CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H
11 #include <boost/range/adaptor/indexed.hpp>
20 sprintf(
temp,
"%d",
i);
62 const std::vector<std::string>
IDlabels = {
"Barrel Pixel L1",
66 "FPIX(-) Disk 1 inner ring",
67 "FPIX(-) Disk 1 outer ring",
68 "FPIX(-) Disk 2 inner ring",
69 "FPIX(-) Disk 2 outer ring",
70 "FPIX(-) Disk 3 inner ring",
71 "FPIX(-) Disk 3 outer ring",
72 "FPIX(+) Disk 1 inner ring",
73 "FPIX(+) Disk 1 outer ring",
74 "FPIX(+) Disk 2 inner ring",
75 "FPIX(+) Disk 2 outer ring",
76 "FPIX(+) Disk 3 inner ring",
77 "FPIX(+) Disk 3 outer ring",
100 std::vector<std::string>
out;
103 if (
label.find(
"Barrel") != std::string::npos) {
108 if (
label.find(
"Ring") != std::string::npos) {
112 if (
label.find(
"ring") != std::string::npos) {
124 PixelId bpixLayer = static_cast<PixelId>(1000 + 100 *
layer);
130 const unsigned int side,
131 const unsigned int disk,
132 const unsigned int ring) {
135 unsigned int prefix(2000);
136 unsigned int disk_(0);
156 unsigned int subid = detId.
subdetId();
157 unsigned int pixid = 0;
162 int side = trackTopo->
pxfSide(detId);
163 int disk = trackTopo->
pxfDisk(detId);
178 throw cms::Exception(
"LogicalError") <<
" there is not such phase as " << ph;
182 PixelId pixID = static_cast<PixelId>(pixid);
191 std::vector<uint32_t>
out = {};
197 m_fp =
edm::FileInPath(
"CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt");
201 m_fp =
edm::FileInPath(
"SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");
204 m_fp =
edm::FileInPath(
"SLHCUpgradeSimulations/Geometry/data/PhaseII/Tilted/PixelSkimmedGeometryT14.txt");
207 throw cms::Exception(
"LogicalError") <<
" there is not such phase as " << ph;
211 const std::vector<uint32_t>& pxldetids = pxlreader.
getAllDetIds();
212 for (
const auto&
d : pxldetids) {
223 out.push_back(0xFFFFFFFF);
226 COUT <<
"ID:" << theId <<
" ";
270 for (
const auto& pixelId :
PixelIDs | boost::adaptors::indexed(0)) {
278 m_theMap[pixelId.value()] = std::make_shared<TH1F>((title_label +
itoa(pixelId.value())).c_str(),
280 (
IDlabels.at(pixelId.index())).c_str(),
291 void fill(
const unsigned int detid,
const float value) {
301 << detid <<
" :=> " << myId <<
" is not a recongnized PixelId enumerator! \n"
307 void draw(TCanvas& canv,
bool isBarrel,
const char*
option =
"bar2",
bool isPhase1Comparison =
false) {
310 if (canv.GetListOfPrimitives()->GetSize() == 0) {
314 for (
int j = 1;
j <= 4;
j++) {
318 canv.cd(
j)->SetLogy();
320 if ((
j == 4) && (
m_Phase < 1) && !isPhase1Comparison) {
327 t2.SetTextColor(kBlack);
328 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
336 const std::array<int, 18> phase2Pattern = {{1, 2, 3, 4,
339 16, 17, 18, 19, 20}};
342 if (canv.GetListOfPrimitives()->GetSize() == 0) {
346 for (
int j = 1;
j <= maxPads;
j++) {
347 unsigned int mapIndex =
m_Phase == 2 ?
j + 15 :
j + 3;
352 canv.cd(
j)->SetLogy();
354 if ((
j % 6 == 5 ||
j % 6 == 0) && (
m_Phase < 1) && !isPhase1Comparison) {
361 t2.SetTextColor(kBlack);
362 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
371 void beautify(
const int linecolor = kBlack,
const int fillcolor = kRed) {
373 plot.second->SetTitle(
"");
375 plot.second->GetYaxis()->SetRangeUser(0.,
plot.second->GetMaximum() * 1.30);
377 plot.second->GetYaxis()->SetRangeUser(0.1,
plot.second->GetMaximum() * 100.);
379 plot.second->SetLineColor(linecolor);
381 plot.second->SetFillColor(fillcolor);
383 plot.second->SetMarkerStyle(20);
384 plot.second->SetMarkerSize(1);
386 plot.second->SetStats(
true);
396 TPaveStats* st = (TPaveStats*)
plot.second->FindObject(
"stats");
398 st->SetTextSize(0.03);
399 st->SetLineColor(10);
400 if (
plot.second->GetFillColor() != 0) {
401 st->SetTextColor(
plot.second->GetFillColor());
403 st->SetTextColor(
plot.second->GetLineColor());
417 <<
"PixelRegionContainer::getHistoFromMap(): No histogram is available for PixelId: " << theId <<
"\n";
424 auto thePixId =
plot.first;
426 plot.second->GetYaxis()->SetRangeUser(extrema.first, extrema.second);
427 the2ndContainer.
getHistoFromMap(thePixId)->GetYaxis()->SetRangeUser(extrema.first, extrema.second);