17 #include "TPaveStats.h"
36 EcalAlignmentPlot() :
cond::payloadInspector::PlotImage<
Alignments>(
"ECAL Alignment - map ") { setSingleIov(
true); }
38 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
39 auto iov = iovs.front();
40 std::shared_ptr<Alignments>
payload =
42 unsigned int run = std::get<0>(iov);
47 NbRows = (*payload).m_align.size();
57 align =
new TH2F(
"Align",
58 "x y z Phi Theta Psi",
66 double row = NbRows - 0.5;
67 for (std::vector<AlignTransform>::const_iterator it = (*payload).m_align.begin();
68 it != (*payload).m_align.end();
70 align->Fill(0.5, row, (*it).translation().x());
71 align->Fill(1.5, row, (*it).translation().y());
72 align->Fill(2.5, row, (*it).translation().z());
73 align->Fill(3.5, row, (*it).rotation().getPhi());
74 align->Fill(4.5, row, (*it).rotation().getTheta());
75 align->Fill(5.5, row, (*it).rotation().getPsi());
82 gStyle->SetPalette(1);
83 gStyle->SetOptStat(0);
84 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
90 t1.DrawLatex(0.5, 0.96, Form(
"Ecal %s Alignment, IOV %i", subdet.c_str(),
run));
94 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
100 for (
int i = 1;
i < NbRows;
i++) {
101 double y = (double)
i;
102 l =
new TLine(0.,
y, 6.,
y);
106 for (
int i = 1;
i < 6;
i++) {
107 double x = (double)
i;
108 double y = (double)NbRows;
109 l =
new TLine(
x, 0.,
x,
y);
113 align->GetXaxis()->SetTickLength(0.);
114 align->GetXaxis()->SetLabelSize(0.);
115 align->GetYaxis()->SetTickLength(0.);
116 align->GetYaxis()->SetLabelSize(0.);
119 canvas.SaveAs(ImageName.c_str());
129 EcalAlignmentDiff() :
cond::payloadInspector::PlotImage<
Alignments>(
"ECAL Alignment difference") {
133 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
134 unsigned int run[2], irun = 0;
136 TH2F*
align =
new TH2F(
"",
"", 1, 0., 1., 1, 0., 1.);
140 for (
auto const& iov : iovs) {
142 run[irun] = std::get<0>(iov);
145 NbRows = (*payload).m_align.size();
149 else if (NbRows == 4)
151 else if (NbRows == 8)
156 align =
new TH2F(
"Align",
157 "x y z Phi Theta Psi",
166 double row = NbRows - 0.5;
168 for (std::vector<AlignTransform>::const_iterator it = (*payload).m_align.begin();
169 it != (*payload).m_align.end();
172 val[0][irow] = (*it).translation().x();
173 val[1][irow] = (*it).translation().y();
174 val[2][irow] = (*it).translation().z();
175 val[3][irow] = (*it).rotation().getPhi();
176 val[4][irow] = (*it).rotation().getTheta();
177 val[5][irow] = (*it).rotation().getPsi();
179 align->Fill(0.5, row, (*it).translation().x() -
val[0][irow]);
180 align->Fill(1.5, row, (*it).translation().y() -
val[1][irow]);
181 align->Fill(2.5, row, (*it).translation().z() -
val[2][irow]);
182 align->Fill(3.5, row, (*it).rotation().getPhi() -
val[3][irow]);
183 align->Fill(4.5, row, (*it).rotation().getTheta() -
val[3][irow]);
184 align->Fill(5.5, row, (*it).rotation().getPsi() -
val[5][irow]);
196 gStyle->SetPalette(1);
197 gStyle->SetOptStat(0);
198 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
202 t1.SetTextSize(0.05);
204 t1.DrawLatex(0.5, 0.96, Form(
"Ecal %s Alignment, IOV %i - %i", subdet.c_str(),
run[1],
run[0]));
206 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
210 TLine*
l =
new TLine;
213 for (
int i = 1;
i < NbRows;
i++) {
214 double y = (double)
i;
215 l =
new TLine(0.,
y, 6.,
y);
219 for (
int i = 1;
i < 6;
i++) {
220 double x = (double)
i;
221 double y = (double)NbRows;
222 l =
new TLine(
x, 0.,
x,
y);
226 align->GetXaxis()->SetTickLength(0.);
227 align->GetXaxis()->SetLabelSize(0.);
228 align->GetYaxis()->SetTickLength(0.);
229 align->GetYaxis()->SetLabelSize(0.);
232 canvas.SaveAs(ImageName.c_str());