Dear all,
I think I have a similar, potentially related issue: I try to add within the initialize function of a QC task a display hint (i.e. logx in a 2D hist) according to these instructions. This histogram is inside a vector of 2D hists. Looping over the vector, e.g. to start publishing all histograms, works fine, but accessing a single one does not work.
If I try one of the following options (after the histograms already have been initialized), I get an error while running:
(1)
getObjectsManager()->setDisplayHint("hdEdxVsp", "logx");
(2)
auto& histDedxVsP = mQCPID.getHistograms2D().at(3);
getObjectsManager()->setDisplayHint(histDedxVsP.GetName(), "logx");
(3)
auto& histDedxVsP = mQCPID.getHistograms2D().at(3);
getObjectsManager()->setDisplayHint(&histDedxVsP, "logx");
In all cases the error is:
[771:QC-TASK-RUNNER-PID]: 2021-10-21 16:21:55.673402 !!! Error - ObjectsManager: Unable to find object "hdEdxVsp"
[771:QC-TASK-RUNNER-PID]: [16:21:55][STATE] Exiting FairMQ state machine
[771:QC-TASK-RUNNER-PID]: [16:21:55][ERROR] error while setting up workflow in o2-qc: /home/sheckel/alice/sw/SOURCES/QualityControl/tasksDev/0/Framework/src/ObjectsManager.cxx(117): Throw in function o2::quality_control::core::MonitorObject* o2::quality_control::core::ObjectsManager::getMonitorObject(std::string)
[771:QC-TASK-RUNNER-PID]: Dynamic exception type: boost::wrapexcept<AliceO2::Common::ObjectNotFoundError>
[771:QC-TASK-RUNNER-PID]: std::exception::what: Object not found error
[771:QC-TASK-RUNNER-PID]: [AliceO2::Common::errinfo_object_name_*] = hdEdxVsp
[771:QC-TASK-RUNNER-PID]:
[771:QC-TASK-RUNNER-PID]: terminate called after throwing an instance of 'boost::wrapexcept<AliceO2::Common::ObjectNotFoundError>'
[771:QC-TASK-RUNNER-PID]: what(): Object not found error
I.e. even when I try to access it via GetName
(version (2)), it gets the correct name (hence has to have access to the correct object), but cannot retrieve the object.
Now, when I put it in the existing for
loop used to start publishing, set a simple counter and try to get the correct object, this actually works:
int count = 0;
for (auto& hist : mQCPID.getHistograms2D()) {
getObjectsManager()->startPublishing(&hist);
getObjectsManager()->addMetadata(hist.GetName(), "custom", "43");
if (count == 3) {
getObjectsManager()->setDisplayHint(hist.GetName(), "logx");
ILOG(Info, Support) << "--->>> Set " << hist.GetName() << " to log x" << ENDM;
}
count++;
}
Unfortunately, while the if statement is entered and the setDisplayHint
performed without complaining, the histogram does still not have a logarithmic x axis. But I guess, this is likely a second issue more related to this ticket.
I would be very glad about any idea!
Cheers,
Stefan