From 9cc016bb3c1f6fc986e1ab494da06f57e7048dd3 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 30 Sep 2022 10:58:45 +0200 Subject: [PATCH] MillePedeDQMModule :add string MonitorElement to signal if the update was vetoed --- .../interface/MillePedeFileReader.h | 10 ++++++--- .../plugins/MillePedeDQMModule.cc | 22 +++++++++++++++++++ .../plugins/MillePedeDQMModule.h | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h b/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h index e936f997fd860..61b67fba3b1e9 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h +++ b/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h @@ -17,6 +17,7 @@ struct mpPCLresults { private: + bool m_isHG; bool m_isDBUpdated; bool m_isDBUpdateVetoed; int m_nRecords; @@ -30,14 +31,17 @@ struct mpPCLresults { int nRecords, int exitCode, std::string exitMessage, - std::bitset<4> updateBits) - : m_isDBUpdated(isDBUpdated), + std::bitset<4> updateBits, + bool isHG) + : m_isHG(isHG), + m_isDBUpdated(isDBUpdated), m_isDBUpdateVetoed(isDBUpdateVetoed), m_nRecords(nRecords), m_exitCode(exitCode), m_exitMessage(exitMessage), m_updateBits(updateBits) {} + const bool isHighGranularity() { return m_isHG; } const bool getDBUpdated() { return m_isDBUpdated; } const bool getDBVetoed() { return m_isDBUpdateVetoed; } const bool exceedsThresholds() { return m_updateBits.test(0); } @@ -105,7 +109,7 @@ class MillePedeFileReader { const int binariesAmount() const { return binariesAmount_; } const mpPCLresults getResults() const { - return mpPCLresults(updateDB_, vetoUpdateDB_, Nrec_, exitCode_, exitMessage_, updateBits_); + return mpPCLresults(updateDB_, vetoUpdateDB_, Nrec_, exitCode_, exitMessage_, updateBits_, isHG_); } const std::map>& getResultsHG() const { return fractionExceeded_; } diff --git a/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.cc b/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.cc index d3d6087ee9e1b..ac8ce9c2cbdc2 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.cc +++ b/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.cc @@ -109,6 +109,7 @@ void MillePedeDQMModule ::bookHistograms(DQMStore::IBooker& booker) { binariesAvalaible = booker.bookInt("BinariesFound"); exitCode = booker.bookString("PedeExitCode", ""); + isVetoed = booker.bookString("IsVetoed", ""); booker.cd(); } @@ -131,7 +132,28 @@ void MillePedeDQMModule ::dqmEndJob(DQMStore::IBooker& booker, DQMStore::IGetter binariesAvalaible->Fill(mpReader_->binariesAmount()); auto theResults = mpReader_->getResults(); std::string exitCodeStr = theResults.getExitMessage(); + + std::string vetoStr{}; + if (mpReader_->storeAlignments()) { + vetoStr = "DB Updated!"; /* easy peasy, fait accompli an alignment is there */ + } else { + if (theResults.isHighGranularity()) { /* HG case */ + if (theResults.getDBVetoed() && theResults.getDBUpdated()) { + vetoStr = "DB Update Vetoed"; /* this can happen in the HG PCL case */ + } else { + vetoStr = "N/A"; + } + } else { /* LG case */ + if (theResults.exceedsCutoffs()) { + vetoStr = "DB Update Vetoed"; /* this can happen in the LG PCL case */ + } else { + vetoStr = "N/A"; + } // if the alignment exceeds the cutoffs + } // LG case + } // if the alignment was not stored + exitCode->Fill(exitCodeStr); + isVetoed->Fill(vetoStr); } //============================================================================= diff --git a/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h b/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h index b82ade9a834b4..a9711aafedfe7 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h +++ b/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h @@ -131,6 +131,7 @@ class MillePedeDQMModule : public DQMEDHarvester { MonitorElement* statusResults; MonitorElement* binariesAvalaible; MonitorElement* exitCode; + MonitorElement* isVetoed; bool isHG_; };