From 507cc26ea7754b73e6b042448b12dccd26a6aa08 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 25 Jan 2022 12:39:15 +0100 Subject: [PATCH 1/5] add output LorentzAngle maps to SiPixelLorentzAnglePCLHarvester --- .../SiPixelLorentzAngleCalibrationStruct.h | 4 ++ .../src/SiPixelLorentzAnglePCLHarvester.cc | 47 +++++++++++++++++-- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h b/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h index 485ad22926ddb..30db2d9cadf64 100644 --- a/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h +++ b/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h @@ -12,6 +12,7 @@ struct SiPixelLorentzAngleCalibrationHistograms { int nlay; std::vector nModules_; + std::vector nLadders_; std::vector BPixnewmodulename_; std::vector BPixnewDetIds_; std::vector BPixnewModule_; @@ -43,6 +44,9 @@ struct SiPixelLorentzAngleCalibrationHistograms { dqm::reco::MonitorElement* h_bySectLA_; dqm::reco::MonitorElement* h_bySectDeltaLA_; dqm::reco::MonitorElement* h_bySectChi2_; + + // ouput LA maps + std::vector h2_byLayerLA_; }; #endif diff --git a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc index ed744c8dbddf1..3cbea22b1877f 100644 --- a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc +++ b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc @@ -85,12 +85,13 @@ class SiPixelLorentzAnglePCLHarvester : public DQMEDHarvester { private: void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override; + void endRun(const edm::Run&, const edm::EventSetup&) override; void findMean(MonitorElement* h_drift_depth_adc_slice_, int i, int i_ring); SiPixelLAHarvest::fitResults fitAndStore(std::shared_ptr theLA, int i_idx, int i_lay, int i_mod); // es tokens edm::ESGetToken geomEsToken_; - edm::ESGetToken topoEsToken_; + edm::ESGetToken topoEsTokenBR_, topoEsTokenER_; edm::ESGetToken siPixelLAEsToken_; edm::ESGetToken magneticFieldToken_; @@ -105,12 +106,14 @@ class SiPixelLorentzAnglePCLHarvester : public DQMEDHarvester { SiPixelLorentzAngleCalibrationHistograms hists; const SiPixelLorentzAngle* currentLorentzAngle; const MagneticField* magField; + std::unique_ptr theTrackerTopology; }; //------------------------------------------------------------------------------ SiPixelLorentzAnglePCLHarvester::SiPixelLorentzAnglePCLHarvester(const edm::ParameterSet& iConfig) : geomEsToken_(esConsumes()), - topoEsToken_(esConsumes()), + topoEsTokenBR_(esConsumes()), + topoEsTokenER_(esConsumes()), siPixelLAEsToken_(esConsumes()), magneticFieldToken_(esConsumes()), newmodulelist_(iConfig.getParameter>("newmodulelist")), @@ -128,7 +131,7 @@ SiPixelLorentzAnglePCLHarvester::SiPixelLorentzAnglePCLHarvester(const edm::Para void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { // geometry const TrackerGeometry* geom = &iSetup.getData(geomEsToken_); - const TrackerTopology* tTopo = &iSetup.getData(topoEsToken_); + const TrackerTopology* tTopo = &iSetup.getData(topoEsTokenBR_); magField = &iSetup.getData(magneticFieldToken_); currentLorentzAngle = &iSetup.getData(siPixelLAEsToken_); @@ -136,8 +139,10 @@ void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm:: PixelTopologyMap map = PixelTopologyMap(geom, tTopo); hists.nlay = geom->numberOfLayers(PixelSubdetector::PixelBarrel); hists.nModules_.resize(hists.nlay); + hists.nLadders_.resize(hists.nlay); for (int i = 0; i < hists.nlay; i++) { hists.nModules_[i] = map.getPXBModules(i + 1); + hists.nLadders_[i] = map.getPXBLadders(i + 1); } // list of modules already filled, then return (we already entered here) @@ -208,6 +213,13 @@ void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm:: LogDebug("SiPixelLorentzAnglePCLHarvester") << "Stored a total of " << count << " detIds."; } +//------------------------------------------------------------------------------ +void SiPixelLorentzAnglePCLHarvester::endRun(edm::Run const& run, edm::EventSetup const& isetup) { + if (!theTrackerTopology) { + theTrackerTopology = std::make_unique(isetup.getData(topoEsTokenER_)); + } +} + //------------------------------------------------------------------------------ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) { // go in the right directory @@ -335,6 +347,22 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS hists.h_bySectChi2_->setBinLabel(bin, binName); } + // this will be booked in the Harvesting folder + iBooker.setCurrentFolder(fmt::format("{}Harvesting/LorentzAngleMaps", dqmDir_)); + for (int i = 0; i < hists.nlay; i++) { + std::string repName = "h2_byLayerLA_%i"; + std::string repText = "BPix Layer %i tan#theta_{LA}/B;module number;ladder number;tan#theta_{LA}/B [1/T]"; + + hists.h2_byLayerLA_.emplace_back(iBooker.book2D(fmt::sprintf(repName, i + 1), + fmt::sprintf(repText, i + 1), + hists.nModules_[i], + 0.5, + hists.nModules_[i] + 0.5, + hists.nLadders_[i], + 0.5, + hists.nLadders_[i] + 0.5)); + } + // clang-format off edm::LogPrint("LorentzAngle") << "module" << "\t" << "layer" << "\t" << "offset" << "\t" << "e0" << "\t" @@ -448,7 +476,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS float fPixLorentzAnglePerTesla_ = currentLorentzAngle->getLorentzAngle(id); if (!LorentzAngle->putLorentzAngle(id, fPixLorentzAnglePerTesla_)) { edm::LogError("SiPixelLorentzAnglePCLHarvester") - << "[SiPixelLorentzAnglePCLHarvester::dqmEndRun] filling rest of payload: detid already exists"; + << "[SiPixelLorentzAnglePCLHarvester::dqmEndJob] filling rest of payload: detid already exists"; } } @@ -458,6 +486,17 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS h_diffLA->Fill(deltaMuHoverMuH); } + // fill the 2D output Lorentz Angle maps + for (const auto& [id, value] : LorentzAngle->getLorentzAngles()) { + DetId ID = DetId(id); + if (ID.subdetId() == PixelSubdetector::PixelBarrel) { + const auto& layer = theTrackerTopology->pxbLayer(id); + const auto& ladder = theTrackerTopology->pxbLadder(id); + const auto& module = theTrackerTopology->pxbModule(id); + hists.h2_byLayerLA_[layer - 1]->setBinContent(module, ladder, value); + } + } + // fill the DB object record edm::Service mydbservice; if (mydbservice.isAvailable()) { From bada393abb266dd4f8ed83e0cedfb87d5bf2f6ac Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 26 Jan 2022 15:07:09 +0100 Subject: [PATCH 2/5] miscelleanous fixes to SiPixelLorentzAnglePCLHarvester --- .../src/SiPixelLorentzAnglePCLHarvester.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc index 3cbea22b1877f..c0e95f5988a78 100644 --- a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc +++ b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc @@ -314,7 +314,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS // book histogram of differences MonitorElement* h_diffLA = iBooker.book1D( - "h_diffLA", "difference in #mu_{H}; #Delta #mu_{H}/#mu_{H} (old-new)/old [%];n. modules", 100, -3., 3.); + "h_diffLA", "difference in #mu_{H}; #Delta #mu_{H}/#mu_{H} (old-new)/old [%];n. modules", 100, -150, 150); // retrieve the number of bins from the other monitoring histogram const auto& maxSect = hists.h_bySectOccupancy_->getNbinsX(); @@ -483,7 +483,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS for (const auto& id : newLADets) { float deltaMuHoverMuH = (currentLorentzAngle->getLorentzAngle(id) - LorentzAngle->getLorentzAngle(id)) / currentLorentzAngle->getLorentzAngle(id); - h_diffLA->Fill(deltaMuHoverMuH); + h_diffLA->Fill(deltaMuHoverMuH * 100.f); } // fill the 2D output Lorentz Angle maps From dbb5a2d42f86bf5b75374592359128b0dafacd88 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 26 Jan 2022 15:08:01 +0100 Subject: [PATCH 3/5] add SiPixelLorentzAngleFullMapCompare to Pixel Payload Inspector --- .../interface/SiPixelPayloadInspectorHelper.h | 7 +- .../SiPixelLorentzAngle_PayloadInspector.cc | 124 ++++++++++++++++++ .../interface/Phase1PixelSummaryMap.h | 2 +- .../src/Phase1PixelSummaryMap.cc | 6 +- 4 files changed, 134 insertions(+), 5 deletions(-) diff --git a/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h b/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h index 69b6c6535d620..86808da4d4131 100644 --- a/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h +++ b/CondCore/SiPixelPlugins/interface/SiPixelPayloadInspectorHelper.h @@ -42,6 +42,7 @@ namespace SiPixelPI { static const unsigned int phase0size = 1440; static const unsigned int phase1size = 1856; static const unsigned int phase2size = 3892; + static const unsigned int mismatched = 9999; //============================================================================ // struct to store info useful to construct topology based on the detid list @@ -789,7 +790,11 @@ namespace SiPixelPI { t2.SetTextSize(0.1); t2.SetTextAngle(45); t2.SetTextColor(kRed); - t2.DrawLatexNDC(0.6, 0.50, Form("%s NOT SUPPORTED!", phase.c_str())); + if (size != SiPixelPI::mismatched) { + t2.DrawLatexNDC(0.6, 0.50, Form("%s NOT SUPPORTED!", phase.c_str())); + } else { + t2.DrawLatexNDC(0.6, 0.50, "MISMATCHED PAYLOAD SIZE!"); + } } /*--------------------------------------------------------------------*/ diff --git a/CondCore/SiPixelPlugins/plugins/SiPixelLorentzAngle_PayloadInspector.cc b/CondCore/SiPixelPlugins/plugins/SiPixelLorentzAngle_PayloadInspector.cc index 4adb701009f1c..48d0cde750b25 100644 --- a/CondCore/SiPixelPlugins/plugins/SiPixelLorentzAngle_PayloadInspector.cc +++ b/CondCore/SiPixelPlugins/plugins/SiPixelLorentzAngle_PayloadInspector.cc @@ -946,6 +946,128 @@ namespace { std::string label_; }; + /************************************************ + Full Pixel Tracker Map for Comparison Base Class + *************************************************/ + template + class SiPixelLorentzAngleFullMapCompareBase : public PlotImage { + public: + SiPixelLorentzAngleFullMapCompareBase() : PlotImage("SiPixelLorentzAngle Map") { + label_ = "SiPixelLorentzAngleFullPixelMap"; + payloadString = "Lorentz Angle"; + } + + bool fill() override { + gStyle->SetPalette(kBlueRedYellow); + + // trick to deal with the multi-ioved tag and two tag case at the same time + auto theIOVs = PlotBase::getTag<0>().iovs; + auto f_tagname = PlotBase::getTag<0>().name; + std::string l_tagname = ""; + auto firstiov = theIOVs.front(); + std::tuple lastiov; + + // we don't support (yet) comparison with more than 2 tags + assert(this->m_plotAnnotations.ntags < 3); + + if (this->m_plotAnnotations.ntags == 2) { + auto tag2iovs = PlotBase::getTag<1>().iovs; + l_tagname = PlotBase::getTag<1>().name; + lastiov = tag2iovs.front(); + } else { + lastiov = theIOVs.back(); + } + + std::shared_ptr last_payload = this->fetchPayload(std::get<1>(lastiov)); + std::shared_ptr first_payload = this->fetchPayload(std::get<1>(firstiov)); + + if (first_payload.get() && last_payload.get()) { + // creat the base map + Phase1PixelSummaryMap fullMap("", + fmt::sprintf("%s Diff", payloadString), + fmt::sprintf("%s difference #Delta#mu_{H}/#mu_{H} [%%]", payloadString)); + fullMap.createTrackerBaseMap(); + + std::map l_LAMap_ = last_payload->getLorentzAngles(); + std::map f_LAMap_ = first_payload->getLorentzAngles(); + + std::string lastIOVsince = std::to_string(std::get<0>(lastiov)); + std::string firstIOVsince = std::to_string(std::get<0>(firstiov)); + + if (l_LAMap_.size() != f_LAMap_.size()) { + edm::LogError(label_) << "There are " << l_LAMap_.size() << "dets in payload" << std::get<1>(lastiov) + << "and " << f_LAMap_.size() << " dets in payload" << std::get<1>(firstiov) + << "display is not possible!"; + + TCanvas canvas("Canv", "Canv", 1200, 1000); + SiPixelPI::displayNotSupported(canvas, SiPixelPI::mismatched); + std::string fileName(this->m_imageFileName); + canvas.SaveAs(fileName.c_str()); + return false; + } + + if (l_LAMap_.size() == SiPixelPI::phase0size || l_LAMap_.size() > SiPixelPI::phase1size) { + edm::LogError(label_) << "There are " << l_LAMap_.size() + << " DetIds in this payload. SiPixelLorentzAngleFullPixelMap maps are not supported " + "for non-Phase1 Pixel geometries !"; + TCanvas canvas("Canv", "Canv", 1200, 1000); + SiPixelPI::displayNotSupported(canvas, l_LAMap_.size()); + std::string fileName(this->m_imageFileName); + canvas.SaveAs(fileName.c_str()); + return false; + } else { + if (l_LAMap_.size() < SiPixelPI::phase1size) { + edm::LogWarning(label_) << "\n ********* WARNING! ********* \n There are " << l_LAMap_.size() + << " DetIds in this payload !" + << "\n **************************** \n"; + } + } + + // fill the map + for (const auto &[id, value] : l_LAMap_) { + assert(value != 0.); // do not divide by 0 + const auto &diff = (value - f_LAMap_[id]) * 100.f / value; + fullMap.fillTrackerMap(id, diff); + } + + // print the map + TCanvas canvas("Canv", "Canv", 3000, 2000); + fullMap.printTrackerMap(canvas, 0.03); // is the top margin of the canvas + + // take care of the legend + auto ltx = TLatex(); + ltx.SetTextFont(62); + ltx.SetTextSize(0.025); + ltx.SetTextAlign(11); + std::string ltxText; + if (this->m_plotAnnotations.ntags == 2) { + ltxText = fmt::sprintf("#color[2]{%s, %s} vs #color[4]{%s, %s}", + f_tagname, + std::to_string(std::get<0>(firstiov)), + l_tagname, + std::to_string(std::get<0>(lastiov))); + } else { + ltxText = fmt::sprintf("%s IOV: #color[2]{%s} vs IOV: #color[4]{%s}", + f_tagname, + std::to_string(std::get<0>(firstiov)), + std::to_string(std::get<0>(lastiov))); + } + ltx.DrawLatexNDC(gPad->GetLeftMargin(), 1 - gPad->GetTopMargin() + 0.01, ltxText.c_str()); + + std::string fileName(this->m_imageFileName); + canvas.SaveAs(fileName.c_str()); + } // if has got the payloads + return true; + } + + protected: + std::string payloadString; + std::string label_; + }; + + using SiPixelLorentzAngleFullMapCompareSingleTag = SiPixelLorentzAngleFullMapCompareBase; + using SiPixelLorentzAngleFullMapCompareTwoTags = SiPixelLorentzAngleFullMapCompareBase; + } // namespace PAYLOAD_INSPECTOR_MODULE(SiPixelLorentzAngle) { @@ -965,4 +1087,6 @@ PAYLOAD_INSPECTOR_MODULE(SiPixelLorentzAngle) { PAYLOAD_INSPECTOR_CLASS(SiPixelFPixLorentzAngleMap); PAYLOAD_INSPECTOR_CLASS(SiPixelFullLorentzAngleMapByROC); PAYLOAD_INSPECTOR_CLASS(SiPixelLorentzAngleFullPixelMap); + PAYLOAD_INSPECTOR_CLASS(SiPixelLorentzAngleFullMapCompareSingleTag); + PAYLOAD_INSPECTOR_CLASS(SiPixelLorentzAngleFullMapCompareTwoTags); } diff --git a/DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h b/DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h index 91a5029f48fc6..e875dfc2cdf49 100644 --- a/DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h +++ b/DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.h @@ -76,7 +76,7 @@ class Phase1PixelSummaryMap { void resetOption(const char* option); void createTrackerBaseMap(); - void printTrackerMap(TCanvas& canvas); + void printTrackerMap(TCanvas& canvas, const float topMargin = 0.02); bool fillTrackerMap(unsigned int id, double value); protected: diff --git a/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc b/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc index d1b2a0846dedd..18b408bbb94fe 100644 --- a/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc +++ b/DQM/TrackerRemapper/src/Phase1PixelSummaryMap.cc @@ -81,10 +81,10 @@ void Phase1PixelSummaryMap::createTrackerBaseMap() { } //============================================================================ -void Phase1PixelSummaryMap::printTrackerMap(TCanvas& canvas) { +void Phase1PixelSummaryMap::printTrackerMap(TCanvas& canvas, const float topMargin) { //canvas = TCanvas("c1","c1",plotWidth,plotHeight); canvas.cd(); - canvas.SetTopMargin(0.02); + canvas.SetTopMargin(topMargin); canvas.SetBottomMargin(0.02); canvas.SetLeftMargin(0.02); canvas.SetRightMargin(0.14); @@ -122,7 +122,7 @@ void Phase1PixelSummaryMap::printTrackerMap(TCanvas& canvas) { txt.SetTextAngle(0); //# draw new-style title - txt.SetTextSize(0.05); + txt.SetTextSize((topMargin == 0.02) ? 0.05 : 0.03); txt.DrawLatex(0.5, 0.95, (fmt::sprintf("Pixel Tracker Map: %s", m_title)).c_str()); txt.SetTextSize(0.03); From 2e02258d16a7c77bf141147278f984f8ec5625eb Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 27 Jan 2022 14:06:14 +0100 Subject: [PATCH 4/5] layer-dependent cluster y-size cut in SiPixelLorentzAnglePCLWorker. --- .../src/SiPixelLorentzAnglePCLWorker.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLWorker.cc b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLWorker.cc index 40c29719b901a..7a8f116ee6991 100644 --- a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLWorker.cc +++ b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLWorker.cc @@ -174,8 +174,7 @@ class SiPixelLorentzAnglePCLWorker : public DQMEDAnalyzer { // parameters from config file double ptmin_; double normChi2Max_; - int clustSizeYMin_; - int clustSizeYMinL4_; + std::vector clustSizeYMin_; int clustSizeXMax_; double residualMax_; double clustChargeMaxPerLength_; @@ -207,8 +206,7 @@ SiPixelLorentzAnglePCLWorker::SiPixelLorentzAnglePCLWorker(const edm::ParameterS newmodulelist_(iConfig.getParameter>("newmodulelist")), ptmin_(iConfig.getParameter("ptMin")), normChi2Max_(iConfig.getParameter("normChi2Max")), - clustSizeYMin_(iConfig.getParameter("clustSizeYMin")), - clustSizeYMinL4_(iConfig.getParameter("clustSizeYMinL4")), + clustSizeYMin_(iConfig.getParameter>("clustSizeYMin")), clustSizeXMax_(iConfig.getParameter("clustSizeXMax")), residualMax_(iConfig.getParameter("residualMax")), clustChargeMaxPerLength_(iConfig.getParameter("clustChargeMaxPerLength")), @@ -443,7 +441,7 @@ void SiPixelLorentzAnglePCLWorker::analyze(edm::Event const& iEvent, edm::EventS // get qScale_ = templ.qscale() and templ.r_qMeas_qTrue(); float cotalpha = trackdirection.x() / trackdirection.z(); float cotbeta = trackdirection.y() / trackdirection.z(); - float cotbeta_min = clustSizeYMin_ * ypitch_ / width_; + float cotbeta_min = clustSizeYMin_[layer_ - 1] * ypitch_ / width_; if (fabs(cotbeta) <= cotbeta_min) continue; double drdz = sqrt(1. + cotalpha * cotalpha + cotbeta * cotbeta); @@ -504,7 +502,7 @@ void SiPixelLorentzAnglePCLWorker::analyze(edm::Event const& iEvent, edm::EventS double ylim1 = trackhitCorrY_ - width_ * cotbeta / 2.; double ylim2 = trackhitCorrY_ + width_ * cotbeta / 2.; - int clustSizeY_cut = layer_ < 4 ? clustSizeYMin_ : clustSizeYMinL4_; + int clustSizeY_cut = clustSizeYMin_[layer_ - 1]; if (!large_pix && (chi2_ / ndof_) < normChi2Max_ && cluster->sizeY() >= clustSizeY_cut && residualsq < residualMax_ * residualMax_ && cluster->charge() < clusterCharge_cut && @@ -867,8 +865,8 @@ void SiPixelLorentzAnglePCLWorker::fillDescriptions(edm::ConfigurationDescriptio desc.add("src", edm::InputTag("TrackRefitter"))->setComment("input track collections"); desc.add("ptMin", 3.)->setComment("minimum pt on tracks"); desc.add("normChi2Max", 2.)->setComment("maximum reduced chi squared"); - desc.add("clustSizeYMin", 4)->setComment("minimum cluster size on Y axis for Layer 1-3"); - desc.add("clustSizeYMinL4", 3)->setComment("minimum cluster size on Y axis for Layer 4"); + desc.add>("clustSizeYMin", {4, 4, 3, 2}) + ->setComment("minimum cluster size on Y axis for all Barrel Layers"); desc.add("clustSizeXMax", 5)->setComment("maximum cluster size on X axis"); desc.add("residualMax", 0.005)->setComment("maximum residual"); desc.add("clustChargeMaxPerLength", 50000) From 246ef92d560d819a86fa48569172c41d1f673cdd Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 28 Jan 2022 09:26:01 +0100 Subject: [PATCH 5/5] add maps for relative difference between old and new Lorentz Angle --- .../SiPixelLorentzAngleCalibrationStruct.h | 2 ++ .../src/SiPixelLorentzAnglePCLHarvester.cc | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h b/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h index 30db2d9cadf64..6590a9d32643a 100644 --- a/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h +++ b/CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleCalibrationStruct.h @@ -30,6 +30,7 @@ struct SiPixelLorentzAngleCalibrationHistograms { MonitorMap h_drift_depth_; MonitorMap h_mean_; + // track monitoring dqm::reco::MonitorElement* h_tracks_; dqm::reco::MonitorElement* h_trackEta_; dqm::reco::MonitorElement* h_trackPhi_; @@ -47,6 +48,7 @@ struct SiPixelLorentzAngleCalibrationHistograms { // ouput LA maps std::vector h2_byLayerLA_; + std::vector h2_byLayerDiff_; }; #endif diff --git a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc index c0e95f5988a78..48e3a81df7b95 100644 --- a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc +++ b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc @@ -361,6 +361,17 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS hists.nLadders_[i], 0.5, hists.nLadders_[i] + 0.5)); + + repName = "h2_byLayerDiff_%i"; + repText = "BPix Layer %i #Delta#mu_{H}/#mu_{H};module number;ladder number;#Delta#mu_{H}/#mu_{H} [%%]"; + hists.h2_byLayerDiff_.emplace_back(iBooker.book2D(fmt::sprintf(repName, i + 1), + fmt::sprintf(repText, i + 1), + hists.nModules_[i], + 0.5, + hists.nModules_[i] + 0.5, + hists.nLadders_[i], + 0.5, + hists.nLadders_[i] + 0.5)); } // clang-format off @@ -494,6 +505,10 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS const auto& ladder = theTrackerTopology->pxbLadder(id); const auto& module = theTrackerTopology->pxbModule(id); hists.h2_byLayerLA_[layer - 1]->setBinContent(module, ladder, value); + + float deltaMuHoverMuH = + (currentLorentzAngle->getLorentzAngle(id) - value) / currentLorentzAngle->getLorentzAngle(id); + hists.h2_byLayerDiff_[layer - 1]->setBinContent(module, ladder, deltaMuHoverMuH * 100.f); } }