1 #ifndef CONDCORE_BEAMSPOTPLUGINS_BEAMSPOTPAYLOADINSPECTORHELPER_H
2 #define CONDCORE_BEAMSPOTPLUGINS_BEAMSPOTPAYLOADINSPECTORHELPER_H
26 return std::make_pair(
run,
lumi);
67 return "should never be here";
75 template <parameters my_param,
class PayloadType>
83 auto ret = std::make_pair<double, double>(-9999., -9999.);
87 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
89 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
91 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
93 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
95 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
97 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
99 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
101 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
114 template <parameters my_param,
class PayloadType>
122 auto ret = std::make_pair<double, double>(-9999., -9999.);
126 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
128 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
130 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
132 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
134 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
136 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
138 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
140 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
153 template <parameters my_param,
class PayloadType>
161 auto ret = std::make_pair<double, double>(-9999., -9999.);
165 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
167 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
169 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
171 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
173 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
175 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
177 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
179 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
191 template <
class PayloadType>
204 template <
class PayloadType>
209 "Display of BeamSpot parameters") {
210 if constexpr (std::is_same_v<PayloadType, BeamSpotOnlineObjects>) {
217 bool fill()
override {
218 auto tag = cond::payloadInspector::PlotBase::getTag<0>();
220 auto iov =
tag.iovs.front();
224 TCanvas
canvas(
"Beam Spot Parameters Summary",
"BeamSpot Parameters summary",
isOnline_ ? 1500 : 1000, 1000);
230 canvas.cd(1)->SetTopMargin(0.05);
231 canvas.cd(1)->SetBottomMargin(0.06);
232 canvas.cd(1)->SetLeftMargin(0.15);
233 canvas.cd(1)->SetRightMargin(0.03);
237 auto h2_BSParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"", 2, 0.0, 2.0, 8, 0, 8.));
238 h2_BSParameters->SetStats(
false);
291 h2_BSParameters->GetXaxis()->SetBinLabel(1,
"Value");
292 h2_BSParameters->GetXaxis()->SetBinLabel(2,
"Error");
294 unsigned int yBin = 8;
296 parameters param = static_cast<parameters>(foo);
298 h2_BSParameters->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
299 h2_BSParameters->SetBinContent(1,
yBin, cutFunctor(param,
false));
300 h2_BSParameters->SetBinContent(2,
yBin, cutFunctor(param,
true));
304 h2_BSParameters->GetXaxis()->LabelsOption(
"h");
305 h2_BSParameters->GetYaxis()->SetLabelSize(0.05);
306 h2_BSParameters->GetXaxis()->SetLabelSize(0.05);
307 h2_BSParameters->SetMarkerSize(1.5);
308 h2_BSParameters->Draw(
"TEXT");
313 ltx.SetTextSize(0.040);
315 ltx.SetTextSize(0.032);
317 ltx.SetTextAlign(11);
322 gPad->GetLeftMargin(),
323 1 - gPad->GetTopMargin() + 0.01,
324 (
tagname +
" IOV: #color[4]{" + std::to_string(runLS.first) +
"," + std::to_string(runLS.second) +
"}")
329 canvas.cd(2)->SetTopMargin(0.05);
330 canvas.cd(2)->SetBottomMargin(0.06);
331 canvas.cd(2)->SetLeftMargin(0.15);
332 canvas.cd(2)->SetRightMargin(0.03);
338 for (
int bin = 1;
bin <= extras->GetNbinsY();
bin++) {
340 << extras->GetYaxis()->GetBinLabel(
bin) <<
": " << extras->GetBinContent(1,
bin) <<
"\n";
343 extras->Draw(
"TEXT");
346 gPad->GetLeftMargin(),
347 1 - gPad->GetTopMargin() + 0.01,
348 (
tagname +
" IOV: #color[4]{" + std::to_string(runLS.first) +
"," + std::to_string(runLS.second) +
"}")
380 return "#sigma_{X} [cm]";
382 return "#sigma_{Y} [cm]";
384 return "#sigma_{Z} [cm]";
386 return "#frac{dX}{dZ} [rad]";
388 return "#frac{dY}{dZ} [rad]";
390 return "should never be here";