1 #ifndef CONDCORE_BEAMSPOTPLUGINS_BEAMSPOTPAYLOADINSPECTORHELPER_H
2 #define CONDCORE_BEAMSPOTPLUGINS_BEAMSPOTPAYLOADINSPECTORHELPER_H
27 return std::make_pair(
run,
lumi);
68 return "should never be here";
76 template <parameters my_param,
class PayloadType>
84 auto ret = std::make_pair<double, double>(-9999., -9999.);
88 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
90 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
92 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
94 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
96 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
98 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
100 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
102 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
115 template <parameters my_param,
class PayloadType>
123 auto ret = std::make_pair<double, double>(-9999., -9999.);
127 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
129 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
131 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
133 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
135 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
137 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
139 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
141 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
154 template <parameters my_param,
class PayloadType>
162 auto ret = std::make_pair<double, double>(-9999., -9999.);
166 return std::make_pair<double, double>(
payload.GetX(),
payload.GetXError());
168 return std::make_pair<double, double>(
payload.GetY(),
payload.GetYError());
170 return std::make_pair<double, double>(
payload.GetZ(),
payload.GetZError());
172 return std::make_pair<double, double>(
payload.GetBeamWidthX(),
payload.GetBeamWidthXError());
174 return std::make_pair<double, double>(
payload.GetBeamWidthY(),
payload.GetBeamWidthYError());
176 return std::make_pair<double, double>(
payload.GetSigmaZ(),
payload.GetSigmaZError());
178 return std::make_pair<double, double>(
payload.Getdxdz(),
payload.GetdxdzError());
180 return std::make_pair<double, double>(
payload.Getdydz(),
payload.GetdydzError());
192 template <
class PayloadType>
205 template <
class PayloadType>
210 "Display of BeamSpot parameters") {
211 if constexpr (std::is_same_v<PayloadType, BeamSpotOnlineObjects>) {
218 bool fill()
override {
219 auto tag = cond::payloadInspector::PlotBase::getTag<0>();
221 auto iov =
tag.iovs.front();
223 gStyle->SetHistMinimumZero(kTRUE);
227 TCanvas
canvas(
"Beam Spot Parameters Summary",
"BeamSpot Parameters summary",
isOnline_ ? 1500 : 1000, 1000);
233 canvas.cd(1)->SetTopMargin(0.05);
234 canvas.cd(1)->SetBottomMargin(0.06);
235 canvas.cd(1)->SetLeftMargin(0.15);
236 canvas.cd(1)->SetRightMargin(0.03);
240 auto h2_BSParameters = std::unique_ptr<TH2F>(
new TH2F(
"Parameters",
"", 2, 0.0, 2.0, 8, 0, 8.));
241 h2_BSParameters->SetStats(
false);
294 h2_BSParameters->GetXaxis()->SetBinLabel(1,
"Value");
295 h2_BSParameters->GetXaxis()->SetBinLabel(2,
"Error");
297 unsigned int yBin = 8;
299 parameters param = static_cast<parameters>(foo);
301 h2_BSParameters->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
302 h2_BSParameters->SetBinContent(1,
yBin, cutFunctor(param,
false));
303 h2_BSParameters->SetBinContent(2,
yBin, cutFunctor(param,
true));
307 h2_BSParameters->GetXaxis()->LabelsOption(
"h");
308 h2_BSParameters->GetYaxis()->SetLabelSize(0.05);
309 h2_BSParameters->GetXaxis()->SetLabelSize(0.05);
310 h2_BSParameters->SetMarkerSize(1.5);
311 h2_BSParameters->Draw(
"TEXT");
316 ltx.SetTextSize(0.030);
318 ltx.SetTextSize(0.025);
320 ltx.SetTextAlign(11);
325 gPad->GetLeftMargin(),
326 1 - gPad->GetTopMargin() + 0.01,
327 (
tagname +
" IOV: #color[4]{" + std::to_string(runLS.first) +
"," + std::to_string(runLS.second) +
"}")
332 canvas.cd(2)->SetTopMargin(0.05);
333 canvas.cd(2)->SetBottomMargin(0.06);
334 canvas.cd(2)->SetLeftMargin(0.15);
335 canvas.cd(2)->SetRightMargin(0.03);
341 for (
int bin = 1;
bin <= extras->GetNbinsY();
bin++) {
343 << extras->GetYaxis()->GetBinLabel(
bin) <<
": " << extras->GetBinContent(1,
bin) <<
"\n";
346 extras->Draw(
"TEXT");
349 gPad->GetLeftMargin(),
350 1 - gPad->GetTopMargin() + 0.01,
351 (
tagname +
" IOV: #color[4]{" + std::to_string(runLS.first) +
"," + std::to_string(runLS.second) +
"}")
383 return "#sigma_{X} [cm]";
385 return "#sigma_{Y} [cm]";
387 return "#sigma_{Z} [cm]";
389 return "#frac{dX}{dZ} [rad]";
391 return "#frac{dY}{dZ} [rad]";
393 return "should never be here";