1 #ifndef CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H
2 #define CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H
10 #include <boost/range/adaptor/indexed.hpp>
18 sprintf(
temp,
"%d",
i);
64 const std::vector<std::string>
IDlabels = {
"Barrel Pixel L1",
68 "FPIX(-) Disk 1 inner ring",
69 "FPIX(-) Disk 1 outer ring",
70 "FPIX(-) Disk 2 inner ring",
71 "FPIX(-) Disk 2 outer ring",
72 "FPIX(-) Disk 3 inner ring",
73 "FPIX(-) Disk 3 outer ring",
74 "FPIX(+) Disk 1 inner ring",
75 "FPIX(+) Disk 1 outer ring",
76 "FPIX(+) Disk 2 inner ring",
77 "FPIX(+) Disk 2 outer ring",
78 "FPIX(+) Disk 3 inner ring",
79 "FPIX(+) Disk 3 outer ring",
85 PixelId bpixLayer = static_cast<PixelId>(1000 + 100 * layer);
92 PixelId fpixRing = static_cast<PixelId>(2000 + 100 * side + 10 * disk +
ring);
99 unsigned int subid = detId.
subdetId();
100 unsigned int pixid = 0;
107 int side = trackTopo->
pxfSide(detId);
114 PixelId pixID = static_cast<PixelId>(pixid);
122 std::vector<uint32_t>
out = {};
126 m_fp =
edm::FileInPath(
"SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");
129 m_fp =
edm::FileInPath(
"CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt");
133 const std::vector<uint32_t>& pxldetids = pxlreader.
getAllDetIds();
134 for (
const auto&
d : pxldetids) {
145 out.push_back(0xFFFFFFFF);
148 COUT <<
"ID:" << theId <<
" ";
177 for (
const auto& pixelId :
PixelIDs | boost::adaptors::indexed(0)) {
178 m_theMap[pixelId.value()] = std::make_shared<TH1F>((title_label +
itoa(pixelId.value())).c_str(),
180 (
IDlabels.at(pixelId.index())).c_str(),
191 void fill(
const unsigned int detid,
const float value) {
198 << detid <<
" :=> " << myId <<
" is not a recongnized PixelId enumerator!" << std::endl;
203 void draw(TCanvas& canv,
bool isBarrel,
const char*
option =
"bar2",
bool isPhase1Comparison =
false) {
205 for (
int j = 1;
j <= 4;
j++) {
209 canv.cd(
j)->SetLogy();
211 if ((
j == 4) && !
m_isPhase1 && !isPhase1Comparison) {
218 t2.SetTextColor(kBlack);
219 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
225 for (
int j = 1;
j <= 12;
j++) {
229 canv.cd(
j)->SetLogy();
231 if ((
j % 6 == 5 ||
j % 6 == 0) && !
m_isPhase1 && !isPhase1Comparison) {
238 t2.SetTextColor(kBlack);
239 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
248 void beautify(
const int linecolor = kBlack,
const int fillcolor = kRed) {
250 plot.second->SetTitle(
"");
252 plot.second->GetYaxis()->SetRangeUser(0.,
plot.second->GetMaximum() * 1.30);
254 plot.second->GetYaxis()->SetRangeUser(0.1,
plot.second->GetMaximum() * 100.);
256 plot.second->SetLineColor(linecolor);
258 plot.second->SetFillColor(fillcolor);
260 plot.second->SetMarkerStyle(20);
261 plot.second->SetMarkerSize(1);
263 plot.second->SetStats(
true);
273 TPaveStats* st = (TPaveStats*)
plot.second->FindObject(
"stats");
275 st->SetTextSize(0.03);
276 st->SetLineColor(10);
277 if (
plot.second->GetFillColor() != 0) {
278 st->SetTextColor(
plot.second->GetFillColor());
280 st->SetTextColor(
plot.second->GetLineColor());
293 throw cms::Exception(
"PixelRegionContainer") <<
"No histogram is available for PixelId" << theId <<
"\n";
300 auto thePixId =
plot.first;
302 plot.second->GetYaxis()->SetRangeUser(extrema.first, extrema.second);
303 the2ndContainer.
getHistoFromMap(thePixId)->GetYaxis()->SetRangeUser(extrema.first, extrema.second);