Skip to content

Commit

Permalink
Removed mergeable check in ObjectMonitor for PostProcessing
Browse files Browse the repository at this point in the history
Also marked all unwanted occurances of mergeable with ignore flag
  • Loading branch information
Michal Tichák committed Nov 21, 2024
1 parent 96ff3d7 commit de92710
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 17 deletions.
6 changes: 2 additions & 4 deletions Framework/include/QualityControl/ObjectsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ class ObjectsManager
template <bool IgnoreMergeable = false, typename T>
void startPublishing(T obj, PublicationPolicy policy = PublicationPolicy::Forever)
{
// If you want to ignore Mergeable check for whole module
#ifndef IGNORE_MERGEABLE_CHECK
// We don't want to do this compile time check in PostProcessing
#ifndef QUALITYCONTROL_POSTPROCESSINTERFACE_H
static_assert(std::same_as<std::remove_pointer_t<T>, TObject> ||
// there is TCanvas mentioned here because users are using it a lot when they should not
// std::same_as<std::remove_pointer_t<T>, TCanvas> ||
IgnoreMergeable || mergers::Mergeable<T>,
"you are trying to startPublishing object that is not mergeable."
" If you know what you are doing use startPublishing<true>(...)");
Expand Down
8 changes: 4 additions & 4 deletions Modules/CTP/src/CountersQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CTPCountersTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistInputRate[i]->Draw();
mHistInputRate[i]->SetBit(TObject::kCanDelete);
}
getObjectsManager()->startPublishing(mTCanvasInputs);
getObjectsManager()->startPublishing<true>(mTCanvasInputs);
}

{
Expand All @@ -79,7 +79,7 @@ void CTPCountersTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistClassRate[i]->Draw();
mHistClassRate[i]->SetBit(TObject::kCanDelete);
}
getObjectsManager()->startPublishing(mTCanvasClasses);
getObjectsManager()->startPublishing<true>(mTCanvasClasses);
}

{
Expand All @@ -100,7 +100,7 @@ void CTPCountersTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistClassRate[k]->Draw();
mHistClassRate[k]->SetBit(TObject::kCanDelete);
}*/
getObjectsManager()->startPublishing(mTCanvasClassRates[j]);
getObjectsManager()->startPublishing<true>(mTCanvasClassRates[j]);
}
}

Expand Down Expand Up @@ -136,7 +136,7 @@ void CTPCountersTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistClassTotalCounts[i]->Draw();
mHistClassTotalCounts[i]->SetBit(TObject::kCanDelete);
}
getObjectsManager()->startPublishing(mTCanvasTotalCountsClasses);
getObjectsManager()->startPublishing<true>(mTCanvasTotalCountsClasses);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/Example/src/EveryObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void EveryObject::initialize(o2::framework::InitContext& /*ctx*/)
mTCanvasMembers[i]->Draw();
mTCanvasMembers[i]->SetBit(TObject::kCanDelete);
}
getObjectsManager()->startPublishing(mTCanvas, PublicationPolicy::Forever);
getObjectsManager()->startPublishing<true>(mTCanvas, PublicationPolicy::Forever);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Modules/GLO/src/DataCompressionQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ void DataCompressionQcTask::initialize(o2::framework::InitContext&)
mEntropyCompressionCanvas->DivideSquare(mCompressionHists.size());
mCompressionCanvas->DivideSquare(mCompressionHists.size());

getObjectsManager()->startPublishing(mEntropyCompressionCanvas.get());
getObjectsManager()->startPublishing(mCompressionCanvas.get());
getObjectsManager()->startPublishing<true>(mEntropyCompressionCanvas.get());
getObjectsManager()->startPublishing<true>(mCompressionCanvas.get());
}
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/HMPID/src/HmpidTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void HmpidTask::initialize(o2::framework::InitContext& /*ctx*/)

// Error messages
CheckerMessages = new TCanvas("CheckerMessages");
getObjectsManager()->startPublishing(CheckerMessages);
getObjectsManager()->startPublishing<true>(CheckerMessages);

// TH2 to check HV
hCheckHV = new TH2F("hCheckHV", "hCheckHV", 42, -0.5, 41.5, 4, 0, 4);
Expand Down
2 changes: 1 addition & 1 deletion Modules/MUON/MCH/src/PedestalsTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void PedestalsTask::initialize(o2::framework::InitContext& /*ctx*/)
}

mCanvasCheckerMessages = std::make_unique<TCanvas>("CheckerMessages", "Checker Messages", 800, 600);
getObjectsManager()->startPublishing(mCanvasCheckerMessages.get());
getObjectsManager()->startPublishing<true>(mCanvasCheckerMessages.get());

mPrintLevel = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/TPC/src/Clusters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void Clusters::initialize(InitContext& /*ctx*/)
addAndPublish(getObjectsManager(), mTimeBinCanvasVec, { "c_Sides_Time_Bin", "c_ROCs_Time_Bin_1D", "c_ROCs_Time_Bin_2D" });

for (auto& wrapper : mWrapperVector) {
getObjectsManager()->startPublishing(&wrapper);
getObjectsManager()->startPublishing<true>(&wrapper);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/TPC/src/JunkDetection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void JunkDetection::initialize(o2::framework::InitContext&)
mJDHistos.emplace_back(new TH2F("h_removed_Strategy_B", "Removed Strategy (B)", 1, 0, 1, 1, 0, 1)); // dummy for the objectsManager

if (!mIsMergeable) {
getObjectsManager()->startPublishing(mJDCanv.get());
getObjectsManager()->startPublishing<true>(mJDCanv.get());
}
for (const auto& hist : mJDHistos) {
getObjectsManager()->startPublishing(hist);
Expand Down
5 changes: 5 additions & 0 deletions Modules/TPC/src/PID.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ void PID::initialize(o2::framework::InitContext& /*ctx*/)
getObjectsManager()->startPublishing(hist.get());
}
}
for (auto const& pair : mQCPID.getMapOfCanvas()) {
for (auto& canv : pair.second) {
getObjectsManager()->startPublishing<true>(canv.get());
}
}
}

void PID::startOfActivity(const Activity& /*activity*/)
Expand Down
2 changes: 1 addition & 1 deletion Modules/TPC/src/RawDigits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void RawDigits::initialize(o2::framework::InitContext& /*ctx*/)
addAndPublish(getObjectsManager(), mTimeBinCanvasVec, { "c_Sides_Time_Bin", "c_ROCs_Time_Bin_1D", "c_ROCs_Time_Bin_2D" });

for (auto& wrapper : mWrapperVector) {
getObjectsManager()->startPublishing(&wrapper);
getObjectsManager()->startPublishing<true>(&wrapper);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/TPC/src/Utility.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void addAndPublish(std::shared_ptr<o2::quality_control::core::ObjectsManager> ob
for (const auto& canvName : canvNames) {
canVec.emplace_back(std::make_unique<TCanvas>(canvName.data()));
auto canvas = canVec.back().get();
objectsManager->startPublishing(canvas);
objectsManager->startPublishing<true>(canvas);
if (metaData.size() != 0) {
for (const auto& [key, value] : metaData) {
objectsManager->addMetadata(canvas->GetName(), key, value);
Expand Down

0 comments on commit de92710

Please sign in to comment.