37 #include "TPaveStats.h"
45 class SiPixelQualityTest
50 "SiPixelQuality test",
"SiPixelQuality test", 10, 0.0, 10.0) {}
52 bool fill()
override {
53 auto tag = PlotBase::getTag<0>();
54 for (
auto const& iov :
tag.iovs) {
59 auto theDisabledModules =
payload->getBadComponentList();
60 for (
const auto&
mod : theDisabledModules) {
62 for (
unsigned short n = 0;
n < 16;
n++) {
63 unsigned short mask = 1 <<
n;
64 if (
mod.BadRocs & mask)
67 COUT <<
"detId:" <<
mod.DetID <<
" error type:" <<
mod.errorType <<
" BadRocs:" << BadRocCount << std::endl;
79 class SiPixelQualityBadRocsSummary
82 SiPixelQualityBadRocsSummary()
84 "SiPixel Quality Summary") {}
86 bool fill()
override {
87 auto tag = PlotBase::getTag<0>();
88 for (
const auto& iov :
tag.iovs) {
92 COUT <<
"======================= " << unpacked.first <<
" : " << unpacked.second << std::endl;
93 auto theDisabledModules =
payload->getBadComponentList();
94 for (
const auto&
mod : theDisabledModules) {
95 COUT <<
"detId: " <<
mod.DetID <<
" |error type: " <<
mod.errorType <<
" |BadRocs: " <<
mod.BadRocs
101 TCanvas
canvas(
"Partion summary",
"partition summary", 1200, 1000);
103 canvas.SetBottomMargin(0.11);
104 canvas.SetLeftMargin(0.13);
105 canvas.SetRightMargin(0.05);
119 class SiPixelQualityBadRocsTimeHistory
122 SiPixelQualityBadRocsTimeHistory()
123 :
cond::payloadInspector::TimeHistoryPlot<
SiPixelQuality,
std::pair<double, double> >(
"bad ROCs count vs time",
127 return std::make_pair(extractBadRocCount(
payload), 0.);
131 unsigned int BadRocCount(0);
132 auto theDisabledModules =
payload.getBadComponentList();
133 for (
const auto&
mod : theDisabledModules) {
134 for (
unsigned short n = 0;
n < 16;
n++) {
135 unsigned short mask = 1 <<
n;
136 if (
mod.BadRocs & mask)
148 class SiPixelBPixQualityMap
151 SiPixelBPixQualityMap()
153 "SiPixelQuality Barrel Pixel Map"),
157 bool fill()
override {
158 auto tag = PlotBase::getTag<0>();
159 auto iov =
tag.iovs.front();
162 static const int n_layers = 4;
163 int nlad_list[n_layers] = {6, 14, 22, 32};
167 std::array<TH2D*, n_layers> h_bpix_occ;
169 for (
unsigned int lay = 1; lay <= 4; lay++) {
170 int nlad = nlad_list[lay - 1];
174 h_bpix_occ[lay - 1] =
new TH2D(
name.c_str(),
179 (nlad * 4 + 2) * divide_roc,
184 auto theDisabledModules =
payload->getBadComponentList();
185 for (
const auto&
mod : theDisabledModules) {
186 int coded_badRocs =
mod.BadRocs;
188 std::bitset<16> bad_rocs(coded_badRocs);
190 auto layer = m_trackerTopo.pxbLayer(
DetId(
mod.DetID));
195 if ((layer > 1 && s_module < 0))
196 isFlipped = !isFlipped;
200 COUT <<
"layer:" << layer <<
" ladder:" <<
ladder <<
" module:" <<
module <<
" signed ladder: " << s_ladder
201 <<
" signed module: " << s_module << std::endl;
205 for (
const auto&
bin : rocsToMask) {
206 h_bpix_occ[layer - 1]->SetBinContent(
bin.first,
bin.second, 1);
210 for (
const auto&
bin : rocsToMask) {
211 h_bpix_occ[layer - 1]->SetBinContent(std::get<0>(
bin), std::get<1>(
bin), 1);
217 gStyle->SetOptStat(0);
219 TCanvas
canvas(
"Summary",
"Summary", 1200, 1200);
221 canvas.SetBottomMargin(0.11);
222 canvas.SetLeftMargin(0.13);
223 canvas.SetRightMargin(0.05);
226 for (
unsigned int lay = 1; lay <= 4; lay++) {
232 for (
unsigned int lay = 1; lay <= 4; lay++) {
236 ltx.SetTextColor(kBlue);
237 ltx.SetTextSize(0.055);
238 ltx.SetTextAlign(11);
239 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
240 1 - gPad->GetTopMargin() + 0.01,
242 ? (
"IOV:" + std::to_string(unpacked.second)).c_str()
243 : (std::to_string(unpacked.first) +
"," + std::to_string(unpacked.second)).c_str());
249 canvas.SaveAs(
"outBPix.root");
263 class SiPixelFPixQualityMap
266 SiPixelFPixQualityMap()
268 "SiPixelQuality Forward Pixel Map"),
272 bool fill()
override {
273 auto tag = PlotBase::getTag<0>();
274 auto iov =
tag.iovs.front();
277 static const int n_rings = 2;
278 std::array<TH2D*, n_rings> h_fpix_occ;
283 int n =
ring == 1 ? 92 : 140;
284 float y =
ring == 1 ? 11.5 : 17.5;
288 h_fpix_occ[
ring - 1] =
new TH2D(
name.c_str(),
title.c_str(), 56 * divide_roc, -3.5, 3.5,
n * divide_roc, -
y,
y);
291 auto theDisabledModules =
payload->getBadComponentList();
292 for (
const auto&
mod : theDisabledModules) {
293 int coded_badRocs =
mod.BadRocs;
295 std::bitset<16> bad_rocs(coded_badRocs);
301 auto panel = m_trackerTopo.pxfPanel(
mod.DetID);
304 bool isFlipped = (s_disk > 0) ? (panel == 1) : (panel == 2);
306 COUT <<
"ring:" <<
ring <<
" blade: " << s_blade <<
" panel: " << panel
307 <<
" signed blade/panel: " << s_blade_panel <<
" disk: " << s_disk << std::endl;
311 for (
const auto&
bin : rocsToMask) {
312 h_fpix_occ[
ring - 1]->SetBinContent(
bin.first,
bin.second, 1);
316 for (
const auto&
bin : rocsToMask) {
317 h_fpix_occ[
ring - 1]->SetBinContent(std::get<0>(
bin), std::get<1>(
bin), 1);
323 gStyle->SetOptStat(0);
325 TCanvas
canvas(
"Summary",
"Summary", 1200, 600);
327 canvas.SetBottomMargin(0.11);
328 canvas.SetLeftMargin(0.13);
329 canvas.SetRightMargin(0.05);
342 ltx.SetTextColor(kBlue);
343 ltx.SetTextSize(0.050);
344 ltx.SetTextAlign(11);
345 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
346 1 - gPad->GetTopMargin() + 0.01,
348 ? (
"IOV:" + std::to_string(unpacked.second)).c_str()
349 : (std::to_string(unpacked.first) +
"," + std::to_string(unpacked.second)).c_str());
355 canvas.SaveAs(
"outFPix.root");