22 enum { TEMPLATESAMPLES = 5 };
30 EcalTPGFineGrainEBIdMapPlot()
36 TH2F**
barrel =
new TH2F*[TEMPLATESAMPLES];
37 double pEBmin[TEMPLATESAMPLES], pEBmax[TEMPLATESAMPLES];
38 std::string text[TEMPLATESAMPLES] = {
"ThresholdETLow",
"ThresholdETHigh",
"RatioLow",
"RatioHigh",
"LUT"};
41 for (
int s = 0;
s < TEMPLATESAMPLES; ++
s) {
42 char*
y =
new char[text[
s].length() + 1];
43 std::strcpy(y, text[
s].c_str());
47 uint32_t ThresholdETLow = 0;
48 uint32_t ThresholdETHigh = 0;
49 uint32_t RatioLow = 0;
50 uint32_t RatioHigh = 0;
53 auto iov =
iovs.front();
55 unsigned int run = std::get<0>(iov);
57 const std::map<uint32_t, EcalTPGFineGrainConstEB>& towerMap = (*payload).getMap();
58 std::map<uint32_t, EcalTPGFineGrainConstEB>::const_iterator it = towerMap.begin();
66 fg.
getValues(ThresholdETLow, ThresholdETHigh, RatioLow, RatioHigh, LUT);
68 barrel[0]->Fill(iphi, ieta, ThresholdETLow);
69 barrel[1]->Fill(iphi, ieta, ThresholdETHigh);
70 barrel[2]->Fill(iphi, ieta, RatioLow);
71 barrel[3]->Fill(iphi, ieta, RatioHigh);
72 barrel[4]->Fill(iphi, ieta, LUT);
74 if (ThresholdETLow < pEBmin[0])
75 pEBmin[0] = ThresholdETLow;
76 if (ThresholdETHigh < pEBmin[1])
77 pEBmin[1] = ThresholdETHigh;
78 if (RatioLow < pEBmin[2])
80 if (RatioHigh < pEBmin[3])
81 pEBmin[3] = RatioHigh;
85 if (ThresholdETLow > pEBmax[0])
86 pEBmax[0] = ThresholdETLow;
87 if (ThresholdETHigh > pEBmax[1])
88 pEBmax[1] = ThresholdETHigh;
89 if (RatioLow > pEBmax[2])
91 if (RatioHigh > pEBmax[3])
92 pEBmax[3] = RatioHigh;
102 gStyle->SetPalette(1);
103 gStyle->SetOptStat(0);
104 TCanvas
canvas(
"CC map",
"CC map", 1600, 2800);
108 t1.SetTextSize(0.04);
109 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGFine Grain EBIdMap, IOV %i", run));
114 TPad** pad =
new TPad*[TEMPLATESAMPLES];
115 for (
int s = 0;
s < TEMPLATESAMPLES;
s++) {
116 float yma = 0.94 - (0.16 *
s);
117 float ymi = yma - 0.14;
119 char* y =
new char[text[
s].length() + 1];
120 std::strcpy(y, text[
s].c_str());
122 pad[
s] =
new TPad(Form(
"Towers %i", EBcnt), y, xmi, ymi, xma, yma);
126 for (
int s = 0;
s < TEMPLATESAMPLES;
s++) {
129 if (pEBmin[
s] == pEBmax[
s]) {
130 pEBmin[
s] = pEBmin[
s] - 1.e-06;
131 pEBmax[
s] = pEBmax[
s] + 1.e-06;
134 barrel[
s]->SetMaximum(pEBmax[s]);
135 barrel[
s]->SetMinimum(pEBmin[s]);
136 barrel[
s]->Draw(
"colz");
138 TLine*
l =
new TLine(0., 0., 0., 0.);
141 Double_t
x = 4. + (
i * 4);
142 l =
new TLine(x, -MAX_IETA, x, MAX_IETA);
148 canvas.SaveAs(ImageName.c_str());
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
void getValues(uint32_t &ThresholdETLow, uint32_t &ThresholdETHigh, uint32_t &RatioLow, uint32_t &RatioHigh, uint32_t &LUT) const
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
std::vector< unsigned short int > LUT
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)