22 enum { NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5 };
30 EcalTPGFineGrainStripEEPlot()
45 int EEcount[2] = {0, 0};
50 std::cout <<
"EcalTPGFineGrainStripEE File EEMap.txt not found" << std::endl;
54 uint32_t rawEE[NTCC][NTower][NStrip][NXtal];
55 int NbrawEE[NTCC][NTower][NStrip];
56 for (
int TCC = 0; TCC < NTCC; TCC++)
57 for (
int TT = 0; TT < NTower; TT++)
58 for (
int ST = 0; ST < NStrip; ST++)
59 NbrawEE[TCC][TT][ST] = 0;
63 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
64 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
65 f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
66 pseudostrip_in_TCC >> pseudostrip_in_TT;
69 uint32_t rawId = detid.denseIndex();
70 if (tccid > NTCC || tower > NTower || pseudostrip_in_TT > NStrip || xtal_in_pseudostrip > NXtal) {
74 rawEE[tccid - 1][tower - 1][pseudostrip_in_TT - 1][xtal_in_pseudostrip - 1] = rawId;
75 NbrawEE[tccid - 1][tower - 1][pseudostrip_in_TT - 1]++;
82 auto iov =
iovs.front();
84 unsigned int run = std::get<0>(iov);
85 double max1 = 1.0, max2 = 1.0;
91 for (itSt = stripMap.begin(); itSt != stripMap.end(); ++itSt) {
95 int strip = itSt->first / 8;
96 int pseudostrip = strip & 0x7;
98 int tt = strip & 0x7F;
100 int tccid = strip & 0x7F;
101 int NbXtalInStrip = NbrawEE[tccid - 1][tt - 1][pseudostrip - 1];
105 for (
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
106 uint32_t rawId = rawEE[tccid - 1][tt - 1][pseudostrip - 1][Xtal];
109 float x = (float)detid.
ix();
110 float y = (float)detid.
iy();
111 int iz = detid.
zside();
116 endc_thresh_m->Fill(x + 0.5, y + 0.5, item.
threshold);
117 endc_lut_m->Fill(x + 0.5, y + 0.5, item.
lut);
127 endc_thresh_p->Fill(x + 0.5, y + 0.5, item.
threshold);
128 endc_lut_p->Fill(x + 0.5, y + 0.5, item.
lut);
142 gStyle->SetPalette(1);
143 gStyle->SetOptStat(0);
144 const Int_t NRGBs = 5;
145 const Int_t NCont = 255;
147 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
148 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
149 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
150 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
151 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
152 gStyle->SetNumberContours(NCont);
156 TCanvas
canvas(
"c",
"c", w, h);
161 t1.SetTextSize(0.04);
162 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPG Fine Grain StripEE, IOV %i", run));
164 float xmi[4] = {0.0, 0.5, 0.0, 0.5};
165 float xma[4] = {0.5, 1.0, 0.5, 1.0};
167 float ymi[4] = {0.47, 0.47, 0.0, 0.0};
168 float yma[4] = {0.94, 0.94, 0.47, 0.47};
169 std::array<std::unique_ptr<TPad>, 4> pad;
171 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], ymi[
obj], xma[
obj], yma[
obj]);
178 DrawEE(endc_thresh_m, 0., max1);
179 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
182 DrawEE(endc_thresh_p, 0., max1);
183 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
186 DrawEE(endc_lut_m, 0., max2);
187 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[0]));
190 DrawEE(endc_lut_p, 0., max2);
191 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEcount[1]));
195 canvas.SaveAs(ImageName.c_str());
199 delete endc_thresh_p;
200 delete endc_thresh_m;
static EEDetId detIdFromDenseIndex(uint32_t din)
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
void DrawEE(TH2F *endc, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)