22 enum { kEBTotalTowers = 2448, kEETotalTowers = 1584 };
30 EcalDQMTowerStatusPlot() :
cond::payloadInspector::PlotImage<
EcalDQMTowerStatus>(
"EcalDQMTowerStatus - map ") {
34 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
35 TH2F*
barrel =
new TH2F(
"EB",
"EB DQM Tower Status", 72, 0, 72, 34, -17, 17);
36 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ DQM Tower Status", 22, 0, 22, 22, 0, 22);
37 TH2F* endc_m =
new TH2F(
"EE-",
"EE- DQM Tower Status", 22, 0, 22, 22, 0, 22);
39 auto iov = iovs.front();
41 unsigned int run = std::get<0>(iov);
42 double maxEB = 0, maxEE = 0;
46 if (
payload->barrelItems().empty())
49 if ((*payload).find(rawid) == (*payload).end())
58 if (maxEB < (*
payload)[rawid].getStatusCode())
59 maxEB = (*payload)[rawid].getStatusCode();
62 if (
payload->endcapItems().empty())
68 if ((*payload).find(rawid) == (*payload).end())
72 int side = rawid.
zside();
74 endc_m->Fill(ix, iy, (*
payload)[rawid].getStatusCode());
76 endc_p->Fill(ix, iy, (*
payload)[rawid].getStatusCode());
78 if (maxEE < (*
payload)[rawid].getStatusCode())
79 maxEE = (*payload)[rawid].getStatusCode();
85 TCanvas
canvas(
"CC map",
"CC map", 800, 800);
90 t1.DrawLatex(0.5, 0.96, Form(
"Ecal DQM Tower Status, IOV %i",
run));
93 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.45, 1., 0.9);
95 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
97 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
100 TLine*
l =
new TLine(0., 0., 0., 0.);
104 barrel->SetMaximum(maxEB);
108 for (
int i = 0;
i < 17;
i++) {
109 Double_t
x = 4. + (
i * 4);
110 l =
new TLine(
x, -17.,
x, 17.);
114 l =
new TLine(0., 0., 72., 0.);
124 canvas.SaveAs(ImageName.c_str());
132 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
135 EcalDQMTowerStatusDiffBase()
137 bool fill()
override {
138 TH2F*
barrel =
new TH2F(
"EB",
"EB DQM Tower Status", 72, 0, 72, 34, -17, 17);
139 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ DQM Tower Status", 22, 0, 22, 22, 0, 22);
140 TH2F* endc_m =
new TH2F(
"EE-",
"EE- DQM Tower Status", 22, 0, 22, 22, 0, 22);
143 float pEB[kEBTotalTowers], pEE[kEETotalTowers];
146 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
147 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
148 auto firstiov = iovs.front();
149 run[0] = std::get<0>(firstiov);
150 std::tuple<cond::Time_t, cond::Hash> lastiov;
152 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
153 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
154 lastiov = tag2iovs.front();
156 lastiov = iovs.back();
157 l_tagname[1] = l_tagname[0];
159 run[1] = std::get<0>(lastiov);
160 for (
int irun = 0; irun < nIOVs; irun++) {
161 std::shared_ptr<EcalDQMTowerStatus>
payload;
169 if (
payload->barrelItems().empty())
173 if ((*payload).find(rawid) == (*payload).end())
176 float weight = (*payload)[rawid].getStatusCode();
185 unsigned int new_status = (*payload)[rawid].getStatusCode();
186 if (new_status != pEB[cellid]) {
189 if (new_status > pEB[cellid])
199 if (
payload->endcapItems().empty())
205 if ((*payload).find(rawid) == (*payload).end())
208 float weight = (*payload)[rawid].getStatusCode();
215 int side = rawid.
zside();
217 unsigned int new_status = (*payload)[rawid].getStatusCode();
218 if (new_status != pEE[cellid]) {
221 if (new_status > pEE[cellid])
227 endc_m->Fill(ix, iy, 0.05 + 0.95 * (tmp3 > 0));
229 endc_p->Fill(ix, iy, 0.05 + 0.95 * (tmp3 > 0));
237 TCanvas
canvas(
"CC map",
"CC map", 800, 800);
241 int len = l_tagname[0].length() + l_tagname[1].length();
242 if (ntags == 2 && len < 58) {
243 t1.SetTextSize(0.025);
245 0.5, 0.96, Form(
"%s IOV %i - %s IOV %i", l_tagname[1].c_str(),
run[1], l_tagname[0].c_str(),
run[0]));
247 t1.SetTextSize(0.04);
248 t1.DrawLatex(0.5, 0.96, Form(
"Ecal DQM Tower Status (Diff), IOV %i vs %i",
run[0],
run[1]));
250 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.45, 1., 0.9);
252 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
254 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
257 TLine*
l =
new TLine(0., 0., 0., 0.);
265 for (
int i = 0;
i < 17;
i++) {
266 Double_t
x = 4. + (
i * 4);
267 l =
new TLine(
x, -17.,
x, 17.);
271 l =
new TLine(0., 0., 72., 0.);
281 canvas.SaveAs(ImageName.c_str());
285 using EcalDQMTowerStatusDiffOneTag = EcalDQMTowerStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
286 using EcalDQMTowerStatusDiffTwoTags = EcalDQMTowerStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
int ieta() const
get the tower ieta
static EcalScDetId unhashIndex(int hi)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
void DrawEE_Tower(TH2F *endc, TLine *l, double minScale, double maxScale)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validHashIndex(int hi)
int iphi() const
get the tower iphi
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)