17 #include "TPaveStats.h" 31 EcalGainRatiosPlot() :
cond::payloadInspector::PlotImage<
EcalGainRatios>(
"ECAL Gain Ratios - map ") {
35 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
42 TH1F* b_12O6 =
new TH1F(
"b_12O6",
"EB gain 12/6", 50, 1.8, 2.1);
43 TH1F* e_12O6 =
new TH1F(
"e_12O6",
"EE gain 12/6", 50, 1.8, 2.1);
44 TH1F* b_6O1 =
new TH1F(
"b_6O1",
"EB gain 6/1", 100, 5.3, 6.3);
45 TH1F* e_6O1 =
new TH1F(
"e_6O1",
"EE gain 6/1", 100, 5.3, 6.3);
47 auto iov = iovs.front();
49 unsigned int run = std::get<0>(iov);
54 Double_t
phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
55 Double_t
eta = (Double_t)(
EBDetId(rawid)).ieta();
56 if(eta > 0.) eta = eta - 0.5;
58 barrel_12O6->Fill(phi, eta, (*payload)[rawid].gain12Over6());
59 barrel_6O1->Fill(phi, eta, (*payload)[rawid].gain6Over1());
60 b_12O6->Fill((*payload)[rawid].gain12Over6());
61 b_6O1->Fill((*payload)[rawid].gain6Over1());
69 if (myEEId.zside() == 1) {
70 endc_p_12O6->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain12Over6());
71 endc_p_6O1->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain6Over1());
74 endc_m_12O6->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain12Over6());
75 endc_m_6O1->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain6Over1());
77 e_12O6->Fill((*payload)[rawid].gain12Over6());
78 e_6O1->Fill((*payload)[rawid].gain6Over1());
83 gStyle->SetPalette(1);
84 gStyle->SetOptStat(0);
85 TCanvas
canvas(
"CC map",
"CC map",1680,1320);
90 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Gain Ratios, IOV %i", run));
92 float xmi[3] = {0.0 , 0.22, 0.78};
93 float xma[3] = {0.22, 0.78, 1.00};
94 TPad*** pad =
new TPad**[2];
95 for (
int gId = 0; gId < 2; gId++) {
96 pad[gId] =
new TPad*[3];
98 float yma = 0.94 - (0.32 * gId);
99 float ymi = yma - 0.28;
100 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
101 xmi[
obj], ymi, xma[obj], yma);
102 pad[gId][
obj]->Draw();
105 TPad** pad1 =
new TPad*[4];
107 float xmi = 0.26 *
obj;
108 float xma = xmi + 0.22;
109 pad1[
obj] =
new TPad(Form(
"p1_%i",
obj),Form(
"p1_%i",
obj),
110 xmi, 0.0, xma, 0.32);
114 float min12O6 = 1.8, max12O6 = 2.1, min6O1 = 5.3, max6O1 = 6.3;
116 DrawEE(endc_m_12O6, min12O6, max12O6);
117 endc_m_12O6->SetStats(
false);
119 DrawEB(barrel_12O6, min12O6, max12O6);
120 barrel_12O6->SetStats(
false);
122 DrawEE(endc_p_12O6, min12O6, max12O6);
123 endc_p_12O6->SetStats(
false);
125 DrawEE(endc_m_6O1, min6O1, max6O1);
126 endc_m_6O1->SetStats(
false);
128 DrawEB(barrel_6O1, min6O1, max6O1);
129 barrel_6O1->SetStats(
false);
131 DrawEE(endc_p_6O1, min6O1, max6O1);
132 endc_p_6O1->SetStats(
false);
134 gStyle->SetOptStat(111110);
138 TPaveStats *st = (TPaveStats*)b_12O6->FindObject(
"stats");
144 st = (TPaveStats*)e_12O6->FindObject(
"stats");
150 st = (TPaveStats*)b_6O1->FindObject(
"stats");
156 st = (TPaveStats*)e_6O1->FindObject(
"stats");
161 canvas.SaveAs(ImageName.c_str());
172 EcalGainRatiosDiff() :
cond::payloadInspector::PlotImage<
EcalGainRatios>(
"ECAL Gain Ratios difference") {
176 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
183 TH1F* b_12O6 =
new TH1F(
"b_12O6",
"EB gain 12/6 difference", 50, -0.1, 0.1);
184 TH1F* e_12O6 =
new TH1F(
"e_12O6",
"EE gain 12/6 difference", 50, -0.1, 0.1);
185 TH1F* b_6O1 =
new TH1F(
"b_6O1",
"EB gain 6/1 difference", 100, -0.1, 0.1);
186 TH1F* e_6O1 =
new TH1F(
"e_6O1",
"EE gain 6/1 difference", 100, -0.1, 0.1);
188 unsigned int run[2], irun = 0;
190 for (
auto const & iov: iovs) {
191 std::shared_ptr<EcalGainRatios> payload = fetchPayload( std::get<1>(iov) );
192 run[irun] = std::get<0>(iov);
198 gEB[0][cellid] = (*payload)[rawid].gain12Over6();
199 gEB[1][cellid] = (*payload)[rawid].gain6Over1();
202 Double_t phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
203 Double_t eta = (Double_t)(
EBDetId(rawid)).ieta();
204 if(eta > 0.) eta = eta - 0.5;
205 else eta = eta + 0.5;
206 float diff = gEB[0][cellid] - (*payload)[rawid].gain12Over6();
207 barrel_12O6->Fill(phi, eta, diff);
209 diff = gEB[1][cellid] - (*payload)[rawid].gain6Over1();
210 barrel_6O1->Fill(phi, eta, diff);
221 gEE[0][cellid] = (*payload)[rawid].gain12Over6();
222 gEE[1][cellid] = (*payload)[rawid].gain6Over1();
225 float diff1 = gEE[0][cellid] - (*payload)[rawid].gain12Over6();
226 float diff2 = gEE[1][cellid] - (*payload)[rawid].gain6Over1();
227 if (myEEId.zside() == 1) {
228 endc_p_12O6->Fill(myEEId.ix(), myEEId.iy(), diff1);
229 endc_p_6O1->Fill(myEEId.ix(), myEEId.iy(), diff2);
232 endc_m_12O6->Fill(myEEId.ix(), myEEId.iy(), diff1);
233 endc_m_6O1->Fill(myEEId.ix(), myEEId.iy(), diff2);
244 gStyle->SetPalette(1);
245 gStyle->SetOptStat(0);
246 TCanvas
canvas(
"CC map",
"CC map",1680,1320);
250 t1.SetTextSize(0.05);
251 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Gain Ratios, IOV %i - %i", run[1], run[0]));
253 float xmi[3] = {0.0 , 0.22, 0.78};
254 float xma[3] = {0.22, 0.78, 1.00};
255 TPad*** pad =
new TPad**[2];
256 for (
int gId = 0; gId < 2; gId++) {
257 pad[gId] =
new TPad*[3];
259 float yma = 0.94 - (0.32 * gId);
260 float ymi = yma - 0.28;
261 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId),Form(
"p_%i_%i",
obj, gId),
262 xmi[
obj], ymi, xma[obj], yma);
263 pad[gId][
obj]->Draw();
266 TPad** pad1 =
new TPad*[4];
268 float xmi = 0.26 *
obj;
269 float xma = xmi + 0.22;
270 pad1[
obj] =
new TPad(Form(
"p1_%i",
obj),Form(
"p1_%i",
obj),
271 xmi, 0.0, xma, 0.32);
275 float min12O6 = -0.1, max12O6 = 0.1, min6O1 = -0.1, max6O1 = 0.1;
277 DrawEE(endc_m_12O6, min12O6, max12O6);
278 endc_m_12O6->SetStats(
false);
280 DrawEB(barrel_12O6, min12O6, max12O6);
281 barrel_12O6->SetStats(
false);
283 DrawEE(endc_p_12O6, min12O6, max12O6);
284 endc_p_12O6->SetStats(
false);
286 DrawEE(endc_m_6O1, min6O1, max6O1);
287 endc_m_6O1->SetStats(
false);
289 DrawEB(barrel_6O1, min6O1, max6O1);
290 barrel_6O1->SetStats(
false);
292 DrawEE(endc_p_6O1, min6O1, max6O1);
293 endc_p_6O1->SetStats(
false);
295 gStyle->SetOptStat(111110);
299 TPaveStats *st = (TPaveStats*)b_12O6->FindObject(
"stats");
305 st = (TPaveStats*)e_12O6->FindObject(
"stats");
311 st = (TPaveStats*)b_6O1->FindObject(
"stats");
317 st = (TPaveStats*)e_6O1->FindObject(
"stats");
322 canvas.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
static EEDetId unhashIndex(int hi)
static bool validHashIndex(int i)
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)
void setSingleIov(bool flag)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays