diff --git a/MQ/mcbm/CbmDeviceBuildDigiEvents.cxx b/MQ/mcbm/CbmDeviceBuildDigiEvents.cxx index 98aab969cf5e336353138431417f308af500f53f..bb172d52ce11b37b4b637e70531843e44dd48f2f 100644 --- a/MQ/mcbm/CbmDeviceBuildDigiEvents.cxx +++ b/MQ/mcbm/CbmDeviceBuildDigiEvents.cxx @@ -69,6 +69,7 @@ try { fvsSetTrigMinNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMinNb"); fvsSetTrigMaxNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMaxNb"); fvsSetTrigMinLayersNb = fConfig->GetValue<std::vector<std::string>>("SetTrigMinLayersNb"); + fvsSetHistMaxDigiNb = fConfig->GetValue<std::vector<std::string>>("SetHistMaxDigiNb"); fbDoNotSend = fConfig->GetValue<bool>("DoNotSend"); fsChannelNameDataInput = fConfig->GetValue<std::string>("TsNameIn"); @@ -296,6 +297,39 @@ try { fpAlgo->SetTriggerMinLayersNumber(selDet, uMinLayersNb); } + /// Extract Histograms Max Digi limits if any + for (std::vector<std::string>::iterator itStrHistMaxDigi = fvsSetHistMaxDigiNb.begin(); + itStrHistMaxDigi != fvsSetHistMaxDigiNb.end(); + ++itStrHistMaxDigi) { + size_t charPosDel = (*itStrHistMaxDigi).find(','); + if (std::string::npos == charPosDel) { + LOG(info) + << "CbmDeviceBuildDigiEvents::InitTask => " + << "Trying to set Histos max Digi nb with invalid option pattern, ignored! " + << " (Should be ECbmModuleId,dMaxDigiNb but instead found " << (*itStrHistMaxDigi) + << " )"; + continue; + } + + /// Detector Enum Tag + std::string sSelDet = (*itStrHistMaxDigi).substr(0, charPosDel); + ECbmModuleId selDet = GetDetectorId(sSelDet); + if (ECbmModuleId::kNotExist == selDet) { + LOG(info) + << "CbmDeviceBuildDigiEvents::InitTask => " + << "Trying to set Histos max Digi nb for unsupported detector, ignored! " + << sSelDet; + continue; + } + + /// Min number + charPosDel++; + Double_t dHistMaxDigiNb = std::stod((*itStrHistMaxDigi).substr(charPosDel)); + + LOG(debug) << "set Histos max Digi nb to " << dHistMaxDigiNb; + fpAlgo->SetHistogramMaxDigiNb(selDet, dHistMaxDigiNb); + } + /// FIXME: Re-enable clang formatting after formatted lines /* clang-format on */ diff --git a/MQ/mcbm/CbmDeviceBuildDigiEvents.h b/MQ/mcbm/CbmDeviceBuildDigiEvents.h index 6632cd3ae10dfa136ac01de7b4d5835a261cbc5b..3631c31ea864a11e5e9a7128dc9a7b924ce4ac2e 100644 --- a/MQ/mcbm/CbmDeviceBuildDigiEvents.h +++ b/MQ/mcbm/CbmDeviceBuildDigiEvents.h @@ -65,6 +65,7 @@ private: std::vector<std::string> fvsSetTrigMinNb = {}; std::vector<std::string> fvsSetTrigMaxNb = {}; std::vector<std::string> fvsSetTrigMinLayersNb = {}; + std::vector<std::string> fvsSetHistMaxDigiNb = {}; /// I/O control bool fbDoNotSend = false; /// message queues diff --git a/MQ/mcbm/runBuildDigiEvents.cxx b/MQ/mcbm/runBuildDigiEvents.cxx index 97be32d5a20c0fe4a36fd2dd8e675eea78b93699..8237c2176260df92e4e0301d92e772fdca3ff58f 100644 --- a/MQ/mcbm/runBuildDigiEvents.cxx +++ b/MQ/mcbm/runBuildDigiEvents.cxx @@ -38,6 +38,9 @@ void addCustomOptions(bpo::options_description& options) options.add_options()("SetTrigMinLayersNb", bpo::value<std::vector<std::string>>()->multitoken()->composing(), "Set minimum number of fired layers for selected detector, use string matching " "ECbmModuleId,uMinLayersNb e.g. kTof,3"); + options.add_options()("SetHistMaxDigiNb", bpo::value<std::vector<std::string>>()->multitoken()->composing(), + "Set max nb of digi in histograms for selected detector, use string matching " + "ECbmModuleId,dMaxDigiNb e.g. kTof,1000"); options.add_options()("DoNotSend", bpo::value<bool>()->default_value(false), "Disable the sending of data if true"); options.add_options()("TsNameIn", bpo::value<std::string>()->default_value("unpts_0"), "MQ channel name for unpacked TS data");