34 #include "TPaveStats.h"
35 #include "TPaletteAxis.h"
44 RunInfoTest() :
cond::payloadInspector::Histogram1D<
RunInfo>(
"Test RunInfo",
"Test RunInfo", 10, 0.0, 10.0) {
45 Base::setSingleIov(
true);
48 bool fill()
override {
49 auto tag = PlotBase::getTag<0>();
50 for (
auto const& iov :
tag.iovs) {
66 RunInfoParameters() :
cond::payloadInspector::PlotImage<
RunInfo>(
"Display of RunInfo parameters") {
70 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
71 auto iov = iovs.front();
74 TCanvas
canvas(
"Beam Spot Parameters Summary",
"RunInfo Parameters summary", 1000, 1000);
77 gStyle->SetHistMinimumZero();
80 canvas.SetBottomMargin(0.06);
82 canvas.SetRightMargin(0.02);
86 auto h2_RunInfoParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"", 1, 0.0, 1.0, 11, 0, 11.));
87 auto h2_RunInfoState = std::unique_ptr<TH2F>(
new TH2F(
"State",
"", 1, 0.0, 1.0, 11, 0, 11.));
88 h2_RunInfoParameters->SetStats(
false);
89 h2_RunInfoState->SetStats(
false);
104 return payload->m_start_current;
106 return payload->m_stop_current;
114 return payload->m_run_intervall_micros;
116 return fieldIntensity;
126 h2_RunInfoParameters->GetXaxis()->SetBinLabel(1,
"Value");
127 h2_RunInfoState->GetXaxis()->SetBinLabel(1,
"Value");
129 unsigned int yBin = 11;
133 h2_RunInfoState->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
134 h2_RunInfoParameters->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
135 h2_RunInfoParameters->SetBinContent(1,
yBin, cutFunctor(param));
138 if ((
payload->m_avg_current) <= -1) {
140 h2_RunInfoState->SetBinContent(1,
yBin, 0.);
143 h2_RunInfoState->SetBinContent(1,
yBin, 1.);
147 h2_RunInfoState->SetBinContent(1,
yBin, 0.9);
152 h2_RunInfoParameters->GetXaxis()->LabelsOption(
"h");
153 h2_RunInfoParameters->GetYaxis()->SetLabelSize(0.05);
154 h2_RunInfoParameters->GetXaxis()->SetLabelSize(0.05);
155 h2_RunInfoParameters->SetMarkerSize(1.5);
157 h2_RunInfoState->GetXaxis()->LabelsOption(
"h");
158 h2_RunInfoState->GetYaxis()->SetLabelSize(0.05);
159 h2_RunInfoState->GetXaxis()->SetLabelSize(0.05);
160 h2_RunInfoState->SetMarkerSize(1.5);
163 h2_RunInfoState->Draw(
"col");
165 h2_RunInfoParameters->Draw(
"TEXTsame");
170 t1.SetTextSize(0.03);
171 t1.DrawLatex(0.1, 0.98,
"RunInfo parameters:");
172 t1.DrawLatex(0.1, 0.95,
"payload:");
176 t1.DrawLatex(0.37, 0.982, Form(
"IOV %s", std::to_string(+std::get<0>(iov)).c_str()));
177 t1.DrawLatex(0.21, 0.952, Form(
" %s", (std::get<1>(iov)).c_str()));
190 template <RunInfoPI::parameters param>
193 RunInfoCurrentHistory()
196 ~RunInfoCurrentHistory()
override =
default;
203 return payload.m_start_current;
213 return fieldIntensity;
225 return "Magent start current [A]";
227 return "Magnet stop current [A]";
229 return "Magnet average current [A]";
231 return "Magnet max current [A]";
233 return "Magnet min current [A]";
235 return "B-field intensity [T]";
237 return "should never be here";
242 typedef RunInfoCurrentHistory<RunInfoPI::m_start_current> RunInfoStartCurrentHistory;
243 typedef RunInfoCurrentHistory<RunInfoPI::m_stop_current> RunInfoStopCurrentHistory;
244 typedef RunInfoCurrentHistory<RunInfoPI::m_avg_current> RunInfoAverageCurrentHistory;
245 typedef RunInfoCurrentHistory<RunInfoPI::m_max_current> RunInfoMaxCurrentHistory;
246 typedef RunInfoCurrentHistory<RunInfoPI::m_min_current> RunInfoMinCurrentHistory;
247 typedef RunInfoCurrentHistory<RunInfoPI::m_BField> RunInfoBFieldHistory;