diff --git a/Modules/MFT/include/MFT/QcMFTClusterTask.h b/Modules/MFT/include/MFT/QcMFTClusterTask.h index c844072b08..ef2c87d162 100644 --- a/Modules/MFT/include/MFT/QcMFTClusterTask.h +++ b/Modules/MFT/include/MFT/QcMFTClusterTask.h @@ -15,10 +15,12 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund /// #ifndef QC_MFT_CLUSTER_TASK_H #define QC_MFT_CLUSTER_TASK_H + #include #include #include @@ -28,8 +30,11 @@ // Quality Control #include "QualityControl/TaskInterface.h" +#include "Common/TH1Ratio.h" +#include "Common/TH2Ratio.h" using namespace o2::quality_control::core; +using namespace o2::quality_control_modules::common; namespace o2::quality_control_modules::mft { @@ -59,28 +64,29 @@ class QcMFTClusterTask /*final*/ : public TaskInterface // todo add back the "fi } private: - std::unique_ptr mClusterLayerIndexH0 = nullptr; - std::unique_ptr mClusterLayerIndexH1 = nullptr; - std::unique_ptr mClusterDiskIndex = nullptr; + std::unique_ptr mClusterLayerIndexH0 = nullptr; + std::unique_ptr mClusterLayerIndexH1 = nullptr; - std::unique_ptr mClusterOccupancy = nullptr; - std::unique_ptr mClusterPatternIndex = nullptr; - std::unique_ptr mClusterSizeSummary = nullptr; - std::unique_ptr mGroupedClusterSizeSummary = nullptr; - std::unique_ptr mClusterOccupancySummary = nullptr; + std::unique_ptr mClusterOccupancy = nullptr; + std::unique_ptr mClusterPatternIndex = nullptr; + std::unique_ptr mClusterSizeSummary = nullptr; + std::unique_ptr mGroupedClusterSizeSummary = nullptr; + std::unique_ptr mClusterOccupancySummary = nullptr; - std::unique_ptr mClusterPatternSensorIndices = nullptr; - std::vector> mClusterChipOccupancyMap; + std::unique_ptr mClusterPatternSensorIndices = nullptr; + std::vector> mClusterChipOccupancyMap; - std::unique_ptr mClusterZ = nullptr; - std::vector> mClusterXYinLayer; - std::vector> mClusterRinLayer; + std::unique_ptr mClusterZ = nullptr; + std::vector> mClusterXYinLayer; + std::vector> mClusterRinLayer; - std::unique_ptr mClustersROFSize = nullptr; - std::unique_ptr mClustersBC = nullptr; + std::unique_ptr mClustersROFSize = nullptr; + std::unique_ptr mClustersBC = nullptr; std::vector> mClustersGlobal; + int mOnlineQC; + // needed to construct the name and path of some histograms int mHalf[936] = { 0 }; int mDisk[936] = { 0 }; diff --git a/Modules/MFT/include/MFT/QcMFTDigitTask.h b/Modules/MFT/include/MFT/QcMFTDigitTask.h index 5677d6044f..a2b794b44c 100644 --- a/Modules/MFT/include/MFT/QcMFTDigitTask.h +++ b/Modules/MFT/include/MFT/QcMFTDigitTask.h @@ -15,6 +15,7 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund /// #ifndef QC_MFT_DIGIT_TASK_H @@ -29,8 +30,11 @@ #include // Quality Control #include "QualityControl/TaskInterface.h" +#include "Common/TH1Ratio.h" +#include "Common/TH2Ratio.h" using namespace o2::quality_control::core; +using namespace o2::quality_control_modules::common; namespace o2::quality_control_modules::mft { @@ -90,15 +94,15 @@ class QcMFTDigitTask final : public TaskInterface float mY[936] = { 0 }; std::unique_ptr mMergerTest = nullptr; - std::unique_ptr mDigitChipOccupancy = nullptr; + std::unique_ptr mDigitChipOccupancy = nullptr; std::unique_ptr mDigitChipStdDev = nullptr; - std::unique_ptr mDigitOccupancySummary = nullptr; - std::unique_ptr mDigitDoubleColumnSensorIndices = nullptr; + std::unique_ptr mDigitOccupancySummary = nullptr; + std::unique_ptr mDigitDoubleColumnSensorIndices = nullptr; - std::unique_ptr mDigitsROFSize = nullptr; - std::unique_ptr mDigitsBC = nullptr; + std::unique_ptr mDigitsROFSize = nullptr; + std::unique_ptr mDigitsBC = nullptr; - std::vector> mDigitChipOccupancyMap; + std::vector> mDigitChipOccupancyMap; std::vector> mDigitPixelOccupancyMap; // reference orbit used in relative time calculation diff --git a/Modules/MFT/include/MFT/QcMFTTrackTask.h b/Modules/MFT/include/MFT/QcMFTTrackTask.h index d38fe67b7b..246d526b5d 100644 --- a/Modules/MFT/include/MFT/QcMFTTrackTask.h +++ b/Modules/MFT/include/MFT/QcMFTTrackTask.h @@ -16,6 +16,7 @@ /// \author Diana Maria Krupova /// \author Katarina Krizkova Gajdosova /// \author David Grund +/// #ifndef QC_MFT_TRACK_TASK_H #define QC_MFT_TRACK_TASK_H @@ -71,10 +72,10 @@ class QcMFTTrackTask /*final*/ : public TaskInterface // todo add back the "fina std::unique_ptr mPositiveTrackPhi = nullptr; std::unique_ptr mNegativeTrackPhi = nullptr; std::unique_ptr mTrackEta = nullptr; - std::array, 7> mTrackEtaNCls = { nullptr }; - std::array, 7> mTrackPhiNCls = { nullptr }; - std::array, 7> mTrackXYNCls = { nullptr }; - std::array, 7> mTrackEtaPhiNCls = { nullptr }; + std::array, 6> mTrackEtaNCls = { nullptr }; + std::array, 6> mTrackPhiNCls = { nullptr }; + std::array, 6> mTrackXYNCls = { nullptr }; + std::array, 6> mTrackEtaPhiNCls = { nullptr }; std::unique_ptr mCATrackEta = nullptr; std::unique_ptr mLTFTrackEta = nullptr; std::unique_ptr mCATrackPt = nullptr; @@ -85,7 +86,7 @@ class QcMFTTrackTask /*final*/ : public TaskInterface // todo add back the "fina std::unique_ptr mAssociatedClusterFraction = nullptr; std::unique_ptr mClusterRatioVsBunchCrossing = nullptr; - static constexpr array sMinNClustersList = { 4, 5, 6, 7, 8, 9, 10 }; + static constexpr array sMinNClustersList = { 5, 6, 7, 8, 9, 10 }; }; } // namespace o2::quality_control_modules::mft diff --git a/Modules/MFT/mft-clusters.json b/Modules/MFT/mft-clusters.json index a9b9da6f53..a92afd9b5f 100644 --- a/Modules/MFT/mft-clusters.json +++ b/Modules/MFT/mft-clusters.json @@ -19,7 +19,7 @@ "url" : "" }, "conditionDB" : { - "url" : "ccdb-test.cern.ch:8080" + "url" : "http://alice-ccdb.cern.ch" } }, "tasks" : { @@ -36,11 +36,22 @@ }, "taskParameters" : { "myOwnKey" : "myOwnValue", + "onlineQC" : "1", "maxClusterROFSize" : "5000", "maxDuration" : "60000", "timeBinSize" : "0.1", "ROFLengthInBC" : "198" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location" : "remote" } }, diff --git a/Modules/MFT/mft-digits.json b/Modules/MFT/mft-digits.json index bb5ab0fe09..8b1a03598a 100644 --- a/Modules/MFT/mft-digits.json +++ b/Modules/MFT/mft-digits.json @@ -19,7 +19,7 @@ "url" : "" }, "conditionDB" : { - "url" : "ccdb-test.cern.ch:8080" + "url" : "http://alice-ccdb.cern.ch" } }, "tasks" : { @@ -42,6 +42,16 @@ "timeBinSize" : "0.1", "ROFLengthInBC" : "198" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location" : "remote" } }, diff --git a/Modules/MFT/mft-tracks.json b/Modules/MFT/mft-tracks.json index 24d0a42f2c..701a7436ae 100644 --- a/Modules/MFT/mft-tracks.json +++ b/Modules/MFT/mft-tracks.json @@ -19,7 +19,7 @@ "url" : "" }, "conditionDB" : { - "url" : "ccdb-test.cern.ch:8080" + "url" : "http://alice-ccdb.cern.ch" } }, "tasks" : { diff --git a/Modules/MFT/src/QcMFTClusterCheck.cxx b/Modules/MFT/src/QcMFTClusterCheck.cxx index a4129ddd1e..efcb3b4a90 100644 --- a/Modules/MFT/src/QcMFTClusterCheck.cxx +++ b/Modules/MFT/src/QcMFTClusterCheck.cxx @@ -15,6 +15,8 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund +/// // C++ #include @@ -79,15 +81,10 @@ Quality QcMFTClusterCheck::check(std::mapGetBinContent(0); // normalisation stored in the uderflow bin - for (int iBin = 0; iBin < hClusterOccupancy->GetNbinsX(); iBin++) { if (hClusterOccupancy->GetBinContent(iBin + 1) == 0) { hClusterOccupancy->Fill(937); // number of chips with zero clusters stored in the overflow bin } - float num = hClusterOccupancy->GetBinContent(iBin + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hClusterOccupancy->SetBinContent(iBin + 1, ratio); } } @@ -97,14 +94,6 @@ Quality QcMFTClusterCheck::check(std::mapGetBinContent(0); // normalisation stored in the uderflow bin - - for (int iBin = 0; iBin < hClusterPatternIndex->GetNbinsX(); iBin++) { - float num = hClusterPatternIndex->GetBinContent(iBin + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hClusterPatternIndex->SetBinContent(iBin + 1, ratio); - } } if (mo->getName() == "mClusterSizeSummary") { @@ -113,14 +102,6 @@ Quality QcMFTClusterCheck::check(std::mapGetBinContent(0); // normalisation stored in the uderflow bin - - for (int iBin = 0; iBin < hClusterSizeSummary->GetNbinsX(); iBin++) { - float num = hClusterSizeSummary->GetBinContent(iBin + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hClusterSizeSummary->SetBinContent(iBin + 1, ratio); - } } if (mo->getName() == "mGroupedClusterSizeSummary") { @@ -129,14 +110,6 @@ Quality QcMFTClusterCheck::check(std::mapGetBinContent(0); // normalisation stored in the uderflow bin - - for (int iBin = 0; iBin < hGroupedClusterSizeSummary->GetNbinsX(); iBin++) { - float num = hGroupedClusterSizeSummary->GetBinContent(iBin + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hGroupedClusterSizeSummary->SetBinContent(iBin + 1, ratio); - } } if (mo->getName() == "mClusterOccupancySummary") { @@ -146,14 +119,10 @@ Quality QcMFTClusterCheck::check(std::mapGetBinContent(0, 0); // normalisation stored in the uderflow bin - float nEmptyBins = 0; // number of empty zones stored here + float nEmptyBins = 0; // number of empty zones for (int iBinX = 0; iBinX < hClusterOccupancySummary->GetNbinsX(); iBinX++) { for (int iBinY = 0; iBinY < hClusterOccupancySummary->GetNbinsY(); iBinY++) { - float num = hClusterOccupancySummary->GetBinContent(iBinX + 1, iBinY + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hClusterOccupancySummary->SetBinContent(iBinX + 1, iBinY + 1, ratio); if ((hClusterOccupancySummary->GetBinContent(iBinX + 1, iBinY + 1)) == 0) { nEmptyBins = nEmptyBins + 1; } diff --git a/Modules/MFT/src/QcMFTClusterTask.cxx b/Modules/MFT/src/QcMFTClusterTask.cxx index bf4adb1d61..3d1a4323f4 100644 --- a/Modules/MFT/src/QcMFTClusterTask.cxx +++ b/Modules/MFT/src/QcMFTClusterTask.cxx @@ -15,7 +15,9 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund /// + // C++ #include #include @@ -45,6 +47,9 @@ #include "MFT/QcMFTUtilTables.h" #include "QualityControl/ObjectsManager.h" #include "QualityControl/TaskInterface.h" +#include "Common/TH1Ratio.h" +#include "Common/TH2Ratio.h" +#include "DetectorsBase/GRPGeomHelper.h" using namespace o2::mft; o2::itsmft::ChipMappingMFT mMFTMapper; @@ -69,6 +74,12 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/) ILOG(Debug, Devel) << "initialize QcMFTClusterTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. // loading custom parameters + mOnlineQC = 1; + if (auto param = mCustomParameters.find("onlineQC"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - onlineQC: " << param->second << ENDM; + mOnlineQC = stoi(param->second); + } + auto maxClusterROFSize = 5000; if (auto param = mCustomParameters.find("maxClusterROFSize"); param != mCustomParameters.end()) { ILOG(Debug, Devel) << "Custom parameter - maxClusterROFSize: " << param->second << ENDM; @@ -96,7 +107,8 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/) getChipMapData(); // define histograms - mClusterLayerIndexH0 = std::make_unique("mClusterLayerIndexH0", "Clusters per layer in H0;Layer;Entries", 10, -0.5, 9.5); + mClusterLayerIndexH0 = std::make_unique( + "mClusterLayerIndexH0", "Clusters per layer in H0;Layer;# entries per orbit", 10, -0.5, 9.5, true); mClusterLayerIndexH0->GetXaxis()->SetBinLabel(1, "d0-f0"); mClusterLayerIndexH0->GetXaxis()->SetBinLabel(2, "d0-f1"); mClusterLayerIndexH0->GetXaxis()->SetBinLabel(3, "d1-f0"); @@ -109,8 +121,10 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/) mClusterLayerIndexH0->GetXaxis()->SetBinLabel(10, "d4-f1"); mClusterLayerIndexH0->SetStats(0); getObjectsManager()->startPublishing(mClusterLayerIndexH0.get()); + getObjectsManager()->setDisplayHint(mClusterLayerIndexH0.get(), "hist"); - mClusterLayerIndexH1 = std::make_unique("mClusterLayerIndexH1", "Clusters per layer in H1;Layer;Entries", 10, -0.5, 9.5); + mClusterLayerIndexH1 = std::make_unique( + "mClusterLayerIndexH1", "Clusters per layer in H1;Layer;# entries per orbit", 10, -0.5, 9.5, true); mClusterLayerIndexH1->GetXaxis()->SetBinLabel(1, "d0-f0"); mClusterLayerIndexH1->GetXaxis()->SetBinLabel(2, "d0-f1"); mClusterLayerIndexH1->GetXaxis()->SetBinLabel(3, "d1-f0"); @@ -123,35 +137,34 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/) mClusterLayerIndexH1->GetXaxis()->SetBinLabel(10, "d4-f1"); mClusterLayerIndexH1->SetStats(0); getObjectsManager()->startPublishing(mClusterLayerIndexH1.get()); + getObjectsManager()->setDisplayHint(mClusterLayerIndexH1.get(), "hist"); - mClusterOccupancy = std::make_unique("mClusterOccupancy", "Chip Cluster Occupancy;Chip ID;#Entries per TF", 936, -0.5, 935.5); + mClusterOccupancy = std::make_unique( + "mClusterOccupancy", "Chip Cluster Occupancy;Chip ID;# entries per orbit", 936, -0.5, 935.5, true); mClusterOccupancy->SetStats(0); getObjectsManager()->startPublishing(mClusterOccupancy.get()); + getObjectsManager()->setDisplayHint(mClusterOccupancy.get(), "hist"); - mClusterPatternIndex = std::make_unique("mClusterPatternIndex", "Cluster Pattern ID;Pattern ID;#Entries per TF", 500, -0.5, 499.5); + mClusterPatternIndex = std::make_unique( + "mClusterPatternIndex", "Cluster Pattern ID;Pattern ID;# entries per orbit", 500, -0.5, 499.5, true); mClusterPatternIndex->SetStats(0); getObjectsManager()->startPublishing(mClusterPatternIndex.get()); - getObjectsManager()->setDisplayHint(mClusterPatternIndex.get(), "logy"); + getObjectsManager()->setDisplayHint(mClusterPatternIndex.get(), "hist logy"); - mClusterSizeSummary = std::make_unique("mClusterSizeSummary", "Cluster Size Summary; Cluster Size (pixels);#Entries", 100, 0.5, 100.5); + mClusterSizeSummary = std::make_unique( + "mClusterSizeSummary", "Cluster Size Summary; Cluster Size (pixels);# entries per orbit", 100, 0.5, 100.5, true); mClusterSizeSummary->SetStats(0); getObjectsManager()->startPublishing(mClusterSizeSummary.get()); - getObjectsManager()->setDisplayHint(mClusterSizeSummary.get(), "logy"); + getObjectsManager()->setDisplayHint(mClusterSizeSummary.get(), "hist logy"); - mGroupedClusterSizeSummary = std::make_unique("mGroupedClusterSizeSummary", "Grouped Cluster Size Summary; Grouped Cluster Size (pixels);#Entries", 100, 0.5, 100.5); + mGroupedClusterSizeSummary = std::make_unique( + "mGroupedClusterSizeSummary", "Grouped Cluster Size Summary; Grouped Cluster Size (pixels);# entries per orbit", 100, 0.5, 100.5, true); mGroupedClusterSizeSummary->SetStats(0); getObjectsManager()->startPublishing(mGroupedClusterSizeSummary.get()); - getObjectsManager()->setDisplayHint(mGroupedClusterSizeSummary.get(), "logy"); + getObjectsManager()->setDisplayHint(mGroupedClusterSizeSummary.get(), "hist logy"); - mClusterPatternSensorIndices = std::make_unique("mClusterPatternSensorIndices", - "Cluster Pattern ID vs Chip ID;Chip ID;Pattern ID", - 936, -0.5, 935.5, 500, -0.5, 499.5); - mClusterPatternSensorIndices->SetStats(0); - getObjectsManager()->startPublishing(mClusterPatternSensorIndices.get()); - getObjectsManager()->setDefaultDrawOptions(mClusterPatternSensorIndices.get(), "colz"); - - mClusterOccupancySummary = std::make_unique("mClusterOccupancySummary", "Cluster Occupancy Summary;;", - 10, -0.5, 9.5, 8, -0.5, 7.5); + mClusterOccupancySummary = std::make_unique("mClusterOccupancySummary", + "Cluster Occupancy Summary;;", 10, -0.5, 9.5, 8, -0.5, 7.5, true); mClusterOccupancySummary->GetXaxis()->SetBinLabel(1, "d0-f0"); mClusterOccupancySummary->GetXaxis()->SetBinLabel(2, "d0-f1"); mClusterOccupancySummary->GetXaxis()->SetBinLabel(3, "d1-f0"); @@ -174,56 +187,72 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mClusterOccupancySummary.get()); getObjectsManager()->setDefaultDrawOptions(mClusterOccupancySummary.get(), "colz"); - mClusterZ = std::make_unique("mClusterZ", "Z position of clusters; Z (cm); # entries", 400, -80, -40); + mClusterZ = std::make_unique( + "mClusterZ", "Z position of clusters; Z (cm); # entries per orbit", 400, -80, -40, true); mClusterZ->SetStats(0); getObjectsManager()->startPublishing(mClusterZ.get()); + getObjectsManager()->setDisplayHint(mClusterZ.get(), "hist"); - mClustersROFSize = std::make_unique("mClustersROFSize", "Distribution of the #clusters per ROF; # clusters per ROF; # entries", maxClusterROFSize, 0, maxClusterROFSize); + mClustersROFSize = std::make_unique( + "mClustersROFSize", "Distribution of the #clusters per ROF; # clusters per ROF; # entries per orbit", maxClusterROFSize, 0, maxClusterROFSize, true); mClustersROFSize->SetStats(0); getObjectsManager()->startPublishing(mClustersROFSize.get()); - getObjectsManager()->setDisplayHint(mClustersROFSize.get(), "logx logy"); + getObjectsManager()->setDisplayHint(mClustersROFSize.get(), "hist logx logy"); - mClustersBC = std::make_unique("mClustersBC", "Clusters per BC; BCid; # entries", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches); + mClustersBC = std::make_unique( + "mClustersBC", "Clusters per BC; BCid; # entries per orbit", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches, true); mClustersBC->SetMinimum(0.1); getObjectsManager()->startPublishing(mClustersBC.get()); getObjectsManager()->setDisplayHint(mClustersBC.get(), "hist"); - // define chip occupancy maps - QcMFTUtilTables MFTTable; - for (int iHalf = 0; iHalf < 2; iHalf++) { - for (int iDisk = 0; iDisk < 5; iDisk++) { - for (int iFace = 0; iFace < 2; iFace++) { - int idx = (iDisk * 2 + iFace) + (10 * iHalf); - auto chipmap = std::make_unique( - Form("ChipOccupancyMaps/Half_%d/Disk_%d/Face_%d/mClusterChipOccupancyMap", iHalf, iDisk, iFace), - Form("Cluster Chip Map h%d-d%d-f%d;x (cm);y (cm)", iHalf, iDisk, iFace), - MFTTable.mNumberOfBinsInOccupancyMaps[idx][0], - MFTTable.mNumberOfBinsInOccupancyMaps[idx][1], - MFTTable.mNumberOfBinsInOccupancyMaps[idx][2], - MFTTable.mNumberOfBinsInOccupancyMaps[idx][3], - MFTTable.mNumberOfBinsInOccupancyMaps[idx][4], - MFTTable.mNumberOfBinsInOccupancyMaps[idx][5]); - chipmap->SetStats(0); - mClusterChipOccupancyMap.push_back(std::move(chipmap)); - getObjectsManager()->startPublishing(mClusterChipOccupancyMap[idx].get()); - getObjectsManager()->setDefaultDrawOptions(mClusterChipOccupancyMap[idx].get(), "colz"); - } // loop over faces - } // loop over disks - } // loop over halfs - - for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { - auto clusterXY = std::make_unique( - Form("ClusterXYinLayer/mClusterXYinLayer%d", nMFTLayer), - Form("Cluster Position in Layer %d; x (cm); y (cm)", nMFTLayer), 400, -20, 20, 400, -20, 20); - clusterXY->SetStats(0); - mClusterXYinLayer.push_back(std::move(clusterXY)); - getObjectsManager()->startPublishing(mClusterXYinLayer[nMFTLayer].get()); - getObjectsManager()->setDefaultDrawOptions(mClusterXYinLayer[nMFTLayer].get(), "colz"); - - auto clusterR = std::make_unique(Form("ClusterRinLayer/mClusterRinLayer%d", nMFTLayer), Form("Cluster Radial Position in Layer %d; r (cm); # entries", nMFTLayer), 400, 0, 20); - mClusterRinLayer.push_back(std::move(clusterR)); - getObjectsManager()->startPublishing(mClusterRinLayer[nMFTLayer].get()); - getObjectsManager()->setDisplayHint(mClusterRinLayer[nMFTLayer].get(), "hist"); + // only for online QC (disabled in A-QC) + if (mOnlineQC == 1) { + mClusterPatternSensorIndices = std::make_unique( + "mClusterPatternSensorIndices", "Cluster Pattern ID vs Chip ID;Chip ID;Pattern ID", 936, -0.5, 935.5, 500, -0.5, 499.5, true); + mClusterPatternSensorIndices->SetStats(0); + getObjectsManager()->startPublishing(mClusterPatternSensorIndices.get()); + getObjectsManager()->setDefaultDrawOptions(mClusterPatternSensorIndices.get(), "colz"); + + // define chip occupancy maps + QcMFTUtilTables MFTTable; + for (int iHalf = 0; iHalf < 2; iHalf++) { + for (int iDisk = 0; iDisk < 5; iDisk++) { + for (int iFace = 0; iFace < 2; iFace++) { + int idx = (iDisk * 2 + iFace) + (10 * iHalf); + auto chipmap = std::make_unique( + Form("ChipOccupancyMaps/Half_%d/Disk_%d/Face_%d/mClusterChipOccupancyMap", iHalf, iDisk, iFace), + Form("Cluster Chip Map h%d-d%d-f%d;x (cm);y (cm)", iHalf, iDisk, iFace), + MFTTable.mNumberOfBinsInOccupancyMaps[idx][0], + MFTTable.mNumberOfBinsInOccupancyMaps[idx][1], + MFTTable.mNumberOfBinsInOccupancyMaps[idx][2], + MFTTable.mNumberOfBinsInOccupancyMaps[idx][3], + MFTTable.mNumberOfBinsInOccupancyMaps[idx][4], + MFTTable.mNumberOfBinsInOccupancyMaps[idx][5], true); + chipmap->SetStats(0); + mClusterChipOccupancyMap.push_back(std::move(chipmap)); + getObjectsManager()->startPublishing(mClusterChipOccupancyMap[idx].get()); + getObjectsManager()->setDefaultDrawOptions(mClusterChipOccupancyMap[idx].get(), "colz"); + } // loop over faces + } // loop over disks + } // loop over halfs + + // layer histograms + for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { + auto clusterXY = std::make_unique( + Form("ClusterXYinLayer/mClusterXYinLayer%d", nMFTLayer), + Form("Cluster Position in Layer %d; x (cm); y (cm)", nMFTLayer), 400, -20, 20, 400, -20, 20, true); + clusterXY->SetStats(0); + mClusterXYinLayer.push_back(std::move(clusterXY)); + getObjectsManager()->startPublishing(mClusterXYinLayer[nMFTLayer].get()); + getObjectsManager()->setDefaultDrawOptions(mClusterXYinLayer[nMFTLayer].get(), "colz"); + + auto clusterR = std::make_unique( + Form("ClusterRinLayer/mClusterRinLayer%d", nMFTLayer), + Form("Cluster Radial Position in Layer %d; r (cm); # entries", nMFTLayer), 400, 0, 20, true); + mClusterRinLayer.push_back(std::move(clusterR)); + getObjectsManager()->startPublishing(mClusterRinLayer[nMFTLayer].get()); + getObjectsManager()->setDisplayHint(mClusterRinLayer[nMFTLayer].get(), "hist"); + } } } @@ -242,6 +271,8 @@ void QcMFTClusterTask::startOfCycle() void QcMFTClusterTask::monitorData(o2::framework::ProcessingContext& ctx) { + auto mNOrbitsPerTF = o2::base::GRPGeomHelper::instance().getNHBFPerTF(); + if (mDict == nullptr) { ILOG(Info, Support) << "Getting dictionary from ccdb" << ENDM; auto mDictPtr = ctx.inputs().get("cldict"); @@ -253,12 +284,6 @@ void QcMFTClusterTask::monitorData(o2::framework::ProcessingContext& ctx) mGeom = o2::mft::GeometryTGeo::Instance(); ILOG(Info, Support) << "GeometryTGeo loaded" << ENDM; } - // normalisation for the summary histogram to TF - mClusterOccupancySummary->Fill(-1, -1); - mClusterOccupancy->Fill(-1); - mClusterPatternIndex->Fill(-1); - mClusterSizeSummary->Fill(-1); - mGroupedClusterSizeSummary->Fill(-1); // get the clusters const auto clusters = ctx.inputs().get>("randomcluster"); @@ -287,50 +312,97 @@ void QcMFTClusterTask::monitorData(o2::framework::ProcessingContext& ctx) // fill the clusters time histograms for (const auto& rof : clustersROFs) { - mClustersROFSize->Fill(rof.getNEntries()); - mClustersBC->Fill(rof.getBCData().bc, rof.getNEntries()); + mClustersROFSize->getNum()->Fill(rof.getNEntries()); + mClustersBC->getNum()->Fill(rof.getBCData().bc, rof.getNEntries()); } // fill all other histograms for (auto& oneCluster : clusters) { int sensorID = oneCluster.getSensorID(); int layerID = mMFTMapper.chip2Layer(sensorID); // used instead of previous layerID = mDisk[sensorID] * 2 + mFace[sensorID] - (mHalf[sensorID] == 0) ? mClusterLayerIndexH0->Fill(layerID) - : mClusterLayerIndexH1->Fill(layerID); - mClusterOccupancy->Fill(sensorID); - mClusterPatternIndex->Fill(oneCluster.getPatternID()); - mClusterPatternSensorIndices->Fill(sensorID, - oneCluster.getPatternID()); + (mHalf[sensorID] == 0) ? mClusterLayerIndexH0->getNum()->Fill(layerID) + : mClusterLayerIndexH1->getNum()->Fill(layerID); + mClusterOccupancy->getNum()->Fill(sensorID); + mClusterPatternIndex->getNum()->Fill(oneCluster.getPatternID()); + if (mOnlineQC == 1) + mClusterPatternSensorIndices->getNum()->Fill(sensorID, oneCluster.getPatternID()); if (oneCluster.getPatternID() != o2::itsmft::CompCluster::InvalidPatternID && !mDict->isGroup(oneCluster.getPatternID())) { - mClusterSizeSummary->Fill(mDict->getNpixels(oneCluster.getPatternID())); + mClusterSizeSummary->getNum()->Fill(mDict->getNpixels(oneCluster.getPatternID())); } else { o2::itsmft::ClusterPattern patt(patternIt); - mGroupedClusterSizeSummary->Fill(patt.getNPixels()); + mGroupedClusterSizeSummary->getNum()->Fill(patt.getNPixels()); } // fill occupancy maps int idx = layerID + (10 * mHalf[sensorID]); - mClusterChipOccupancyMap[idx]->Fill(mX[sensorID], mY[sensorID]); + if (mOnlineQC == 1) + mClusterChipOccupancyMap[idx]->getNum()->Fill(mX[sensorID], mY[sensorID]); // fill info into the summary histo int xBin = mDisk[sensorID] * 2 + mFace[sensorID]; int yBin = mZone[sensorID] + mHalf[sensorID] * 4; - mClusterOccupancySummary->Fill(xBin, yBin); + mClusterOccupancySummary->getNum()->Fill(xBin, yBin); } // fill the histograms that use global position of cluster for (auto& oneGlobalCluster : mClustersGlobal) { - mClusterZ->Fill(oneGlobalCluster.getZ()); + mClusterZ->getNum()->Fill(oneGlobalCluster.getZ()); int layerID = mMFTMapper.chip2Layer(oneGlobalCluster.getSensorID()); - mClusterXYinLayer[layerID]->Fill(oneGlobalCluster.getX(), oneGlobalCluster.getY()); - mClusterRinLayer[layerID]->Fill(std::sqrt(std::pow(oneGlobalCluster.getX(), 2) + std::pow(oneGlobalCluster.getY(), 2))); + if (mOnlineQC == 1) { + mClusterXYinLayer[layerID]->getNum()->Fill(oneGlobalCluster.getX(), oneGlobalCluster.getY()); + mClusterRinLayer[layerID]->getNum()->Fill(std::sqrt(std::pow(oneGlobalCluster.getX(), 2) + std::pow(oneGlobalCluster.getY(), 2))); + } + } + + // fill the denominators + mClusterLayerIndexH0->getDen()->SetBinContent(1, mClusterLayerIndexH0->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClusterLayerIndexH1->getDen()->SetBinContent(1, mClusterLayerIndexH1->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClusterOccupancy->getDen()->SetBinContent(1, mClusterOccupancy->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClusterPatternIndex->getDen()->SetBinContent(1, mClusterPatternIndex->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClusterSizeSummary->getDen()->SetBinContent(1, mClusterSizeSummary->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mGroupedClusterSizeSummary->getDen()->SetBinContent(1, mGroupedClusterSizeSummary->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClusterOccupancySummary->getDen()->SetBinContent(1, 1, mClusterOccupancySummary->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + mClusterZ->getDen()->SetBinContent(1, mClusterZ->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClustersROFSize->getDen()->SetBinContent(1, mClustersROFSize->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mClustersBC->getDen()->SetBinContent(1, mClustersBC->getDen()->GetBinContent(1) + mNOrbitsPerTF); + if (mOnlineQC == 1) { + mClusterPatternSensorIndices->getDen()->SetBinContent(1, 1, mClusterPatternSensorIndices->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + for (int i = 0; i < 20; i++) + mClusterChipOccupancyMap[i]->getDen()->SetBinContent(1, 1, mClusterChipOccupancyMap[i]->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + // layer histograms + for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { // there are 10 layers + mClusterXYinLayer[nMFTLayer]->getDen()->SetBinContent(1, 1, mClusterXYinLayer[nMFTLayer]->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + mClusterRinLayer[nMFTLayer]->getDen()->SetBinContent(1, mClusterRinLayer[nMFTLayer]->getDen()->GetBinContent(1) + mNOrbitsPerTF); + } } } void QcMFTClusterTask::endOfCycle() { + // update all THRatios ILOG(Debug, Devel) << "endOfCycle" << ENDM; + + mClusterLayerIndexH0->update(); + mClusterLayerIndexH1->update(); + mClusterOccupancy->update(); + mClusterPatternIndex->update(); + mClusterSizeSummary->update(); + mGroupedClusterSizeSummary->update(); + mClusterOccupancySummary->update(); + mClusterZ->update(); + mClustersROFSize->update(); + mClustersBC->update(); + if (mOnlineQC == 1) { + mClusterPatternSensorIndices->update(); + for (int i = 0; i < 20; i++) + mClusterChipOccupancyMap[i]->update(); + // layer histograms + for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { // there are 10 layers + mClusterXYinLayer[nMFTLayer]->update(); + mClusterRinLayer[nMFTLayer]->update(); + } + } } void QcMFTClusterTask::endOfActivity(const Activity& /*activity*/) @@ -343,24 +415,25 @@ void QcMFTClusterTask::reset() // clean all the monitor objects here ILOG(Debug, Devel) << "Resetting the histograms" << ENDM; + mClusterLayerIndexH0->Reset(); + mClusterLayerIndexH1->Reset(); mClusterOccupancy->Reset(); mClusterPatternIndex->Reset(); - mClusterPatternSensorIndices->Reset(); mClusterSizeSummary->Reset(); mGroupedClusterSizeSummary->Reset(); - mClusterLayerIndexH0->Reset(); - mClusterLayerIndexH1->Reset(); mClusterOccupancySummary->Reset(); mClusterZ->Reset(); mClustersROFSize->Reset(); mClustersBC->Reset(); - for (int i = 0; i < 20; i++) { - mClusterChipOccupancyMap[i]->Reset(); - } - // layer histograms - for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { // there are 10 layers - mClusterXYinLayer[nMFTLayer]->Reset(); - mClusterRinLayer[nMFTLayer]->Reset(); + if (mOnlineQC == 1) { + mClusterPatternSensorIndices->Reset(); + for (int i = 0; i < 20; i++) + mClusterChipOccupancyMap[i]->Reset(); + // layer histograms + for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) { // there are 10 layers + mClusterXYinLayer[nMFTLayer]->Reset(); + mClusterRinLayer[nMFTLayer]->Reset(); + } } } diff --git a/Modules/MFT/src/QcMFTDigitCheck.cxx b/Modules/MFT/src/QcMFTDigitCheck.cxx index acdd43fc06..1b95996966 100644 --- a/Modules/MFT/src/QcMFTDigitCheck.cxx +++ b/Modules/MFT/src/QcMFTDigitCheck.cxx @@ -15,6 +15,8 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund +/// // C++ #include @@ -77,15 +79,10 @@ Quality QcMFTDigitCheck::check(std::mapGetBinContent(0); // normalisation stored in the uderflow bin - for (int iBin = 0; iBin < hDigitChipOccupancy->GetNbinsX(); iBin++) { if (hDigitChipOccupancy->GetBinContent(iBin + 1) == 0) { hDigitChipOccupancy->Fill(937); // number of chips with zero digits stored in the overflow bin } - float num = hDigitChipOccupancy->GetBinContent(iBin + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hDigitChipOccupancy->SetBinContent(iBin + 1, ratio); } } @@ -96,14 +93,10 @@ Quality QcMFTDigitCheck::check(std::mapGetBinContent(0, 0); // normalisation stored in the uderflow bin - float nEmptyBins = 0; // number of empty zones stored here + float nEmptyBins = 0; // number of empty zones for (int iBinX = 0; iBinX < hDigitOccupancySummary->GetNbinsX(); iBinX++) { for (int iBinY = 0; iBinY < hDigitOccupancySummary->GetNbinsY(); iBinY++) { - float num = hDigitOccupancySummary->GetBinContent(iBinX + 1, iBinY + 1); - float ratio = (den > 0) ? (num / den) : 0.0; - hDigitOccupancySummary->SetBinContent(iBinX + 1, iBinY + 1, ratio); if ((hDigitOccupancySummary->GetBinContent(iBinX + 1, iBinY + 1)) == 0) { nEmptyBins = nEmptyBins + 1; } diff --git a/Modules/MFT/src/QcMFTDigitTask.cxx b/Modules/MFT/src/QcMFTDigitTask.cxx index 953b1031bc..c61a6352f7 100644 --- a/Modules/MFT/src/QcMFTDigitTask.cxx +++ b/Modules/MFT/src/QcMFTDigitTask.cxx @@ -15,7 +15,9 @@ /// \author Guillermo Contreras /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova +/// \author David Grund /// + // C++ #include #include @@ -39,6 +41,9 @@ #include "QualityControl/QcInfoLogger.h" #include "MFT/QcMFTDigitTask.h" #include "MFT/QcMFTUtilTables.h" +#include "Common/TH1Ratio.h" +#include "Common/TH2Ratio.h" +#include "DetectorsBase/GRPGeomHelper.h" namespace o2::quality_control_modules::mft { @@ -98,8 +103,9 @@ void QcMFTDigitTask::initialize(o2::framework::InitContext& /*ctx*/) resetArrays(mVectorIndexOfChips, mOccupancyMapIndexOfChips, mVectorIndexOfOccupancyMaps); // Defining histograms - //============================================== - mMergerTest = std::make_unique("mMergerTest", "Merger testing from different FLPs;FLP ID;#Entries", 5, -0.5, 4.5); + + mMergerTest = std::make_unique( + "mMergerTest", "Merger testing from different FLPs;FLP ID;# entries", 5, -0.5, 4.5); mMergerTest->SetStats(0); mMergerTest->GetXaxis()->SetBinLabel(1, "FLP 182"); mMergerTest->GetXaxis()->SetBinLabel(2, "FLP 183"); @@ -108,34 +114,28 @@ void QcMFTDigitTask::initialize(o2::framework::InitContext& /*ctx*/) mMergerTest->GetXaxis()->SetBinLabel(5, "FLP 186"); getObjectsManager()->startPublishing(mMergerTest.get()); - mDigitChipOccupancy = std::make_unique( - "mDigitChipOccupancy", - "Digit Chip Occupancy;Chip ID;#Entries per ROF", - 936, -0.5, 935.5); + mDigitChipOccupancy = std::make_unique( + "mDigitChipOccupancy", "Digit Chip Occupancy;Chip ID;# entries per orbit", 936, -0.5, 935.5, true); mDigitChipOccupancy->SetStats(0); getObjectsManager()->startPublishing(mDigitChipOccupancy.get()); getObjectsManager()->setDisplayHint(mDigitChipOccupancy.get(), "hist"); - mDigitDoubleColumnSensorIndices = std::make_unique("mDigitDoubleColumnSensorIndices", - "Double Column vs Chip ID;Double Column;Chip ID", - 512, -0.5, 511.5, 936, -0.5, 935.5); + mDigitDoubleColumnSensorIndices = std::make_unique( + "mDigitDoubleColumnSensorIndices", "Double Column vs Chip ID;Double Column;Chip ID", + 512, -0.5, 511.5, 936, -0.5, 935.5, true); mDigitDoubleColumnSensorIndices->SetStats(0); getObjectsManager()->startPublishing(mDigitDoubleColumnSensorIndices.get()); getObjectsManager()->setDisplayHint(mDigitDoubleColumnSensorIndices.get(), "colz"); if (mNoiseScan == 1) { // to be executed only for special runs mDigitChipStdDev = std::make_unique( - "mDigitChipStdDev", - "Digit Chip Std Dev;Chip ID;Chip std dev", - 936, -0.5, 935.5); + "mDigitChipStdDev", "Digit Chip Std Dev;Chip ID;Chip std dev", 936, -0.5, 935.5); mDigitChipStdDev->SetStats(0); getObjectsManager()->startPublishing(mDigitChipStdDev.get()); } - mDigitOccupancySummary = std::make_unique( - "mDigitOccupancySummary", - "Digit Occupancy Summary;;", - 10, -0.5, 9.5, 8, -0.5, 7.5); + mDigitOccupancySummary = std::make_unique( + "mDigitOccupancySummary", "Digit Occupancy Summary;;", 10, -0.5, 9.5, 8, -0.5, 7.5, true); mDigitOccupancySummary->GetXaxis()->SetBinLabel(1, "d0-f0"); mDigitOccupancySummary->GetXaxis()->SetBinLabel(2, "d0-f1"); mDigitOccupancySummary->GetXaxis()->SetBinLabel(3, "d1-f0"); @@ -158,18 +158,22 @@ void QcMFTDigitTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mDigitOccupancySummary.get()); getObjectsManager()->setDisplayHint(mDigitOccupancySummary.get(), "colz"); - mDigitsROFSize = std::make_unique("mDigitsROFSize", "Distribution of the #digits per ROF; # digits per ROF; # entries", maxDigitROFSize, 0, maxDigitROFSize); + mDigitsROFSize = std::make_unique("mDigitsROFSize", + "Distribution of the #digits per ROF; # digits per ROF; # entries per orbit", + maxDigitROFSize, 0, maxDigitROFSize, true); mDigitsROFSize->SetStats(0); getObjectsManager()->startPublishing(mDigitsROFSize.get()); - getObjectsManager()->setDisplayHint(mDigitsROFSize.get(), "logx logy"); + getObjectsManager()->setDisplayHint(mDigitsROFSize.get(), "hist logx logy"); - mDigitsBC = std::make_unique("mDigitsBC", "Digits per BC; BCid; # entries", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches); + mDigitsBC = std::make_unique("mDigitsBC", + "Digits per BC; BCid; # entries per orbit", + o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches, true); mDigitsBC->SetMinimum(0.1); getObjectsManager()->startPublishing(mDigitsBC.get()); getObjectsManager()->setDisplayHint(mDigitsBC.get(), "hist"); - // --Chip hit maps - //============================================== + // Chip hit maps + QcMFTUtilTables MFTTable; for (int iVectorOccupancyMapIndex = 0; iVectorOccupancyMapIndex < 4; iVectorOccupancyMapIndex++) { // create only hit maps corresponding to the FLP @@ -180,28 +184,24 @@ void QcMFTDigitTask::initialize(o2::framework::InitContext& /*ctx*/) TString histogramName = ""; getNameOfChipOccupancyMap(folderName, histogramName, iOccupancyMapIndex); - auto chiphitmap = std::make_unique( + auto chiphitmap = std::make_unique( folderName, histogramName, MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][0], MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][1], MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][2], MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][3], MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][4], - MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][5]); + MFTTable.mNumberOfBinsInOccupancyMaps[iOccupancyMapIndex][5], true); chiphitmap->SetStats(0); mDigitChipOccupancyMap.push_back(std::move(chiphitmap)); getObjectsManager()->startPublishing(mDigitChipOccupancyMap[iVectorOccupancyMapIndex].get()); getObjectsManager()->setDefaultDrawOptions(mDigitChipOccupancyMap[iVectorOccupancyMapIndex].get(), "colz"); } - // --Pixel hit maps - //============================================== - int maxVectorIndex = mNumberOfPixelMapsPerFLP[mCurrentFLP] + mNumberOfPixelMapsPerFLP[4 - mCurrentFLP]; - for (int iVectorIndex = 0; iVectorIndex < maxVectorIndex; iVectorIndex++) { - // create only hit maps corresponding to the FLP - int iChipIndex = getChipIndexPixelOccupancyMap(iVectorIndex); - } + // Pixel hit maps + if (mNoiseScan == 1) { // to be executed only for special runs + int maxVectorIndex = mNumberOfPixelMapsPerFLP[mCurrentFLP] + mNumberOfPixelMapsPerFLP[4 - mCurrentFLP]; for (int iVectorIndex = 0; iVectorIndex < maxVectorIndex; iVectorIndex++) { // create only hit maps corresponding to the FLP int iChipIndex = getChipIndexPixelOccupancyMap(iVectorIndex); @@ -241,6 +241,8 @@ void QcMFTDigitTask::startOfCycle() void QcMFTDigitTask::monitorData(o2::framework::ProcessingContext& ctx) { + auto mNOrbitsPerTF = o2::base::GRPGeomHelper::instance().getNHBFPerTF(); + mMergerTest->Fill(mCurrentFLP); mMergerTest->Fill(-1); // To test what happenes with the normalisation when merged. // get the digits @@ -249,16 +251,11 @@ void QcMFTDigitTask::monitorData(o2::framework::ProcessingContext& ctx) return; } - // get the number of rofs + // get the rofs const auto rofs = ctx.inputs().get>("digitsrof"); if (rofs.empty()) { return; } - auto nROFs = rofs.size(); - - // keep track of normalisation of the different histograms in the underflow - mDigitChipOccupancy->Fill(-1, nROFs); - mDigitOccupancySummary->Fill(-1, -1, nROFs); // get correct timing info of the first TF orbit if (mRefOrbit == -1) { @@ -267,9 +264,9 @@ void QcMFTDigitTask::monitorData(o2::framework::ProcessingContext& ctx) // fill the digits time histograms for (const auto& rof : rofs) { - mDigitsROFSize->Fill(rof.getNEntries()); + mDigitsROFSize->getNum()->Fill(rof.getNEntries()); float seconds = orbitToSeconds(rof.getBCData().orbit, mRefOrbit) + rof.getBCData().bc * o2::constants::lhc::LHCBunchSpacingNS * 1e-9; - mDigitsBC->Fill(rof.getBCData().bc, rof.getNEntries()); + mDigitsBC->getNum()->Fill(rof.getBCData().bc, rof.getNEntries()); } // fill the pixel hit maps and overview histograms @@ -282,19 +279,19 @@ void QcMFTDigitTask::monitorData(o2::framework::ProcessingContext& ctx) continue; // fill double column histogram - mDigitDoubleColumnSensorIndices->Fill(oneDigit.getColumn() >> 1, oneDigit.getChipIndex()); + mDigitDoubleColumnSensorIndices->getNum()->Fill(oneDigit.getColumn() >> 1, oneDigit.getChipIndex()); // fill info into the summary histo int xBin = mDisk[chipIndex] * 2 + mFace[chipIndex]; int yBin = mZone[chipIndex] + mHalf[chipIndex] * 4; - mDigitOccupancySummary->Fill(xBin, yBin); + mDigitOccupancySummary->getNum()->Fill(xBin, yBin); // fill pixel hit maps if (mNoiseScan == 1) mDigitPixelOccupancyMap[vectorIndex]->Fill(oneDigit.getColumn(), oneDigit.getRow()); // fill overview histograms - mDigitChipOccupancy->Fill(chipIndex); + mDigitChipOccupancy->getNum()->Fill(chipIndex); if (mNoiseScan == 1) mDigitChipStdDev->SetBinContent(chipIndex + 1, mDigitPixelOccupancyMap[vectorIndex]->GetStdDev(1)); @@ -302,13 +299,31 @@ void QcMFTDigitTask::monitorData(o2::framework::ProcessingContext& ctx) int vectorOccupancyMapIndex = getVectorIndexChipOccupancyMap(chipIndex); if (vectorOccupancyMapIndex < 0) continue; - mDigitChipOccupancyMap[vectorOccupancyMapIndex]->Fill(mX[chipIndex], mY[chipIndex]); + mDigitChipOccupancyMap[vectorOccupancyMapIndex]->getNum()->Fill(mX[chipIndex], mY[chipIndex]); } + + // fill the denominators + mDigitChipOccupancy->getDen()->SetBinContent(1, mDigitChipOccupancy->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mDigitOccupancySummary->getDen()->SetBinContent(1, 1, mDigitOccupancySummary->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + mDigitDoubleColumnSensorIndices->getDen()->SetBinContent(1, 1, mDigitDoubleColumnSensorIndices->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); + mDigitsROFSize->getDen()->SetBinContent(1, mDigitsROFSize->getDen()->GetBinContent(1) + mNOrbitsPerTF); + mDigitsBC->getDen()->SetBinContent(1, mDigitsBC->getDen()->GetBinContent(1) + mNOrbitsPerTF); + for (int i = 0; i < 4; i++) + mDigitChipOccupancyMap[i]->getDen()->SetBinContent(1, 1, mDigitChipOccupancyMap[i]->getDen()->GetBinContent(1, 1) + mNOrbitsPerTF); } void QcMFTDigitTask::endOfCycle() { + // update all THRatios ILOG(Debug, Devel) << "endOfCycle" << ENDM; + + mDigitChipOccupancy->update(); + mDigitOccupancySummary->update(); + mDigitDoubleColumnSensorIndices->update(); + mDigitsROFSize->update(); + mDigitsBC->update(); + for (int i = 0; i < 4; i++) + mDigitChipOccupancyMap[i]->update(); } void QcMFTDigitTask::endOfActivity(const Activity& /*activity*/) @@ -329,17 +344,12 @@ void QcMFTDigitTask::reset() mDigitOccupancySummary->Reset(); mDigitsROFSize->Reset(); mDigitsBC->Reset(); - - // maps - for (int iVectorOccupancyMapIndex = 0; iVectorOccupancyMapIndex < 4; iVectorOccupancyMapIndex++) { - mDigitChipOccupancyMap[iVectorOccupancyMapIndex]->Reset(); - } - + for (int i = 0; i < 4; i++) + mDigitChipOccupancyMap[i]->Reset(); if (mNoiseScan == 1) { int maxVectorIndex = mNumberOfPixelMapsPerFLP[mCurrentFLP] + mNumberOfPixelMapsPerFLP[4 - mCurrentFLP]; - for (int iVectorIndex = 0; iVectorIndex < maxVectorIndex; iVectorIndex++) { - mDigitPixelOccupancyMap[iVectorIndex]->Reset(); - } + for (int j = 0; j < maxVectorIndex; j++) + mDigitPixelOccupancyMap[j]->Reset(); } } diff --git a/Modules/MFT/src/QcMFTTrackTask.cxx b/Modules/MFT/src/QcMFTTrackTask.cxx index caedb7e525..408554734c 100644 --- a/Modules/MFT/src/QcMFTTrackTask.cxx +++ b/Modules/MFT/src/QcMFTTrackTask.cxx @@ -16,6 +16,8 @@ /// \author Diana Maria Krupova /// \author Katarina Krizkova Gajdosova /// \author David Grund +/// + // C++ #include #include @@ -176,7 +178,7 @@ void QcMFTTrackTask::initialize(o2::framework::InitContext& /*ctx*/) mTrackROFNEntries = std::make_unique("mMFTTrackROFSize", "Distribution of the #tracks per ROF; # tracks per ROF; # entries per orbit", MaxTrackROFSize, 0, MaxTrackROFSize, true); getObjectsManager()->startPublishing(mTrackROFNEntries.get()); - getObjectsManager()->setDisplayHint(mTrackROFNEntries.get(), "hist"); + getObjectsManager()->setDisplayHint(mTrackROFNEntries.get(), "hist logx logy"); mTracksBC = std::make_unique("mMFTTracksBC", "Tracks per BC; BCid; # entries per orbit", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches, true); mTracksBC->SetMinimum(0.1);