22 enum {kEBTotalTowers = 2448, kEETotalTowers = 1584};
31 EcalDQMTowerStatusPlot() :
cond::payloadInspector::PlotImage<
EcalDQMTowerStatus>(
"EcalDQMTowerStatus - map ") {
35 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
38 TH2F*
barrel =
new TH2F(
"EB",
"EB DQM Tower Status", 72, 0, 72, 34, -17, 17);
39 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ DQM Tower Status",22, 0, 22, 22, 0, 22);
40 TH2F* endc_m =
new TH2F(
"EE-",
"EE- DQM Tower Status",22, 0, 22, 22, 0, 22);
42 auto iov = iovs.front();
44 unsigned int run = std::get<0>(iov);
45 double maxEB = 0, maxEE = 0;
50 if (payload->barrelItems().empty())
break;
52 if ((*payload).find(rawid) == (*payload).end())
continue;
54 int ieta = rawid.
ieta();
56 int iphi = rawid.
iphi() - 1;
57 barrel->Fill(iphi, ieta, (*payload)[rawid].getStatusCode());
59 if(maxEB<(*payload)[rawid].getStatusCode())
60 maxEB=(*payload)[rawid].getStatusCode();
63 if (payload->endcapItems().empty())
69 if ((*payload).find(rawid) == (*payload).end())
continue;
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();
86 TCanvas
canvas(
"CC map",
"CC map",800,800);
91 t1.DrawLatex(0.5, 0.96, Form(
"Ecal DQM Tower Status, IOV %i", run));
94 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.45, 1., 0.9);
96 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
98 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
101 TLine*
l =
new TLine(0., 0., 0., 0.);
104 barrel->SetStats(
false);
105 barrel->SetMaximum(maxEB);
106 barrel->SetMinimum(0);
107 barrel->Draw(
"colz");
109 for(
int i = 0;
i <17;
i++) {
110 Double_t
x = 4.+ (
i * 4);
111 l =
new TLine(x, -17., x, 17.);
115 l =
new TLine(0., 0., 72., 0.);
127 canvas.SaveAs(ImageName.c_str());
139 EcalDQMTowerStatusDiffPlot() :
cond::payloadInspector::PlotImage<
EcalDQMTowerStatus>(
"EcalDQMTowerStatusDiff - map ") {
143 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
145 TH2F* barrel =
new TH2F(
"EB",
"EB DQM Tower Status", 72, 0, 72, 34, -17, 17);
146 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ DQM Tower Status",22, 0, 22, 22, 0, 22);
147 TH2F* endc_m =
new TH2F(
"EE-",
"EE- DQM Tower Status",22, 0, 22, 22, 0, 22);
149 unsigned int run[2], irun = 0;
150 float pEB[kEBTotalTowers], pEE[kEETotalTowers];
152 for (
auto const & iov: iovs) {
153 std::shared_ptr<EcalDQMTowerStatus> payload = fetchPayload( std::get<1>(iov) );
154 run[irun] = std::get<0>(iov);
159 if (payload->barrelItems().empty())
break;
162 if ((*payload).find(rawid) == (*payload).end())
continue;
164 float weight=(*payload)[rawid].getStatusCode();
169 int ieta = rawid.
ieta();
171 int iphi = rawid.
iphi() - 1;
172 unsigned int new_status = (*payload)[rawid].getStatusCode();
173 if(new_status != pEB[cellid]) {
176 if (new_status > pEB[cellid])
181 barrel->Fill(iphi, ieta, 0.05 + 0.95 * (tmp3>0));
186 if (payload->endcapItems().empty())
192 if ((*payload).find(rawid) == (*payload).end())
continue;
194 float weight=(*payload)[rawid].getStatusCode();
202 int side = rawid.
zside();
204 unsigned int new_status = (*payload)[rawid].getStatusCode();
205 if(new_status != pEE[cellid]) {
208 if (new_status > pEE[cellid])
214 endc_m->Fill(ix, iy, 0.05 + 0.95 * (tmp3>0));
216 endc_p->Fill(ix, iy, 0.05 + 0.95 * (tmp3>0));
228 TCanvas
canvas(
"CC map",
"CC map",800,800);
232 t1.SetTextSize(0.04);
233 t1.DrawLatex(0.5, 0.96, Form(
"Ecal DQM Tower Status (Diff), IOV %i vs %i", run[0], run[1]));
235 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.45, 1., 0.9);
237 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
239 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
242 TLine* l =
new TLine(0., 0., 0., 0.);
245 barrel->SetStats(
false);
246 barrel->SetMaximum(1.15);
247 barrel->SetMinimum(0);
248 barrel->Draw(
"colz");
250 for(
int i = 0;
i <17;
i++) {
251 Double_t x = 4.+ (
i * 4);
252 l =
new TLine(x, -17., x, 17.);
256 l =
new TLine(0., 0., 72., 0.);
268 canvas.SaveAs(ImageName.c_str());
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
static EcalScDetId unhashIndex(int hi)
int ieta() const
get the tower ieta
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
void DrawEE_Tower(TH2F *endc, TLine *l, double minScale, double maxScale)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
int iphi() const
get the tower iphi
void setSingleIov(bool flag)
static bool validHashIndex(int hi)