From 1f224354321b2fcd88164fdca35f6463a39f556e Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 18 Nov 2024 15:39:59 +0100 Subject: [PATCH] Add Phase1 pixel tracker maps to TrackerAlignmentErrorExtended_PayloadInspector --- .../AlignmentPlugins/plugins/BuildFile.xml | 1 + ...AlignmentErrorExtended_PayloadInspector.cc | 89 +++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/CondCore/AlignmentPlugins/plugins/BuildFile.xml b/CondCore/AlignmentPlugins/plugins/BuildFile.xml index d1b7bb9605191..c7c9d36fe91ac 100644 --- a/CondCore/AlignmentPlugins/plugins/BuildFile.xml +++ b/CondCore/AlignmentPlugins/plugins/BuildFile.xml @@ -5,6 +5,7 @@ + diff --git a/CondCore/AlignmentPlugins/plugins/TrackerAlignmentErrorExtended_PayloadInspector.cc b/CondCore/AlignmentPlugins/plugins/TrackerAlignmentErrorExtended_PayloadInspector.cc index 9cd9c8b9d7981..f3d37a3c4772d 100644 --- a/CondCore/AlignmentPlugins/plugins/TrackerAlignmentErrorExtended_PayloadInspector.cc +++ b/CondCore/AlignmentPlugins/plugins/TrackerAlignmentErrorExtended_PayloadInspector.cc @@ -25,6 +25,8 @@ #include "CondCore/AlignmentPlugins/interface/AlignmentPayloadInspectorHelper.h" #include "CalibTracker/StandaloneTrackerTopology/interface/StandaloneTrackerTopology.h" +#include "DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h" + #include #include #include @@ -319,6 +321,87 @@ namespace { typedef TrackerAlignmentErrorExtendedTrackerMap TrackerAlignmentErrorExtendedXZTrackerMap; typedef TrackerAlignmentErrorExtendedTrackerMap TrackerAlignmentErrorExtendedYZTrackerMap; + // /************************************************ + // TrackerMap of sqrt(d_ii) of 1 IOV + // *************************************************/ + template + class PixelAlignmentErrorExtendedTrackerMap : public PlotImage { + public: + PixelAlignmentErrorExtendedTrackerMap() + : PlotImage("Pixel Map of sqrt(d_{" + getStringFromIndex(i) + + "}) of APE matrix") { + label_ = " PixelAlignmentErrorExtendedTrackerMap"; + payloadString = "Alignment Parameter Error"; + } + + bool fill() override { + auto tag = PlotBase::getTag<0>(); + auto iov = tag.iovs.front(); + std::string IOVsince = std::to_string(std::get<0>(iov)); + + std::shared_ptr payload = fetchPayload(std::get<1>(iov)); + + Phase1PixelSummaryMap fullMap("", fmt::sprintf("%s", payloadString), fmt::sprintf("%s [#mum]", payloadString)); + fullMap.createTrackerBaseMap(); + + std::vector alignErrors = payload->m_alignError; + + auto indices = AlignmentPI::getIndices(i); + + TCanvas canvas("Canv", "Canv", 3000, 2000); + if (alignErrors.size() == AlignmentPI::phase0size) { + AlignmentPI::displayNotSupported(canvas, 0); + return false; + } + + for (const auto& it : alignErrors) { + int subid = DetId(it.rawId()).subdetId(); + + CLHEP::HepSymMatrix errMatrix = it.matrix(); + + if (DetId(it.rawId()).det() != DetId::Tracker) { + edm::LogWarning("TrackerAlignmentErrorExtended_PayloadInspector") + << "Encountered invalid Tracker DetId:" << it.rawId() << " - terminating "; + return false; + } + // fill the tracker map only if it's pixel + if ((subid == PixelSubdetector::PixelBarrel) || (subid == PixelSubdetector::PixelEndcap)) { + fullMap.fillTrackerMap(it.rawId(), sqrt(errMatrix[indices.first][indices.second]) * AlignmentPI::cmToUm); + } + } + + fullMap.printTrackerMap(canvas); + + auto ltx = TLatex(); + ltx.SetTextFont(62); + ltx.SetTextSize(0.025); + ltx.SetTextAlign(11); + + ltx.DrawLatexNDC(gPad->GetLeftMargin() + 0.01, + gPad->GetBottomMargin() + 0.01, + ("#color[4]{" + std::string{tag.name} + "}, IOV: #color[2]{" + IOVsince + "}").c_str()); + + std::string fileName(this->m_imageFileName); + canvas.SaveAs(fileName.c_str()); + + return true; + } + + protected: + std::string payloadString; + std::string label_; + }; + + // diagonal elements + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedXXTrackerMap; + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedYYTrackerMap; + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedZZTrackerMap; + + // off-diagonal elements + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedXYTrackerMap; + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedXZTrackerMap; + typedef PixelAlignmentErrorExtendedTrackerMap PixelAlignmentErrorExtendedYZTrackerMap; + // /************************************************ // Partition details of 1 IOV // *************************************************/ @@ -795,6 +878,12 @@ PAYLOAD_INSPECTOR_MODULE(TrackerAlignmentErrorExtended) { PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedXYTrackerMap); PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedXZTrackerMap); PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedYZTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedXXTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedYYTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedZZTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedXYTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedXZTrackerMap); + PAYLOAD_INSPECTOR_CLASS(PixelAlignmentErrorExtendedYZTrackerMap); PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedBPixDetail); PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedFPixDetail); PAYLOAD_INSPECTOR_CLASS(TrackerAlignmentErrorExtendedTIBDetail);