29 EcalTPGCrystalStatusPlot() :
cond::payloadInspector::PlotImage<
EcalTPGCrystalStatus>(
"ECAL TPGCrystalStatus - map ") {
33 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
37 int EBstat = 0, EEstat[2] = {0, 0};
39 auto iov = iovs.front();
41 unsigned int run = std::get<0>(iov);
44 Double_t
eta = (Double_t)ieta;
45 if(ieta == 0)
continue;
46 else if(ieta > 0.) eta = eta - 0.5;
48 for (
int iphi = 1; iphi <=
MAX_IPHI; iphi++) {
49 Double_t
phi = (Double_t)iphi - 0.5;
51 double val = (*payload)[
id.rawId()].getStatusCode();
52 barrel->Fill(phi, eta, val);
58 int thesign =
sign==1 ? 1:-1;
59 for (
int ix = 1; ix <=
IX_MAX; ix++) {
60 for (
int iy = 1; iy <=
IY_MAX; iy++) {
63 double val = (*payload)[
id.rawId()].getStatusCode();
65 endc_p->Fill(ix, iy, val);
66 if(val > 0) EEstat[1]++;
69 endc_m->Fill(ix, iy, val);
70 if(val > 0) EEstat[0]++;
77 gStyle->SetPalette(1);
78 gStyle->SetOptStat(0);
82 TCanvas
canvas(
"c",
"c", w, h);
89 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGCrystalStatus, IOV %i", run));
93 float xmi[3] = {0.0, 0.0, 0.5};
94 float xma[3] = {1.0, 0.5, 1.0};
95 float ymi[3] = {0.47, 0.0, 0.0};
96 float yma[3] = {0.94, 0.47, 0.47};
97 TPad** pad =
new TPad*;
99 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], ymi[obj], xma[obj], yma[obj]);
105 t1.DrawLatex(0.2, 0.94, Form(
"%i crystals", EBstat));
108 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[0]));
111 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[1]));
114 canvas.SaveAs(ImageName.c_str());
125 EcalTPGCrystalStatusDiff() :
cond::payloadInspector::PlotImage<
EcalTPGCrystalStatus>(
"ECAL TPGCrystalStatus difference") {
129 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
133 int EBstat = 0, EEstat[2] = {0, 0};
135 unsigned int run[2] = {0, 0}, irun = 0;
137 for (
auto const & iov: iovs) {
138 std::shared_ptr<EcalTPGCrystalStatus> payload = fetchPayload( std::get<1>(iov) );
139 run[irun] = std::get<0>(iov);
142 Double_t eta = (Double_t)ieta;
143 if(ieta == 0)
continue;
144 else if(ieta > 0.) eta = eta - 0.5;
145 else eta = eta + 0.5;
146 for (
int iphi = 1; iphi <=
MAX_IPHI; iphi++) {
147 Double_t phi = (Double_t)iphi - 0.5;
149 int channel =
id.hashedIndex();
150 double val = (*payload)[
id.rawId()].getStatusCode();
151 if(irun == 0) vEB[channel] =
val;
153 double diff = val - vEB[channel];
154 barrel->Fill(phi, eta, diff);
155 if(diff != 0) EBstat++;
162 int thesign =
sign==1 ? 1:-1;
163 for (
int ix = 1; ix <=
IX_MAX; ix++) {
164 for (
int iy = 1; iy <=
IY_MAX; iy++) {
167 int channel =
id.hashedIndex();
168 double val = (*payload)[
id.rawId()].getStatusCode();
169 if(irun == 0) vEE[channel] =
val;
171 double diff = val - vEE[channel];
173 endc_p->Fill(ix, iy, diff);
174 if(diff != 0) EEstat[1]++;
177 endc_m->Fill(ix, iy, diff);
178 if(diff != 0) EEstat[0]++;
189 gStyle->SetPalette(1);
190 gStyle->SetOptStat(0);
193 TCanvas
canvas(
"c",
"c", w, h);
199 t1.SetTextSize(0.05);
200 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGCrystalStatus, IOV %i - %i", run[1], run[0]));
204 float xmi[3] = {0.0, 0.0, 0.5};
205 float xma[3] = {1.0, 0.5, 1.0};
206 float ymi[3] = {0.47, 0.0, 0.0};
207 float yma[3] = {0.94, 0.47, 0.47};
208 std::vector<TPad*> pad;
210 pad.push_back(
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], ymi[obj], xma[obj], yma[obj]));
216 t1.DrawLatex(0.2, 0.94, Form(
"%i differences", EBstat));
219 t1.DrawLatex(0.15, 0.92, Form(
"%i differences", EEstat[0]));
222 t1.DrawLatex(0.15, 0.92, Form(
"%i differences", EEstat[1]));
225 canvas.SaveAs(ImageName.c_str());
235 EcalTPGCrystalStatusSummaryPlot() :
240 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
242 auto iov = iovs.front();
243 std::shared_ptr < EcalTPGCrystalStatus > payload = fetchPayload(std::get < 1 > (iov));
244 unsigned int run = std::get < 0 > (iov);
252 align =
new TH2F(
"Ecal TPGCrystal Status Error Summary",
"EB/EE-/EE+ ErrorCount Total Number",NbColumns, 0, NbColumns, NbRows, 0, NbRows);
254 long unsigned int ebErrorCount=0;
255 long unsigned int ee1ErrorCount=0;
256 long unsigned int ee2ErrorCount=0;
258 long unsigned int ebTotal=(payload->barrelItems()).
size();
259 long unsigned int ee1Total=0;
260 long unsigned int ee2Total=0;
262 getBarrelErrorSummary<EcalTPGCrystalStatusCode>(payload->barrelItems(),ebErrorCount);
263 getEndCapErrorSummary<EcalTPGCrystalStatusCode>(payload->endcapItems(), ee1ErrorCount, ee2ErrorCount, ee1Total, ee2Total);
266 double row = NbRows - 0.5;
269 align->Fill(0.5, row, 1);
270 align->Fill(1.5, row, ebErrorCount);
271 align->Fill(2.5, row, ebTotal);
275 align->Fill(0.5, row, 2);
276 align->Fill(1.5, row, ee1ErrorCount);
277 align->Fill(2.5, row, ee1Total);
282 align->Fill(0.5, row, 3);
283 align->Fill(1.5, row, ee2ErrorCount);
284 align->Fill(2.5, row, ee2Total);
290 gStyle->SetPalette(1);
291 gStyle->SetOptStat(0);
292 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
296 t1.SetTextSize(0.04);
298 t1.DrawLatex(0.5, 0.96,Form(
"EcalTPGCrystalStatus Error Summary, IOV %i", run));
301 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
308 align->GetXaxis()->SetTickLength(0.);
309 align->GetXaxis()->SetLabelSize(0.);
310 align->GetYaxis()->SetTickLength(0.);
311 align->GetYaxis()->SetLabelSize(0.);
314 canvas.SaveAs(ImageName.c_str());
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
void setSingleIov(bool flag)
void drawTable(int nbRows, int nbColumns)