1201 gStyle->SetOptStat(
"emr");
1202 TGaxis::SetExponentOffset(-0.1, 0.01,
"y");
1203 TH1F::SetDefaultSumw2(
true);
1208 auto theIOVs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
1209 auto f_tagname = cond::payloadInspector::PlotBase::getTag<0>().
name;
1211 auto firstiov = theIOVs.front();
1212 std::tuple<cond::Time_t, cond::Hash> lastiov;
1218 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
1219 l_tagname = cond::payloadInspector::PlotBase::getTag<1>().
name;
1220 lastiov = tag2iovs.front();
1222 lastiov = theIOVs.back();
1225 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1226 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1231 TCanvas
canvas(
"Canv",
"Canv", 1300, 800);
1241 array[0]->SetTitle(Form(
"SiPixel Gain Calibration %s - %s;per %s %s ratio;# %ss",
1248 array[1]->SetTitle(Form(
"SiPixel Gain Calibration %s - %s;per %s %s difference;# %ss",
1256 array[0]->SetTitle(
"");
1257 array[0]->SetLineColor(kBlack);
1258 array[0]->SetFillColor(kRed);
1259 array[0]->SetBarWidth(0.90);
1260 array[0]->SetMaximum(
array[0]->GetMaximum() * 10);
1261 array[0]->Draw(
"bar");
1263 array[0]->SetStats(
true);
1266 array[1]->SetTitle(
"");
1267 array[1]->SetLineColor(kBlack);
1268 array[1]->SetFillColor(kBlue);
1269 array[1]->SetBarWidth(0.90);
1270 array[1]->SetMaximum(
array[1]->GetMaximum() * 10);
1271 array[1]->Draw(
"bar");
1273 array[1]->SetStats(
true);
1279 latex.SetTextSize(0.024);
1280 latex.SetTextAlign(13);
1284 fmt::sprintf(
"#scale[1.2]{SiPixelGainCalibration%s Ratio}", (
isForHLT_ ?
"ForHLT" :
"Offline")).c_str());
1287 .41, .91, (
"#splitline{#font[12]{" + f_tagname +
"}}{ / #font[12]{" + l_tagname +
"}}").c_str());
1289 latex.DrawLatexNDC(.41, .91, (firstIOVsince +
" / " + lastIOVsince).c_str());
1294 latex2.SetTextSize(0.024);
1295 latex2.SetTextAlign(13);
1296 latex2.DrawLatexNDC(
1299 fmt::sprintf(
"#scale[1.2]{SiPixelGainCalibration%s Diff}", (
isForHLT_ ?
"ForHLT" :
"Offline")).c_str());
1301 latex2.DrawLatexNDC(
1302 .41, .91, (
"#splitline{#font[12]{" + f_tagname +
"}}{ - #font[12]{" + l_tagname +
"}}").c_str());
1304 latex2.DrawLatexNDC(.41, .91, (firstIOVsince +
" - " + lastIOVsince).c_str());
1307 TPaveStats* st1 = (TPaveStats*)
array[0]->FindObject(
"stats");
1308 st1->SetTextSize(0.027);
1309 st1->SetLineColor(kRed);
1310 st1->SetTextColor(kRed);
1313 TPaveStats* st2 = (TPaveStats*)
array[1]->FindObject(
"stats");
1314 st2->SetTextSize(0.027);
1315 st2->SetLineColor(kBlue);
1316 st2->SetTextColor(kBlue);
1319 auto ltx = TLatex();
1320 ltx.SetTextFont(62);
1322 ltx.SetTextSize(0.040);
1323 ltx.SetTextAlign(11);
1326 gPad->GetLeftMargin(),
1327 1 - gPad->GetTopMargin() + 0.01,
1328 fmt::sprintf(
"SiPixel %s Ratio, IOV %s / %s",
TypeName[myType], firstIOVsince, lastIOVsince).c_str());
1332 gPad->GetLeftMargin(),
1333 1 - gPad->GetTopMargin() + 0.01,
1334 fmt::sprintf(
"SiPixel %s Diff, IOV %s - %s",
TypeName[myType], firstIOVsince, lastIOVsince).c_str());
1339 canvas.SaveAs(
"out.root");
std::string m_imageFileName
std::string to_string(const V &value)
static std::array< std::shared_ptr< TH1F >, 2 > fillDiffAndRatio(const std::shared_ptr< PayloadType > &payload_A, const std::shared_ptr< PayloadType > &payload_B, const gainCalibPI::type &theType)
PlotAnnotations m_plotAnnotations
constexpr char const * TypeName[2]
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
void adjustStats(TPaveStats *stats, float X1, float Y1, float X2, float Y2)
void makeNicePlotStyle(TH1 *hist)
unsigned int ntags() const
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)