17 #include "TPaveStats.h"
28 EcalTimeOffsetConstantPlot()
34 auto iov =
iovs.front();
36 unsigned int run = std::get<0>(iov);
42 align =
new TH2F(
"Time Offset Constant [ns]",
"EB EE", 2, 0, 2, NbRows, 0, NbRows);
45 double row = NbRows - 0.5;
52 gStyle->SetPalette(1);
53 gStyle->SetOptStat(0);
54 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
60 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Time Offset Constant, IOV %i", run));
62 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
69 align->GetXaxis()->SetTickLength(0.);
70 align->GetXaxis()->SetLabelSize(0.);
71 align->GetYaxis()->SetTickLength(0.);
72 align->GetYaxis()->SetLabelSize(0.);
75 canvas.SaveAs(ImageName.c_str());
84 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
85 class EcalTimeOffsetConstantDiffBase
88 EcalTimeOffsetConstantDiffBase()
90 "Ecal Time Offset Constant difference") {}
92 bool fill()
override {
93 unsigned int run[2], NbRows = 0;
95 TH2F* align =
new TH2F(
"",
"", 1, 0., 1., 1, 0., 1.);
97 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().
iovs;
98 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
99 auto firstiov =
iovs.front();
100 run[0] = std::get<0>(firstiov);
101 std::tuple<cond::Time_t, cond::Hash> lastiov;
103 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().
iovs;
104 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
105 lastiov = tag2iovs.front();
107 lastiov =
iovs.back();
108 l_tagname[1] = l_tagname[0];
110 run[1] = std::get<0>(lastiov);
111 for (
int irun = 0; irun < nIOVs; irun++) {
112 std::shared_ptr<EcalTimeOffsetConstant>
payload;
122 align =
new TH2F(
"Ecal Time Offset Constant [ns]",
"EB EE", 2, 0, 2, NbRows, 0, NbRows);
131 double row = NbRows - 0.5;
132 align->Fill(0.5, row, it.
getEBValue() - val[0]);
133 align->Fill(1.5, row, it.
getEEValue() - val[1]);
141 gStyle->SetPalette(1);
142 gStyle->SetOptStat(0);
143 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
148 int len = l_tagname[0].length() + l_tagname[1].length();
151 t1.SetTextSize(0.02);
152 t1.DrawLatex(0.5, 0.96, Form(
"%s %i - %s %i", l_tagname[1].c_str(), run[1], l_tagname[0].c_str(), run[0]));
154 t1.SetTextSize(0.03);
155 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Time Offset Constant, IOV %i - %i", run[1], run[0]));
158 t1.SetTextSize(0.03);
159 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i - %i", l_tagname[0].c_str(), run[1], run[0]));
162 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
169 align->GetXaxis()->SetTickLength(0.);
170 align->GetXaxis()->SetLabelSize(0.);
171 align->GetYaxis()->SetTickLength(0.);
172 align->GetYaxis()->SetLabelSize(0.);
175 canvas.SaveAs(ImageName.c_str());
179 using EcalTimeOffsetConstantDiffOneTag = EcalTimeOffsetConstantDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
180 using EcalTimeOffsetConstantDiffTwoTags = EcalTimeOffsetConstantDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void drawTable(int nbRows, int nbColumns)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)