20 enum { NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5 };
28 EcalTPGFineGrainStripEEPlot()
33 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
43 int EEcount[2] = {0, 0};
48 std::cout <<
"EcalTPGFineGrainStripEE File EEMap.txt not found" << std::endl;
52 uint32_t rawEE[NTCC][NTower][NStrip][NXtal];
53 int NbrawEE[NTCC][NTower][NStrip];
54 for (
int TCC = 0; TCC < NTCC; TCC++)
55 for (
int TT = 0; TT < NTower; TT++)
56 for (
int ST = 0; ST < NStrip; ST++)
57 NbrawEE[TCC][TT][ST] = 0;
61 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
62 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
63 f >> ix >> iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
64 pseudostrip_in_TCC >> pseudostrip_in_TT;
67 uint32_t rawId = detid.denseIndex();
68 if (tccid > NTCC ||
tower > NTower || pseudostrip_in_TT > NStrip || xtal_in_pseudostrip > NXtal) {
72 rawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1][xtal_in_pseudostrip - 1] = rawId;
73 NbrawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1]++;
80 auto iov = iovs.front();
82 unsigned int run = std::get<0>(iov);
83 double max1 = 1.0, max2 = 1.0;
89 for (itSt = stripMap.begin(); itSt != stripMap.end(); ++itSt) {
93 int strip = itSt->first / 8;
94 int pseudostrip =
strip & 0x7;
98 int tccid =
strip & 0x7F;
99 int NbXtalInStrip = NbrawEE[tccid - 1][
tt - 1][pseudostrip - 1];
103 for (
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
104 uint32_t rawId = rawEE[tccid - 1][
tt - 1][pseudostrip - 1][Xtal];
109 int iz = detid.
zside();
114 endc_thresh_m->Fill(
x + 0.5,
y + 0.5,
item.threshold);
115 endc_lut_m->Fill(
x + 0.5,
y + 0.5,
item.lut);
118 if (max1 <
item.threshold)
119 max1 =
item.threshold;
125 endc_thresh_p->Fill(
x + 0.5,
y + 0.5,
item.threshold);
126 endc_lut_p->Fill(
x + 0.5,
y + 0.5,
item.lut);
129 if (max1 <
item.threshold)
130 max1 =
item.threshold;
140 gStyle->SetPalette(1);
141 gStyle->SetOptStat(0);
142 const Int_t NRGBs = 5;
143 const Int_t NCont = 255;
145 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
146 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
147 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
148 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
149 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
150 gStyle->SetNumberContours(NCont);
159 t1.SetTextSize(0.04);
160 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPG Fine Grain StripEE, IOV %i",
run));
162 float xmi[4] = {0.0, 0.5, 0.0, 0.5};
163 float xma[4] = {0.5, 1.0, 0.5, 1.0};
165 float ymi[4] = {0.47, 0.47, 0.0, 0.0};
166 float yma[4] = {0.94, 0.94, 0.47, 0.47};
167 TPad** pad =
new TPad*;
176 DrawEE(endc_thresh_m, 0., max1);
177 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
180 DrawEE(endc_thresh_p, 0., max1);
181 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
184 DrawEE(endc_lut_m, 0., max2);
185 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
188 DrawEE(endc_lut_p, 0., max2);
189 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
193 canvas.SaveAs(ImageName.c_str());
198 delete endc_thresh_p;
199 delete endc_thresh_m;