diff --git a/Modules/MUON/MCH/include/MCH/ClusterChargePlotter.h b/Modules/MUON/MCH/include/MCH/ClusterChargePlotter.h index 5a283a19d1..7085197aef 100644 --- a/Modules/MUON/MCH/include/MCH/ClusterChargePlotter.h +++ b/Modules/MUON/MCH/include/MCH/ClusterChargePlotter.h @@ -36,7 +36,7 @@ namespace muonchambers class ClusterChargePlotter : public HistPlotter { public: - ClusterChargePlotter(std::string path, TH2F* hRef, bool fullPlots = false); + ClusterChargePlotter(std::string path, bool fullPlots = false); void update(TH2F* hCharge); @@ -62,9 +62,6 @@ class ClusterChargePlotter : public HistPlotter std::unique_ptr mChargeReductor; std::unique_ptr mHistogramChargePerDE; - std::unique_ptr mHistogramChargePerDERef; - std::unique_ptr mHistogramChargeRefRatio; - std::unique_ptr mCanvasChargePerDE; std::array, getNumDE()> mHistogramCharge; }; diff --git a/Modules/MUON/MCH/include/MCH/ClusterChargeTrendsPlotter.h b/Modules/MUON/MCH/include/MCH/ClusterChargeTrendsPlotter.h index 5d2912cc42..b9b5f96be3 100644 --- a/Modules/MUON/MCH/include/MCH/ClusterChargeTrendsPlotter.h +++ b/Modules/MUON/MCH/include/MCH/ClusterChargeTrendsPlotter.h @@ -35,7 +35,7 @@ namespace muonchambers class ClusterChargeTrendsPlotter : public HistPlotter { public: - ClusterChargeTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots = false); + ClusterChargeTrendsPlotter(std::string path, bool fullPlots = false); void update(long time, TH2F* hEfficiency); diff --git a/Modules/MUON/MCH/include/MCH/ClusterSizePlotter.h b/Modules/MUON/MCH/include/MCH/ClusterSizePlotter.h index 6b4ae5e62b..e39e761aeb 100644 --- a/Modules/MUON/MCH/include/MCH/ClusterSizePlotter.h +++ b/Modules/MUON/MCH/include/MCH/ClusterSizePlotter.h @@ -37,7 +37,7 @@ namespace muonchambers class ClusterSizePlotter : public HistPlotter { public: - ClusterSizePlotter(std::string path, TH2F* hRef, bool fullPlots = false); + ClusterSizePlotter(std::string path, bool fullPlots = false); void update(TH2F* hCharge); @@ -52,9 +52,6 @@ class ClusterSizePlotter : public HistPlotter std::unique_ptr mClusterSizeReductor; std::array, 3> mHistogramClusterSizePerDE; - std::array, 3> mHistogramClusterSizePerDERef; - std::array, 3> mHistogramClusterSizePerDERefRatio; - std::array, 3> mCanvasClusterSizePerDE; std::array, getNumDE() * 3> mHistogramClusterSize; std::array, getNumDE()> mLegendClusterSize; std::array, getNumDE()> mCanvasClusterSize; diff --git a/Modules/MUON/MCH/include/MCH/ClusterSizeTrendsPlotter.h b/Modules/MUON/MCH/include/MCH/ClusterSizeTrendsPlotter.h index 3476d76ecd..a12591afc7 100644 --- a/Modules/MUON/MCH/include/MCH/ClusterSizeTrendsPlotter.h +++ b/Modules/MUON/MCH/include/MCH/ClusterSizeTrendsPlotter.h @@ -36,7 +36,7 @@ namespace muonchambers class ClusterSizeTrendsPlotter : public HistPlotter { public: - ClusterSizeTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots = false); + ClusterSizeTrendsPlotter(std::string path, bool fullPlots = false); void update(long time, TH2F* hEfficiency); diff --git a/Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h b/Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h index 569bee6918..6ac1ca7754 100644 --- a/Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h +++ b/Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h @@ -71,7 +71,6 @@ class DigitsPostProcessing : public PostProcessingInterface // CCDB object accessors std::map mCcdbObjects; - std::map mCcdbObjectsRef; // Hit rate histograms =============================================== diff --git a/Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h b/Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h index ec827d3e4e..ab276d93e8 100644 --- a/Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h +++ b/Modules/MUON/MCH/include/MCH/EfficiencyPlotter.h @@ -35,7 +35,7 @@ namespace muonchambers class EfficiencyPlotter : public HistPlotter { public: - EfficiencyPlotter(std::string path, TH2F* hRef, bool fullPlots = false); + EfficiencyPlotter(std::string path, bool fullPlots = false); void update(TH2F* hEfficiency); @@ -69,9 +69,6 @@ class EfficiencyPlotter : public HistPlotter std::unique_ptr mElecMapReductor; std::array, 2> mHistogramMeanEfficiencyPerDE; - std::array, 2> mHistogramMeanEfficiencyPerDERef; - std::array, 2> mHistogramMeanEfficiencyRefRatio; - std::array, 2> mCanvasMeanEfficiencyPerDE; std::array>, 2> mHistogramEfficiencyDE; // 2D hit rate map for each DE std::array, 2> mHistogramEfficiencyGlobal; // Efficiency histogram (global XY view) diff --git a/Modules/MUON/MCH/include/MCH/EfficiencyTrendsPlotter.h b/Modules/MUON/MCH/include/MCH/EfficiencyTrendsPlotter.h index c2b1d7b696..997021aeff 100644 --- a/Modules/MUON/MCH/include/MCH/EfficiencyTrendsPlotter.h +++ b/Modules/MUON/MCH/include/MCH/EfficiencyTrendsPlotter.h @@ -35,7 +35,7 @@ namespace muonchambers class EfficiencyTrendsPlotter : public HistPlotter { public: - EfficiencyTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots = false); + EfficiencyTrendsPlotter(std::string path, bool fullPlots = false); void update(long time, TH2F* hEfficiency); diff --git a/Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h b/Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h index 4552890a62..388cc3482e 100644 --- a/Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h +++ b/Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h @@ -73,15 +73,12 @@ class PreclustersPostProcessing : public PostProcessingInterface static std::string clusterChargeSourceName() { return "clcharge"; } static std::string clusterSizeSourceName() { return "clsize"; } - // PreclustersConfig mConfig; - int64_t mRefTimeStamp{ 0 }; bool mFullHistos{ false }; PostProcessingConfigMCH mConfig; // CCDB object accessors std::map mCcdbObjects; - std::map mCcdbObjectsRef; // Hit rate histograms =============================================== diff --git a/Modules/MUON/MCH/include/MCH/RatesPlotter.h b/Modules/MUON/MCH/include/MCH/RatesPlotter.h index f6f6b9dff5..2d4649a1cb 100644 --- a/Modules/MUON/MCH/include/MCH/RatesPlotter.h +++ b/Modules/MUON/MCH/include/MCH/RatesPlotter.h @@ -35,7 +35,7 @@ namespace muonchambers class RatesPlotter : public HistPlotter { public: - RatesPlotter(std::string path, TH2F* hRef, float rateMin, float rateMax, bool perStationPlots = false, bool fullPlots = false); + RatesPlotter(std::string path, float rateMin, float rateMax, bool perStationPlots = false, bool fullPlots = false); void update(TH2F* hRates); @@ -69,14 +69,8 @@ class RatesPlotter : public HistPlotter std::unique_ptr mHistogramRatePerStation; std::unique_ptr mHistogramMeanRatePerDE; - std::unique_ptr mHistogramMeanRatePerDERef; - std::unique_ptr mHistogramMeanRateRefRatio; - std::unique_ptr mCanvasMeanRatePerDE; std::unique_ptr mHistogramGoodChannelsFractionPerDE; - std::unique_ptr mHistogramGoodChannelsFractionPerDERef; - std::unique_ptr mHistogramGoodChannelsFractionRefRatio; - std::unique_ptr mCanvasGoodChannelsFractionPerDE; std::map> mHistogramRateDE[2]; // 2D hit rate map for each DE std::shared_ptr mHistogramRateGlobal[2]; // Rate histogram (global XY view) diff --git a/Modules/MUON/MCH/include/MCH/RatesTrendsPlotter.h b/Modules/MUON/MCH/include/MCH/RatesTrendsPlotter.h index 0cc4ec310d..47395e0d5e 100644 --- a/Modules/MUON/MCH/include/MCH/RatesTrendsPlotter.h +++ b/Modules/MUON/MCH/include/MCH/RatesTrendsPlotter.h @@ -36,7 +36,7 @@ namespace muonchambers class RatesTrendsPlotter : public HistPlotter { public: - RatesTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots = false); + RatesTrendsPlotter(std::string path, bool fullPlots = false); void update(long time, TH2F* hEfficiency); @@ -51,11 +51,9 @@ class RatesTrendsPlotter : public HistPlotter // Data reductor std::unique_ptr mReductor; - std::array, getNumDE()> mRefValues; // Trend plots std::unique_ptr mOrbits; std::array, getNumDE()> mTrendsDE; - std::array, getNumDE()> mTrendsRefRatioDE; std::array, 10> mTrendsChamber; std::unique_ptr mTrends; }; diff --git a/Modules/MUON/MCH/src/ClusterChargePlotter.cxx b/Modules/MUON/MCH/src/ClusterChargePlotter.cxx index ab1a3d66c0..3c88aecadb 100644 --- a/Modules/MUON/MCH/src/ClusterChargePlotter.cxx +++ b/Modules/MUON/MCH/src/ClusterChargePlotter.cxx @@ -23,45 +23,17 @@ namespace quality_control_modules namespace muonchambers { -ClusterChargePlotter::ClusterChargePlotter(std::string path, TH2F* hRef, bool fullPlots) +ClusterChargePlotter::ClusterChargePlotter(std::string path, bool fullPlots) { mChargeReductor = std::make_unique(); - //---------------------------------- - // Reference charge MPV histogram - //---------------------------------- - mHistogramChargePerDERef = - std::make_unique(TString::Format("%sChargeRef", path.c_str()), - TString::Format("Charge vs DE, reference"), getNumDE(), 0, getNumDE()); - mHistogramChargePerDERef->SetLineColor(kRed); - mHistogramChargePerDERef->SetLineStyle(kDashed); - mHistogramChargePerDERef->SetLineWidth(2); - - if (hRef) { - ClusterChargeReductor reductorRef; - reductorRef.update(hRef); - - for (size_t de = 0; de < mHistogramChargePerDERef->GetXaxis()->GetNbins(); de++) { - mHistogramChargePerDERef->SetBinContent(de + 1, reductorRef.getDeValue(de)); - mHistogramChargePerDERef->SetBinError(de + 1, 0); - } - } - //---------------------------------- // Charge MPV histograms //---------------------------------- mHistogramChargePerDE = std::make_unique(TString::Format("%sClusterChargeMPVHist", path.c_str()), TString::Format("Charge vs DE"), getNumDE(), 0, getNumDE()); - - mHistogramChargeRefRatio = std::make_unique(TString::Format("%sClusterChargeMPVRefRatio", path.c_str()), - TString::Format("Charge vs DE, ratio wrt reference"), getNumDE(), 0, getNumDE()); - addHisto(mHistogramChargeRefRatio.get(), false, "histo", ""); - - mCanvasChargePerDE = std::make_unique(TString::Format("%sClusterChargeMPV", path.c_str()), - TString::Format("Charge MPV vs DE"), 800, 600); - // mCanvasChargePerDE->SetLogy(kTRUE); - addCanvas(mCanvasChargePerDE.get(), mHistogramChargePerDE.get(), false, "", ""); + addHisto(mHistogramChargePerDE.get(), false, "histo", ""); for (auto de : o2::mch::constants::deIdsForAllMCH) { int deID = getDEindex(de); @@ -88,27 +60,6 @@ void ClusterChargePlotter::update(TH2F* hCharge) mHistogramChargePerDE->SetBinError(de + 1, 0.1); } - mCanvasChargePerDE->Clear(); - mCanvasChargePerDE->cd(); - mHistogramChargePerDE->Draw(); - - if (mHistogramChargePerDERef) { - mHistogramChargePerDERef->Draw("histsame"); - - mHistogramChargeRefRatio->Reset(); - mHistogramChargeRefRatio->Add(mHistogramChargePerDE.get()); - mHistogramChargeRefRatio->Divide(mHistogramChargePerDERef.get()); - - // special handling of bins with zero rate in reference - int nbinsx = mHistogramChargePerDERef->GetXaxis()->GetNbins(); - for (int b = 1; b <= nbinsx; b++) { - if (mHistogramChargePerDERef->GetBinContent(b) == 0) { - mHistogramChargeRefRatio->SetBinContent(b, 1); - mHistogramChargeRefRatio->SetBinError(b, 0); - } - } - } - for (int xbin = 1; xbin <= hCharge->GetXaxis()->GetNbins(); xbin++) { if (xbin > getNumDE()) { break; diff --git a/Modules/MUON/MCH/src/ClusterChargeTrendsPlotter.cxx b/Modules/MUON/MCH/src/ClusterChargeTrendsPlotter.cxx index 45a5d4f253..14a3d57a19 100644 --- a/Modules/MUON/MCH/src/ClusterChargeTrendsPlotter.cxx +++ b/Modules/MUON/MCH/src/ClusterChargeTrendsPlotter.cxx @@ -25,20 +25,10 @@ namespace quality_control_modules namespace muonchambers { -ClusterChargeTrendsPlotter::ClusterChargeTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots) +ClusterChargeTrendsPlotter::ClusterChargeTrendsPlotter(std::string path, bool fullPlots) { mReductor = std::make_unique(); - //-------------------------------------------------- - // Cluster charge reference values - //-------------------------------------------------- - - std::unique_ptr reductorRef; - if (hRef) { - reductorRef = std::make_unique(); - reductorRef->update(hRef); - } - //-------------------------------------------------- // Cluster charge trends //-------------------------------------------------- @@ -49,13 +39,8 @@ ClusterChargeTrendsPlotter::ClusterChargeTrendsPlotter(std::string path, TH2F* h continue; } - std::optional refVal; - if (reductorRef) { - refVal = reductorRef->getDeValue(deID); - } - mTrends[deID] = std::make_unique(fmt::format("{}{}/ClusterCharge_DE{}", path, getHistoPath(de), de), - fmt::format("DE{} Cluster Charge MPV", de), "charge (ADC)", refVal); + fmt::format("DE{} Cluster Charge MPV", de), "charge (ADC)"); // mTrends[deID]->setRange(0, 1.2); if (fullPlots) { addCanvas(mTrends[deID].get(), ""); diff --git a/Modules/MUON/MCH/src/ClusterSizePlotter.cxx b/Modules/MUON/MCH/src/ClusterSizePlotter.cxx index ac53f9f9a0..54b3247410 100644 --- a/Modules/MUON/MCH/src/ClusterSizePlotter.cxx +++ b/Modules/MUON/MCH/src/ClusterSizePlotter.cxx @@ -29,54 +29,22 @@ namespace quality_control_modules namespace muonchambers { -ClusterSizePlotter::ClusterSizePlotter(std::string path, TH2F* hRef, bool fullPlots) : mPath(path) +ClusterSizePlotter::ClusterSizePlotter(std::string path, bool fullPlots) : mPath(path) { mClusterSizeReductor = std::make_unique(); - ClusterSizeReductor reductorRef; - if (hRef) { - reductorRef.update(hRef); - } - std::string sc[3] = { "B", "NB", "" }; std::string sc2[3] = { " (B)", " (NB)", "" }; int histColors[3] = { kRed, kBlue, kBlack }; for (int ci = 0; ci < 3; ci++) { - //---------------------------------- - // Reference mean cluster size histogram - //---------------------------------- - mHistogramClusterSizePerDERef[ci] = - std::make_unique(TString::Format("%sClusterSizeRef%s", mPath.c_str(), sc[ci].c_str()), - TString::Format("Cluster Size vs DE%s, reference", sc2[ci].c_str()), - getNumDE(), 0, getNumDE()); - mHistogramClusterSizePerDERef[ci]->SetLineColor(kRed); - mHistogramClusterSizePerDERef[ci]->SetLineStyle(kDashed); - mHistogramClusterSizePerDERef[ci]->SetLineWidth(2); - - if (hRef) { - for (size_t de = 0; de < mHistogramClusterSizePerDERef[ci]->GetXaxis()->GetNbins(); de++) { - mHistogramClusterSizePerDERef[ci]->SetBinContent(de + 1, reductorRef.getDeValue(de, ci)); - mHistogramClusterSizePerDERef[ci]->SetBinError(de + 1, 0); - } - } - //---------------------------------- // Mean cluster size histograms //---------------------------------- - mHistogramClusterSizePerDE[ci] = std::make_unique(TString::Format("%sMeanClusterSize%sHist", mPath.c_str(), sc[ci].c_str()), + mHistogramClusterSizePerDE[ci] = std::make_unique(TString::Format("%sMeanClusterSize%s", mPath.c_str(), sc[ci].c_str()), TString::Format("Cluster Size vs DE%s", sc2[ci].c_str()), getNumDE(), 0, getNumDE()); - - mHistogramClusterSizePerDERefRatio[ci] = std::make_unique(TString::Format("%sMeanClusterSizeRefRatio%s", mPath.c_str(), sc[ci].c_str()), - TString::Format("Cluster Size vs DE%s, ratio wrt reference", sc2[ci].c_str()), - getNumDE(), 0, getNumDE()); - addHisto(mHistogramClusterSizePerDERefRatio[ci].get(), false, "histo", ""); - - mCanvasClusterSizePerDE[ci] = std::make_unique(TString::Format("%sMeanClusterSize%s", mPath.c_str(), sc[ci].c_str()), - TString::Format("Cluster Size vs DE%s", sc2[ci].c_str()), 800, 600); - // mCanvasClusterSizePerDE->SetLogy(kTRUE); - addCanvas(mCanvasClusterSizePerDE[ci].get(), mHistogramClusterSizePerDE[ci].get(), false, "histo", "histo"); + addHisto(mHistogramClusterSizePerDE[ci].get(), false, "histo", ""); for (auto de : o2::mch::constants::deIdsForAllMCH) { int deID = getDEindex(de); @@ -144,27 +112,6 @@ void ClusterSizePlotter::fillHistograms(TH2F* hSize) mHistogramClusterSizePerDE[ci]->SetBinContent(de + 1, mClusterSizeReductor->getDeValue(de, ci)); mHistogramClusterSizePerDE[ci]->SetBinError(de + 1, 0.1); } - - mCanvasClusterSizePerDE[ci]->Clear(); - mCanvasClusterSizePerDE[ci]->cd(); - mHistogramClusterSizePerDE[ci]->Draw(); - - if (mHistogramClusterSizePerDERef[ci]) { - mHistogramClusterSizePerDERef[ci]->Draw("histsame"); - - mHistogramClusterSizePerDERefRatio[ci]->Reset(); - mHistogramClusterSizePerDERefRatio[ci]->Add(mHistogramClusterSizePerDE[ci].get()); - mHistogramClusterSizePerDERefRatio[ci]->Divide(mHistogramClusterSizePerDERef[ci].get()); - - // special handling of bins with zero rate in reference - int nbinsx = mHistogramClusterSizePerDERef[ci]->GetXaxis()->GetNbins(); - for (int b = 1; b <= nbinsx; b++) { - if (mHistogramClusterSizePerDERef[ci]->GetBinContent(b) == 0) { - mHistogramClusterSizePerDERefRatio[ci]->SetBinContent(b, 1); - mHistogramClusterSizePerDERefRatio[ci]->SetBinError(b, 0); - } - } - } } for (int xbin = 1; xbin <= hSize->GetXaxis()->GetNbins(); xbin++) { diff --git a/Modules/MUON/MCH/src/ClusterSizeTrendsPlotter.cxx b/Modules/MUON/MCH/src/ClusterSizeTrendsPlotter.cxx index 159d8d3a93..9eee2e171f 100644 --- a/Modules/MUON/MCH/src/ClusterSizeTrendsPlotter.cxx +++ b/Modules/MUON/MCH/src/ClusterSizeTrendsPlotter.cxx @@ -27,16 +27,10 @@ namespace quality_control_modules namespace muonchambers { -ClusterSizeTrendsPlotter::ClusterSizeTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots) +ClusterSizeTrendsPlotter::ClusterSizeTrendsPlotter(std::string path, bool fullPlots) { mReductor = std::make_unique(); - std::unique_ptr reductorRef; - if (hRef) { - reductorRef = std::make_unique(); - reductorRef->update(hRef); - } - //-------------------------------------------------- // Efficiency trends //-------------------------------------------------- @@ -47,18 +41,11 @@ ClusterSizeTrendsPlotter::ClusterSizeTrendsPlotter(std::string path, TH2F* hRef, continue; } - std::optional refB, refNB, refBNB; - if (reductorRef) { - refB = reductorRef->getDeValue(deID, 0); - refNB = reductorRef->getDeValue(deID, 1); - refBNB = reductorRef->getDeValue(deID, 2); - } - mTrends[deID] = std::make_unique(fmt::format("{}{}/ClusterSize_DE{}", path, getHistoPath(de), de), fmt::format("DE{} Cluster Size", de), "cluster size"); - mTrends[deID]->addGraph("B", "bending ", refB); - mTrends[deID]->addGraph("NB", "non-bending", refNB); - mTrends[deID]->addGraph("BNB", "full ", refBNB); + mTrends[deID]->addGraph("B", "bending "); + mTrends[deID]->addGraph("NB", "non-bending"); + mTrends[deID]->addGraph("BNB", "full "); mTrends[deID]->addLegends(); if (fullPlots) { diff --git a/Modules/MUON/MCH/src/DigitsPostProcessing.cxx b/Modules/MUON/MCH/src/DigitsPostProcessing.cxx index b65684335f..e6b4ab8600 100644 --- a/Modules/MUON/MCH/src/DigitsPostProcessing.cxx +++ b/Modules/MUON/MCH/src/DigitsPostProcessing.cxx @@ -50,44 +50,24 @@ void DigitsPostProcessing::createRatesHistos(Trigger t, repository::DatabaseInte mElecMapSignalOnCycle = std::make_unique>(); } - //---------------------------------- - // Reference mean rates histogram - //---------------------------------- - - TH2F* hElecHistoRef{ nullptr }; - obj = mCcdbObjectsRef.find(rateSourceName()); - if (obj != mCcdbObjectsRef.end() && obj->second.update(qcdb, mRefTimeStamp)) { - ILOG(Info, Devel) << "Loaded reference plot \"" << obj->second.mObject->getName() << "\", time stamp " << mRefTimeStamp - << AliceO2::InfoLogger::InfoLogger::endm; - hElecHistoRef = obj->second.get(); - } - - TH2F* hElecSignalHistoRef{ nullptr }; - obj = mCcdbObjectsRef.find(rateSignalSourceName()); - if (obj != mCcdbObjectsRef.end() && obj->second.update(qcdb, mRefTimeStamp)) { - ILOG(Info, Devel) << "Loaded reference plot \"" << obj->second.mObject->getName() << "\", time stamp " << mRefTimeStamp - << AliceO2::InfoLogger::InfoLogger::endm; - hElecSignalHistoRef = obj->second.get(); - } - //---------------------------------- // Rate plotters //---------------------------------- mRatesPlotter.reset(); - mRatesPlotter = std::make_unique("Rates/", hElecHistoRef, mChannelRateMin, mChannelRateMax, true, mFullHistos); + mRatesPlotter = std::make_unique("Rates/", mChannelRateMin, mChannelRateMax, true, mFullHistos); mRatesPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mRatesPlotterOnCycle.reset(); - mRatesPlotterOnCycle = std::make_unique("Rates/LastCycle/", hElecHistoRef, mChannelRateMin, mChannelRateMax, false, mFullHistos); + mRatesPlotterOnCycle = std::make_unique("Rates/LastCycle/", mChannelRateMin, mChannelRateMax, false, mFullHistos); mRatesPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mRatesPlotterSignal.reset(); - mRatesPlotterSignal = std::make_unique("RatesSignal/", hElecSignalHistoRef, mChannelRateMin, mChannelRateMax, true, mFullHistos); + mRatesPlotterSignal = std::make_unique("RatesSignal/", mChannelRateMin, mChannelRateMax, true, mFullHistos); mRatesPlotterSignal->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mRatesPlotterSignalOnCycle.reset(); - mRatesPlotterSignalOnCycle = std::make_unique("RatesSignal/LastCycle/", hElecSignalHistoRef, mChannelRateMin, mChannelRateMax, false, mFullHistos); + mRatesPlotterSignalOnCycle = std::make_unique("RatesSignal/LastCycle/", mChannelRateMin, mChannelRateMax, false, mFullHistos); mRatesPlotterSignalOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); //---------------------------------- @@ -95,11 +75,11 @@ void DigitsPostProcessing::createRatesHistos(Trigger t, repository::DatabaseInte //---------------------------------- mRatesTrendsPlotter.reset(); - mRatesTrendsPlotter = std::make_unique("Trends/Rates/", hElecHistoRef, mFullHistos); + mRatesTrendsPlotter = std::make_unique("Trends/Rates/", mFullHistos); mRatesTrendsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mRatesTrendsPlotterSignal.reset(); - mRatesTrendsPlotterSignal = std::make_unique("Trends/RatesSignal/", hElecSignalHistoRef, mFullHistos); + mRatesTrendsPlotterSignal = std::make_unique("Trends/RatesSignal/", mFullHistos); mRatesTrendsPlotterSignal->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); } @@ -153,9 +133,6 @@ void DigitsPostProcessing::initialize(Trigger t, framework::ServiceRegistryRef s mFullHistos = getConfigurationParameter(mCustomParameters, "FullHistos", mFullHistos, activity); - mRefTimeStamp = getConfigurationParameter(mCustomParameters, "ReferenceTimeStamp", mRefTimeStamp, activity); - ILOG(Info, Devel) << "Reference time stamp: " << mRefTimeStamp << ENDM; - mChannelRateMin = getConfigurationParameter(mCustomParameters, "ChannelRateMin", mChannelRateMin, activity); mChannelRateMax = getConfigurationParameter(mCustomParameters, "ChannelRateMax", mChannelRateMax, activity); @@ -165,12 +142,6 @@ void DigitsPostProcessing::initialize(Trigger t, framework::ServiceRegistryRef s mCcdbObjects.emplace(orbitsSourceName(), CcdbObjectHelper()); mCcdbObjects.emplace(orbitsSignalSourceName(), CcdbObjectHelper()); - mCcdbObjectsRef.clear(); - if (mRefTimeStamp > 0) { - mCcdbObjectsRef.emplace(rateSourceName(), CcdbObjectHelper()); - mCcdbObjectsRef.emplace(rateSignalSourceName(), CcdbObjectHelper()); - } - // set objects path from configuration for (auto source : mConfig.dataSources) { std::string sourceType, sourceName; @@ -184,12 +155,6 @@ void DigitsPostProcessing::initialize(Trigger t, framework::ServiceRegistryRef s obj->second.mPath = source.path; obj->second.mName = sourceName; } - - auto objRef = mCcdbObjectsRef.find(sourceType); - if (objRef != mCcdbObjectsRef.end()) { - objRef->second.mPath = source.path; - objRef->second.mName = sourceName; - } } // instantiate and publish the histograms diff --git a/Modules/MUON/MCH/src/EfficiencyPlotter.cxx b/Modules/MUON/MCH/src/EfficiencyPlotter.cxx index c1f20f8f6e..d003a50041 100644 --- a/Modules/MUON/MCH/src/EfficiencyPlotter.cxx +++ b/Modules/MUON/MCH/src/EfficiencyPlotter.cxx @@ -29,7 +29,7 @@ namespace quality_control_modules namespace muonchambers { -EfficiencyPlotter::EfficiencyPlotter(std::string path, TH2F* hRef, bool fullPlots) +EfficiencyPlotter::EfficiencyPlotter(std::string path, bool fullPlots) { mElec2DetMapper = createElec2DetMapper(); mDet2ElecMapper = createDet2ElecMapper(); @@ -38,46 +38,16 @@ EfficiencyPlotter::EfficiencyPlotter(std::string path, TH2F* hRef, bool fullPlot mElecMapReductor = std::make_unique(); + //---------------------------------- + // Mean efficiency histograms + //---------------------------------- + std::string sc[2] = { "B", "NB" }; for (int ci = 0; ci < 2; ci++) { - - //---------------------------------- - // Reference mean rates histogram - //---------------------------------- - if (hRef) { - mHistogramMeanEfficiencyPerDERef[ci] = - std::make_unique(TString::Format("%sMeanEfficiencyRef%s", path.c_str(), sc[ci].c_str()), - TString::Format("Mean Efficiency vs DE (%s), reference", sc[ci].c_str()), - getNumDE(), 0, getNumDE()); - mHistogramMeanEfficiencyPerDERef[ci]->SetLineColor(kRed); - mHistogramMeanEfficiencyPerDERef[ci]->SetLineStyle(kDashed); - mHistogramMeanEfficiencyPerDERef[ci]->SetLineWidth(2); - - TH2ElecMapReductor elecMapReductorRef; - elecMapReductorRef.update(hRef); - - for (size_t de = 0; de < mHistogramMeanEfficiencyPerDERef[ci]->GetXaxis()->GetNbins(); de++) { - mHistogramMeanEfficiencyPerDERef[ci]->SetBinContent(de + 1, elecMapReductorRef.getDeValue(de, ci)); - mHistogramMeanEfficiencyPerDERef[ci]->SetBinError(de + 1, 0); - } - } - - //---------------------------------- - // Mean rates histograms - //---------------------------------- - - mHistogramMeanEfficiencyPerDE[ci] = std::make_unique(TString::Format("%sMeanEfficiency%sHist", path.c_str(), sc[ci].c_str()), + mHistogramMeanEfficiencyPerDE[ci] = std::make_unique(TString::Format("%sMeanEfficiency%s", path.c_str(), sc[ci].c_str()), TString::Format("Mean Efficiency vs DE (%s)", sc[ci].c_str()), getNumDE(), 0, getNumDE()); - - mHistogramMeanEfficiencyRefRatio[ci] = std::make_unique(TString::Format("%sMeanEfficiencyRefRatio%s", path.c_str(), sc[ci].c_str()), - TString::Format("Mean Efficiency vs DE (%s), ratio wrt reference", sc[ci].c_str()), - getNumDE(), 0, getNumDE()); - addHisto(mHistogramMeanEfficiencyRefRatio[ci].get(), false, "histo", "histo"); - - mCanvasMeanEfficiencyPerDE[ci] = std::make_unique(TString::Format("%sMeanEfficiency%s", path.c_str(), sc[ci].c_str()), - TString::Format("Mean Efficiency vs DE (%s)", sc[ci].c_str()), 800, 600); - addCanvas(mCanvasMeanEfficiencyPerDE[ci].get(), mHistogramMeanEfficiencyPerDE[ci].get(), false, "histo", "histo"); + addHisto(mHistogramMeanEfficiencyPerDE[ci].get(), false, "histo", "histo"); } //-------------------------------------------------- @@ -122,27 +92,6 @@ void EfficiencyPlotter::fillAverageHistograms() mHistogramMeanEfficiencyPerDE[ci]->SetBinContent(de + 1, mElecMapReductor->getDeValue(de, ci)); mHistogramMeanEfficiencyPerDE[ci]->SetBinError(de + 1, 0.1); } - - mCanvasMeanEfficiencyPerDE[ci]->Clear(); - mCanvasMeanEfficiencyPerDE[ci]->cd(); - mHistogramMeanEfficiencyPerDE[ci]->Draw(); - - if (mHistogramMeanEfficiencyPerDERef[ci]) { - mHistogramMeanEfficiencyPerDERef[ci]->Draw("histsame"); - - mHistogramMeanEfficiencyRefRatio[ci]->Reset(); - mHistogramMeanEfficiencyRefRatio[ci]->Add(mHistogramMeanEfficiencyPerDE[ci].get()); - mHistogramMeanEfficiencyRefRatio[ci]->Divide(mHistogramMeanEfficiencyPerDERef[ci].get()); - - // special handling of bins with zero rate in reference - int nbinsx = mHistogramMeanEfficiencyPerDERef[ci]->GetXaxis()->GetNbins(); - for (int b = 1; b <= nbinsx; b++) { - if (mHistogramMeanEfficiencyPerDERef[ci]->GetBinContent(b) == 0) { - mHistogramMeanEfficiencyRefRatio[ci]->SetBinContent(b, 1); - mHistogramMeanEfficiencyRefRatio[ci]->SetBinError(b, 0); - } - } - } } } diff --git a/Modules/MUON/MCH/src/EfficiencyTrendsPlotter.cxx b/Modules/MUON/MCH/src/EfficiencyTrendsPlotter.cxx index 04377c1028..b2b2b7133e 100644 --- a/Modules/MUON/MCH/src/EfficiencyTrendsPlotter.cxx +++ b/Modules/MUON/MCH/src/EfficiencyTrendsPlotter.cxx @@ -29,16 +29,10 @@ namespace quality_control_modules namespace muonchambers { -EfficiencyTrendsPlotter::EfficiencyTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots) +EfficiencyTrendsPlotter::EfficiencyTrendsPlotter(std::string path, bool fullPlots) { mElecMapReductor = std::make_unique(); - std::unique_ptr reductorRef; - if (hRef) { - reductorRef = std::make_unique(); - reductorRef->update(hRef); - } - //-------------------------------------------------- // Efficiency trends //-------------------------------------------------- @@ -49,16 +43,10 @@ EfficiencyTrendsPlotter::EfficiencyTrendsPlotter(std::string path, TH2F* hRef, b continue; } - std::optional refB, refNB; - if (reductorRef) { - refB = reductorRef->getDeValue(deID, 0); - refNB = reductorRef->getDeValue(deID, 1); - } - mTrendsEfficiency[deID] = std::make_unique(fmt::format("{}{}/Efficiency_DE{}", path, getHistoPath(de), de), fmt::format("DE{} Efficiency", de), "efficiency"); - mTrendsEfficiency[deID]->addGraph("B", "bending ", refB); - mTrendsEfficiency[deID]->addGraph("NB", "non-bending", refNB); + mTrendsEfficiency[deID]->addGraph("B", "bending "); + mTrendsEfficiency[deID]->addGraph("NB", "non-bending"); mTrendsEfficiency[deID]->addLegends(); // mTrendsEfficiency[deID]->setRange(0, 1.2); diff --git a/Modules/MUON/MCH/src/PreclustersPostProcessing.cxx b/Modules/MUON/MCH/src/PreclustersPostProcessing.cxx index f3655dfef2..b625b40d37 100644 --- a/Modules/MUON/MCH/src/PreclustersPostProcessing.cxx +++ b/Modules/MUON/MCH/src/PreclustersPostProcessing.cxx @@ -41,28 +41,16 @@ void PreclustersPostProcessing::createEfficiencyHistos(Trigger t, repository::Da mElecMapOnCycle = std::make_unique>(); } - //---------------------------------- - // Reference mean efficiency histogram - //---------------------------------- - - TH2F* hElecHistoRef{ nullptr }; - obj = mCcdbObjectsRef.find(effSourceName()); - if (obj != mCcdbObjectsRef.end() && obj->second.update(qcdb, mRefTimeStamp)) { - ILOG(Info, Devel) << "Loaded reference plot \"" << obj->second.mObject->getName() - << "\", time stamp " << mRefTimeStamp << ENDM; - hElecHistoRef = obj->second.get(); - } - //---------------------------------- // Efficiency plotters //---------------------------------- mEfficiencyPlotter.reset(); - mEfficiencyPlotter = std::make_unique("Efficiency/", hElecHistoRef, mFullHistos); + mEfficiencyPlotter = std::make_unique("Efficiency/", mFullHistos); mEfficiencyPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mEfficiencyPlotterOnCycle.reset(); - mEfficiencyPlotterOnCycle = std::make_unique("Efficiency/LastCycle/", hElecHistoRef, mFullHistos); + mEfficiencyPlotterOnCycle = std::make_unique("Efficiency/LastCycle/", mFullHistos); mEfficiencyPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); //---------------------------------- @@ -70,7 +58,7 @@ void PreclustersPostProcessing::createEfficiencyHistos(Trigger t, repository::Da //---------------------------------- mEfficiencyTrendsPlotter.reset(); - mEfficiencyTrendsPlotter = std::make_unique("Trends/", hElecHistoRef, mFullHistos); + mEfficiencyTrendsPlotter = std::make_unique("Trends/", mFullHistos); mEfficiencyTrendsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); } @@ -88,26 +76,16 @@ void PreclustersPostProcessing::createClusterChargeHistos(Trigger t, repository: mClusterChargeOnCycle = std::make_unique>(); } - //---------------------------------- - // Reference mean cluster charge histogram - //---------------------------------- - - TH2F* histoRef{ nullptr }; - obj = mCcdbObjectsRef.find(clusterChargeSourceName()); - if (obj != mCcdbObjectsRef.end() && obj->second.update(qcdb, mRefTimeStamp)) { - histoRef = obj->second.get(); - } - //---------------------------------- // Cluster charge plotters //---------------------------------- mClusterChargePlotter.reset(); - mClusterChargePlotter = std::make_unique("ClusterCharge/", histoRef, mFullHistos); + mClusterChargePlotter = std::make_unique("ClusterCharge/", mFullHistos); mClusterChargePlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mClusterChargePlotterOnCycle.reset(); - mClusterChargePlotterOnCycle = std::make_unique("ClusterCharge/LastCycle/", histoRef, mFullHistos); + mClusterChargePlotterOnCycle = std::make_unique("ClusterCharge/LastCycle/", mFullHistos); mClusterChargePlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); //---------------------------------- @@ -115,7 +93,7 @@ void PreclustersPostProcessing::createClusterChargeHistos(Trigger t, repository: //---------------------------------- mClusterChargeTrendsPlotter.reset(); - mClusterChargeTrendsPlotter = std::make_unique("Trends/", histoRef, mFullHistos); + mClusterChargeTrendsPlotter = std::make_unique("Trends/", mFullHistos); mClusterChargeTrendsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); } @@ -133,26 +111,16 @@ void PreclustersPostProcessing::createClusterSizeHistos(Trigger t, repository::D mClusterSizeOnCycle = std::make_unique>(); } - //---------------------------------- - // Reference mean cluster size histogram - //---------------------------------- - - TH2F* histoRef{ nullptr }; - obj = mCcdbObjectsRef.find(clusterSizeSourceName()); - if (obj != mCcdbObjectsRef.end() && obj->second.update(qcdb, mRefTimeStamp)) { - histoRef = obj->second.get(); - } - //---------------------------------- // Cluster size plotters //---------------------------------- mClusterSizePlotter.reset(); - mClusterSizePlotter = std::make_unique("ClusterSize/", histoRef, mFullHistos); + mClusterSizePlotter = std::make_unique("ClusterSize/", mFullHistos); mClusterSizePlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); mClusterSizePlotterOnCycle.reset(); - mClusterSizePlotterOnCycle = std::make_unique("ClusterSize/LastCycle/", histoRef, mFullHistos); + mClusterSizePlotterOnCycle = std::make_unique("ClusterSize/LastCycle/", mFullHistos); mClusterSizePlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); //---------------------------------- @@ -160,7 +128,7 @@ void PreclustersPostProcessing::createClusterSizeHistos(Trigger t, repository::D //---------------------------------- mClusterSizeTrendsPlotter.reset(); - mClusterSizeTrendsPlotter = std::make_unique("Trends/", histoRef, mFullHistos); + mClusterSizeTrendsPlotter = std::make_unique("Trends/", mFullHistos); mClusterSizeTrendsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop); } @@ -173,21 +141,11 @@ void PreclustersPostProcessing::initialize(Trigger t, framework::ServiceRegistry mFullHistos = getConfigurationParameter(mCustomParameters, "FullHistos", mFullHistos, activity); - mRefTimeStamp = getConfigurationParameter(mCustomParameters, "ReferenceTimeStamp", mRefTimeStamp, activity); - ILOG(Info, Devel) << "Reference time stamp: " << mRefTimeStamp << ENDM; - mCcdbObjects.clear(); mCcdbObjects.emplace(effSourceName(), CcdbObjectHelper()); mCcdbObjects.emplace(clusterChargeSourceName(), CcdbObjectHelper()); mCcdbObjects.emplace(clusterSizeSourceName(), CcdbObjectHelper()); - mCcdbObjectsRef.clear(); - if (mRefTimeStamp > 0) { - mCcdbObjectsRef.emplace(effSourceName(), CcdbObjectHelper()); - mCcdbObjectsRef.emplace(clusterChargeSourceName(), CcdbObjectHelper()); - mCcdbObjectsRef.emplace(clusterSizeSourceName(), CcdbObjectHelper()); - } - // set objects path from configuration for (const auto& source : mConfig.dataSources) { std::string sourceType, sourceName; @@ -201,12 +159,6 @@ void PreclustersPostProcessing::initialize(Trigger t, framework::ServiceRegistry obj->second.mPath = source.path; obj->second.mName = sourceName; } - - auto objRef = mCcdbObjectsRef.find(sourceType); - if (objRef != mCcdbObjectsRef.end()) { - objRef->second.mPath = source.path; - objRef->second.mName = sourceName; - } } // instantiate and publish the histograms diff --git a/Modules/MUON/MCH/src/RatesPlotter.cxx b/Modules/MUON/MCH/src/RatesPlotter.cxx index f9c92a1447..ff62b2f086 100644 --- a/Modules/MUON/MCH/src/RatesPlotter.cxx +++ b/Modules/MUON/MCH/src/RatesPlotter.cxx @@ -31,7 +31,7 @@ namespace quality_control_modules namespace muonchambers { -RatesPlotter::RatesPlotter(std::string path, TH2F* hRef, float rateMin, float rateMax, bool perStationPlots, bool fullPlots) +RatesPlotter::RatesPlotter(std::string path, float rateMin, float rateMax, bool perStationPlots, bool fullPlots) { // mappers used for filling the histograms in detector coordinates mElec2DetMapper = createElec2DetMapper(); @@ -40,46 +40,6 @@ RatesPlotter::RatesPlotter(std::string path, TH2F* hRef, float rateMin, float ra // reductor for the rates plot in electronics coordinates mElecMapReductor = std::make_unique(rateMin, rateMax); - //---------------------------------- - // Reference mean rates histogram - //---------------------------------- - - if (hRef) { - TH2ElecMapReductor elecMapReductorRef(rateMin, rateMax); - elecMapReductorRef.update(hRef); - - mHistogramMeanRatePerDERef = - std::make_unique(TString::Format("%sMeanRateRef", path.c_str()), "Mean Rate vs DE, reference", - getNumDE(), 0, getNumDE()); - mHistogramMeanRatePerDERef->SetLineColor(kRed); - mHistogramMeanRatePerDERef->SetLineStyle(kDashed); - mHistogramMeanRatePerDERef->SetLineWidth(2); - - for (size_t de = 0; de < mHistogramMeanRatePerDERef->GetXaxis()->GetNbins(); de++) { - mHistogramMeanRatePerDERef->SetBinContent(de + 1, elecMapReductorRef.getDeValue(de)); - mHistogramMeanRatePerDERef->SetBinError(de + 1, 0); - } - - mHistogramGoodChannelsFractionPerDERef = - std::make_unique(TString::Format("%sGoodChannelsFractionRef", path.c_str()), "Good channels fraction, reference", - getNumDE(), 0, getNumDE()); - mHistogramGoodChannelsFractionPerDERef->SetLineColor(kRed); - mHistogramGoodChannelsFractionPerDERef->SetLineStyle(kDashed); - mHistogramGoodChannelsFractionPerDERef->SetLineWidth(2); - - for (size_t de = 0; de < mHistogramMeanRatePerDERef->GetXaxis()->GetNbins(); de++) { - float nPads = elecMapReductorRef.getNumPads(de); - float nPadsBad = elecMapReductorRef.getNumPadsBad(de) + elecMapReductorRef.getNumPadsNoStat(de); - float nPadsGood = nPads - nPadsBad; - if (nPads > 0) { - mHistogramGoodChannelsFractionPerDERef->SetBinContent(de + 1, nPadsGood / nPads); - } else { - mHistogramGoodChannelsFractionPerDERef->SetBinContent(de + 1, 0); - } - mHistogramGoodChannelsFractionPerDERef->SetBinError(de + 1, 0); - } - } - //---------------------------------- // Rate distribution histograms //---------------------------------- @@ -103,31 +63,17 @@ RatesPlotter::RatesPlotter(std::string path, TH2F* hRef, float rateMin, float ra // Mean rates histograms //---------------------------------- - mHistogramMeanRatePerDE = std::make_unique(TString::Format("%sMeanRateHist", path.c_str()), "Mean Rate", + mHistogramMeanRatePerDE = std::make_unique(TString::Format("%sMeanRate", path.c_str()), "Mean Rate", getNumDE(), 0, getNumDE()); - - mHistogramMeanRateRefRatio = std::make_unique(TString::Format("%sMeanRateRefRatio", path.c_str()), "Mean Rate - ratio wrt reference", - getNumDE(), 0, getNumDE()); - addHisto(mHistogramMeanRateRefRatio.get(), false, "histo", "histo"); - - mCanvasMeanRatePerDE = std::make_unique(TString::Format("%sMeanRate", path.c_str()), "Mean Rate vs DE", 800, 600); - mCanvasMeanRatePerDE->SetLogy(kTRUE); - addCanvas(mCanvasMeanRatePerDE.get(), mHistogramMeanRatePerDE.get(), false, "histo", "histo"); + addHisto(mHistogramMeanRatePerDE.get(), false, "histo", "logy"); //---------------------------------- // "Good" channels fraction histograms //---------------------------------- - mHistogramGoodChannelsFractionPerDE = std::make_unique(TString::Format("%sGoodChannelsFractionHist", path.c_str()), + mHistogramGoodChannelsFractionPerDE = std::make_unique(TString::Format("%sGoodChannelsFraction", path.c_str()), "Good channels fraction", getNumDE(), 0, getNumDE()); - - mHistogramGoodChannelsFractionRefRatio = std::make_unique(TString::Format("%sGoodChannelsFractionRefRatio", path.c_str()), "Good channels fraction - ratio wrt reference", - getNumDE(), 0, getNumDE()); - addHisto(mHistogramGoodChannelsFractionRefRatio.get(), false, "histo", "histo"); - - mCanvasGoodChannelsFractionPerDE = std::make_unique(TString::Format("%sGoodChannelsFraction", path.c_str()), "Mean Rate", 800, 600); - mCanvasGoodChannelsFractionPerDE->SetLogy(kFALSE); - addCanvas(mCanvasGoodChannelsFractionPerDE.get(), mHistogramGoodChannelsFractionPerDE.get(), false, "histo", "histo"); + addHisto(mHistogramGoodChannelsFractionPerDE.get(), false, "histo", ""); //-------------------------------------------------- // Rates histograms in global detector coordinates @@ -173,27 +119,6 @@ void RatesPlotter::fillAverageHistos(TH2F* hRates) mHistogramMeanRatePerDE->SetBinError(de + 1, 0.1); } - mCanvasMeanRatePerDE->Clear(); - mCanvasMeanRatePerDE->cd(); - mHistogramMeanRatePerDE->Draw(); - - if (mHistogramMeanRatePerDERef) { - mHistogramMeanRatePerDERef->Draw("histsame"); - - mHistogramMeanRateRefRatio->Reset(); - mHistogramMeanRateRefRatio->Add(mHistogramMeanRatePerDE.get()); - mHistogramMeanRateRefRatio->Divide(mHistogramMeanRatePerDERef.get()); - - // special handling of bins with zero rate in reference - int nbinsx = mHistogramMeanRatePerDERef->GetXaxis()->GetNbins(); - for (int b = 1; b <= nbinsx; b++) { - if (mHistogramMeanRatePerDERef->GetBinContent(b) == 0) { - mHistogramMeanRateRefRatio->SetBinContent(b, 1); - mHistogramMeanRateRefRatio->SetBinError(b, 0); - } - } - } - for (size_t de = 0; de < mHistogramGoodChannelsFractionPerDE->GetXaxis()->GetNbins(); de++) { float nPads = mElecMapReductor->getNumPads(de); float nPadsBad = mElecMapReductor->getNumPadsBad(de) + mElecMapReductor->getNumPadsNoStat(de); @@ -206,27 +131,6 @@ void RatesPlotter::fillAverageHistos(TH2F* hRates) mHistogramGoodChannelsFractionPerDE->SetBinError(de + 1, 1); } } - - mCanvasGoodChannelsFractionPerDE->Clear(); - mCanvasGoodChannelsFractionPerDE->cd(); - mHistogramGoodChannelsFractionPerDE->Draw(); - - if (mHistogramGoodChannelsFractionPerDERef) { - mHistogramGoodChannelsFractionPerDERef->Draw("histsame"); - - mHistogramGoodChannelsFractionRefRatio->Reset(); - mHistogramGoodChannelsFractionRefRatio->Add(mHistogramGoodChannelsFractionPerDE.get()); - mHistogramGoodChannelsFractionRefRatio->Divide(mHistogramGoodChannelsFractionPerDERef.get()); - - // special handling of bins with zero rate in reference - int nbinsx = mHistogramGoodChannelsFractionPerDERef->GetXaxis()->GetNbins(); - for (int b = 1; b <= nbinsx; b++) { - if (mHistogramGoodChannelsFractionPerDERef->GetBinContent(b) == 0) { - mHistogramGoodChannelsFractionRefRatio->SetBinContent(b, 1); - mHistogramGoodChannelsFractionRefRatio->SetBinError(b, 0); - } - } - } } //_________________________________________________________________________________________ diff --git a/Modules/MUON/MCH/src/RatesTrendsPlotter.cxx b/Modules/MUON/MCH/src/RatesTrendsPlotter.cxx index 904562b19a..870dbed168 100644 --- a/Modules/MUON/MCH/src/RatesTrendsPlotter.cxx +++ b/Modules/MUON/MCH/src/RatesTrendsPlotter.cxx @@ -27,15 +27,10 @@ namespace quality_control_modules namespace muonchambers { -RatesTrendsPlotter::RatesTrendsPlotter(std::string path, TH2F* hRef, bool fullPlots) : mPath(path) +RatesTrendsPlotter::RatesTrendsPlotter(std::string path, bool fullPlots) : mPath(path) { mReductor = std::make_unique(); - std::unique_ptr reductorRef; - if (hRef) { - reductorRef = std::make_unique(); - reductorRef->update(hRef); - } mOrbits = std::make_unique(fmt::format("{}Orbits", path), "Orbits", "orbits"); addCanvas(mOrbits.get(), ""); @@ -49,23 +44,11 @@ RatesTrendsPlotter::RatesTrendsPlotter(std::string path, TH2F* hRef, bool fullPl if (deID < 0) { continue; } - if (reductorRef) { - mRefValues[deID] = reductorRef->getDeValue(deID); - mTrendsDE[deID] = std::make_unique(fmt::format("{}{}Rates_DE{}", path, getHistoPath(de), de), - fmt::format("DE{} Rates", de), "rate (kHz)", reductorRef->getDeValue(deID)); - } else { - mTrendsDE[deID] = std::make_unique(fmt::format("{}{}/Rates_DE{}", path, getHistoPath(de), de), - fmt::format("DE{} Rates", de), "rate (kHz)"); - } + mTrendsDE[deID] = std::make_unique(fmt::format("{}{}/Rates_DE{}", path, getHistoPath(de), de), + fmt::format("DE{} Rates", de), "rate (kHz)"); if (fullPlots) { addCanvas(mTrendsDE[deID].get(), ""); } - - mTrendsRefRatioDE[deID] = std::make_unique(fmt::format("{}{}RatesRefRatio_DE{}", path, getHistoPath(de), de), - fmt::format("DE{} Rates, ratio wrt. reference", de), "ratio"); - if (fullPlots) { - addCanvas(mTrendsRefRatioDE[deID].get(), ""); - } } mTrends = std::make_unique(fmt::format("{}ChamberRates", path), "Chamber Rates", "rate (kHz)"); @@ -94,11 +77,6 @@ void RatesTrendsPlotter::update(long time, TH2F* h) for (size_t de = 0; de < getNumDE(); de++) { mTrendsDE[de]->update(time, mReductor->getDeValue(de)); - float ratio = 1; - if (mRefValues[de] && mRefValues[de].value() != 0) { - ratio = mReductor->getDeValue(de) / mRefValues[de].value(); - } - mTrendsRefRatioDE[de]->update(time, ratio); } std::array values;