18void Data::Init(std::shared_ptr<HistogramSender> histSender)
20 if (histSender.get()) {
22 std::vector<std::pair<std::string, std::string>> vHistCfgs;
23 size_t nHistograms = 0;
29 vHistCfgs.reserve(nHistograms);
31 auto RegHist = [&](
const auto&
h) {
32 if (!
h.GetMetadata().CheckFlags()) {
33 std::stringstream msg;
34 msg <<
"attempt to pass a histogram " <<
h.GetName()
35 <<
" with inconsistent flags (see HistogramMetadata::CheckFlags for detailes)";
36 throw std::runtime_error(msg.str());
38 vHistCfgs.emplace_back(
h.GetName() +
"!" +
h.GetMetadataString(),
fsName);
47 std::vector<std::pair<std::string, std::string>> vCanvCfgs;
50 vCanvCfgs.emplace_back(std::make_pair(canv.substr(0, canv.find_first_of(
';')), canv));
53 histSender->PrepareAndSendMsg(std::pair<uint32_t, uint32_t>(vHistCfgs.size(), vCanvCfgs.size()),
54 zmq::send_flags::sndmore);
56 auto RegCfg = [&](
const auto& cfg) { histSender->PrepareAndSendMsg(cfg, zmq::send_flags::sndmore); };
58 std::for_each(vHistCfgs.begin(), vHistCfgs.end(), RegCfg);
59 std::for_each(vCanvCfgs.begin(), vCanvCfgs.end(), RegCfg);
65catch (
const std::exception& err) {
66 L_(fatal) <<
"cbm::algo::qa::Data for " << fsName <<
" fatally aborted. Reason " << err.what();