17 #include "TPaveStats.h" 34 cond::payloadInspector::PlotImage<
Alignments>(
"ECAL Alignment - map ") {
38 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
39 auto iov = iovs.front();
41 unsigned int run = std::get < 0 > (iov);
46 NbRows = (*payload).m_align.size();
56 align =
new TH2F(
"Align",
"x y z Phi Theta Psi",
57 6, 0, 6, NbRows, 0, NbRows);
59 double row = NbRows - 0.5;
60 for (std::vector<AlignTransform>::const_iterator it =
61 (*payload).m_align.begin(); it != (*payload).m_align.end();it++) {
63 align->Fill(0.5, row, (*it).translation().x());
64 align->Fill(1.5, row, (*it).translation().y());
65 align->Fill(2.5, row, (*it).translation().z());
66 align->Fill(3.5, row, (*it).rotation().getPhi());
67 align->Fill(4.5, row, (*it).rotation().getTheta());
68 align->Fill(5.5, row, (*it).rotation().getPsi());
75 gStyle->SetPalette(1);
76 gStyle->SetOptStat(0);
77 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
83 t1.DrawLatex(0.5, 0.96,Form(
"Ecal %s Alignment, IOV %i", subdet.c_str(),
run));
87 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
93 for (
int i = 1;
i < NbRows;
i++) {
94 double y = (double)
i;
95 l =
new TLine(0., y, 6., y);
99 for (
int i = 1;
i < 6;
i++) {
100 double x = (double)
i;
101 double y = (double) NbRows;
102 l =
new TLine(x, 0., x, y);
106 align->GetXaxis()->SetTickLength(0.);
107 align->GetXaxis()->SetLabelSize(0.);
108 align->GetYaxis()->SetTickLength(0.);
109 align->GetYaxis()->SetLabelSize(0.);
112 canvas.SaveAs(ImageName.c_str());
123 EcalAlignmentDiff() :
124 cond::payloadInspector::PlotImage<
Alignments>(
"ECAL Alignment difference") {
128 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
130 unsigned int run[2], irun = 0;
132 TH2F* align =
new TH2F(
"",
"", 1, 0., 1., 1, 0., 1.);
136 for (
auto const & iov : iovs) {
137 std::shared_ptr < Alignments > payload = fetchPayload(std::get < 1 > (iov));
138 run[irun] = std::get < 0 > (iov);
141 NbRows = (*payload).m_align.size();
145 else if (NbRows == 4)
147 else if (NbRows == 8)
153 new TH2F(
"Align",
"x y z Phi Theta Psi",
154 6, 0, 6, NbRows, 0, NbRows);
157 double row = NbRows - 0.5;
159 for (std::vector<AlignTransform>::const_iterator it =(*payload).m_align.begin();
160 it != (*payload).m_align.end(); it++) {
163 val[0][irow] = (*it).translation().x();
164 val[1][irow] = (*it).translation().y();
165 val[2][irow] = (*it).translation().z();
166 val[3][irow] = (*it).rotation().getPhi();
167 val[4][irow] = (*it).rotation().getTheta();
168 val[5][irow] = (*it).rotation().getPsi();
170 align->Fill(0.5, row,(*it).translation().x() - val[0][irow]);
171 align->Fill(1.5, row,(*it).translation().y() - val[1][irow]);
172 align->Fill(2.5, row,(*it).translation().z() - val[2][irow]);
173 align->Fill(3.5, row,(*it).rotation().getPhi() - val[3][irow]);
174 align->Fill(4.5, row,(*it).rotation().getTheta() - val[3][irow]);
175 align->Fill(5.5, row,(*it).rotation().getPsi() - val[5][irow]);
187 gStyle->SetPalette(1);
188 gStyle->SetOptStat(0);
189 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
193 t1.SetTextSize(0.05);
195 t1.DrawLatex(0.5, 0.96,Form(
"Ecal %s Alignment, IOV %i - %i", subdet.c_str(), run[1],run[0]));
197 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
201 TLine* l =
new TLine;
204 for (
int i = 1;
i < NbRows;
i++) {
205 double y = (double)
i;
206 l =
new TLine(0., y, 6., y);
210 for (
int i = 1;
i < 6;
i++) {
211 double x = (double)
i;
212 double y = (double) NbRows;
213 l =
new TLine(x, 0., x, y);
217 align->GetXaxis()->SetTickLength(0.);
218 align->GetXaxis()->SetLabelSize(0.);
219 align->GetYaxis()->SetTickLength(0.);
220 align->GetYaxis()->SetLabelSize(0.);
223 canvas.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
#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)