223 gStyle->SetPalette(kTemperatureMap);
226 gStyle->SetHistMinimumZero(kTRUE);
229 auto theIOVs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
230 auto f_tagname = cond::payloadInspector::PlotBase::getTag<0>().
name;
232 auto firstiov = theIOVs.front();
233 std::tuple<cond::Time_t, cond::Hash> lastiov;
239 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
240 l_tagname = cond::payloadInspector::PlotBase::getTag<1>().
name;
241 lastiov = tag2iovs.front();
243 lastiov = theIOVs.back();
246 std::shared_ptr<PayloadType> l_payload = this->
fetchPayload(std::get<1>(lastiov));
247 std::shared_ptr<PayloadType> f_payload = this->
fetchPayload(std::get<1>(firstiov));
252 const auto& alignables = l_payload->getAlignableList();
253 const auto& alignables2 = f_payload->getAlignableList();
255 std::vector<std::string> v_intersection;
257 if (!
isEqual(alignables, alignables2)) {
259 <<
"Cannot compare directly the two AlignPCLThresholds objects, as the list of alignables differs";
264 std::back_inserter(v_intersection));
266 std::vector<std::string> not_in_first_keys, not_in_last_keys;
273 std::inserter(not_in_last_keys, not_in_last_keys.begin()));
275 std::stringstream
ss;
276 ss <<
"the following keys are not in the last IoV: ";
277 for (
const auto&
key : not_in_last_keys) {
288 std::inserter(not_in_first_keys, not_in_first_keys.begin()));
290 ss <<
"the following keys are not in the first IoV: ";
291 for (
const auto&
key : not_in_first_keys) {
298 v_intersection = alignables;
301 TCanvas
canvas(
"Alignment PCL thresholds summary",
"Alignment PCL thresholds summary", 1500, 800);
304 canvas.SetTopMargin(0.07);
306 canvas.SetLeftMargin(0.11);
307 canvas.SetRightMargin(0.12);
316 "Thresholds",
"", v_intersection.size(), 0, v_intersection.size(), N_Y_BINS, 0, N_Y_BINS);
320 auto ThresholdsColor = std::make_unique<TH2F>(
321 "ThresholdsC",
"", v_intersection.size(), 0, v_intersection.size(), N_Y_BINS, 0, N_Y_BINS);
322 ThresholdsColor->SetStats(
false);
323 ThresholdsColor->GetXaxis()->SetLabelSize(0.028);
325 std::function<float(types, std::string, AlignPCLThresholds::coordType)> cutFunctor =
330 return l_payload->getCut(alignable, coord) - f_payload->getCut(alignable, coord);
332 return l_payload->getSigCut(alignable, coord) - f_payload->getSigCut(alignable, coord);
334 return l_payload->getMaxMoveCut(alignable, coord) - f_payload->getMaxMoveCut(alignable, coord);
336 return l_payload->getMaxErrorCut(alignable, coord) - f_payload->getMaxErrorCut(alignable, coord);
338 if constexpr (std::is_same_v<PayloadType, AlignPCLThresholdsHG>) {
341 if (f_floatMap.find(alignable) != f_floatMap.end() &&
342 l_floatMap.find(alignable) != l_floatMap.end()) {
343 return l_payload->getFractionCut(alignable, coord) - f_payload->getFractionCut(alignable, coord);
358 unsigned int xBin = 0;
359 for (
const auto& alignable : v_intersection) {
363 ThresholdsColor->GetXaxis()->SetBinLabel(
xBin, (xLabel).c_str());
364 unsigned int yBin = N_Y_BINS;
367 for (
int bar =
DELTA;
bar != local_end_of_types;
bar++) {
372 ThresholdsColor->GetYaxis()->SetBinLabel(
yBin, theLabel.c_str());
375 const auto&
value = cutFunctor(
type, alignable, coord);
384 ThresholdsColor->Draw(
"COLZ0");
392 ltx.SetTextSize(0.047);
393 ltx.SetTextAlign(11);
396 ltxText = fmt::sprintf(
"#color[2]{%s, %s} vs #color[4]{%s, %s}",
402 ltxText = fmt::sprintf(
"%s IOV: #color[2]{%s} vs IOV: #color[4]{%s}",
407 ltx.DrawLatexNDC(gPad->GetLeftMargin(), 1 - gPad->GetTopMargin() + 0.01, ltxText.c_str());
std::string m_imageFileName
std::unordered_map< std::string, std::vector< float > > param_map
const std::string getStringFromCoordEnum(const AlignPCLThresholds::coordType &coord)
bool isEqual(std::vector< T > const &v1, std::vector< T > const &v2)
ret
prodAgent to be discontinued
const std::string getStringFromTypeEnum(const types &type)
static std::string to_string(const XMLCh *ch)
std::string replaceAll(const std::string &str, const std::string &from, const std::string &to)
PlotAnnotations m_plotAnnotations
key
prepare the HTCondor submission files and eventually submit them
Log< level::Warning, false > LogWarning
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)