diff --git a/Detectors/TPC/workflow/include/TPCWorkflow/TPCFLPCMVSpec.h b/Detectors/TPC/workflow/include/TPCWorkflow/TPCFLPCMVSpec.h index bb7f9632c6308..d86356234a1c2 100644 --- a/Detectors/TPC/workflow/include/TPCWorkflow/TPCFLPCMVSpec.h +++ b/Detectors/TPC/workflow/include/TPCWorkflow/TPCFLPCMVSpec.h @@ -37,14 +37,13 @@ namespace o2::tpc class TPCFLPCMVDevice : public o2::framework::Task { public: - TPCFLPCMVDevice(const int lane, const std::vector& crus, const int nTFsBuffer) - : mLane{lane}, mCRUs{crus}, mNTFsBuffer{nTFsBuffer} {} + TPCFLPCMVDevice(const int lane, const std::vector& crus, const bool triggerPerFlp, const int nTFsBuffer) + : mLane{lane}, mCRUs{crus}, mTriggerPerFLP{triggerPerFlp}, mNTFsBuffer{nTFsBuffer} {} void init(o2::framework::InitContext& ic) final { mDumpCMVs = ic.options().get("dump-cmvs-flp"); mEnableTrigger = ic.options().get("trigger"); - mTriggerPerFLP = ic.options().get("trigger-per-flp"); mTriggerThresholdCMV = ic.options().get("trigger-threshold-cmv"); mTriggerThresholdMeanMax = ic.options().get("trigger-threshold-cmvMeanMax"); mTriggerThresholdMeanMin = ic.options().get("trigger-threshold-cmvMeanMin"); @@ -200,7 +199,7 @@ class TPCFLPCMVDevice : public o2::framework::Task } }; -o2::framework::DataProcessorSpec getTPCFLPCMVSpec(const int ilane, const std::vector& crus, const int nTFsBuffer = 1) +o2::framework::DataProcessorSpec getTPCFLPCMVSpec(const int ilane, const std::vector& crus, const bool triggerPerFlp, const int nTFsBuffer = 1) { std::vector outputSpecs; std::vector inputSpecs; @@ -217,22 +216,25 @@ o2::framework::DataProcessorSpec getTPCFLPCMVSpec(const int ilane, const std::ve // Outputs to TPCDistributeCMVSpec outputSpecs.emplace_back(o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC, TPCFLPCMVDevice::getDataDescriptionCMVGroup(), subSpec}, o2::framework::Lifetime::Sporadic); outputSpecs.emplace_back(o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC, TPCFLPCMVDevice::getDataDescriptionCMVOrbitInfo(), subSpec}, o2::framework::Lifetime::Sporadic); - } - // Single per-FLP trigger output, subspec keyed on the first CRU - const header::DataHeader::SubSpecificationType trigSubSpec{crus.front() << 7}; - outputSpecs.emplace_back(o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC, TPCFLPCMVDevice::getDataDescriptionCMVTrigger(), trigSubSpec}, o2::framework::Lifetime::Timeframe); + if (!triggerPerFlp) { + outputSpecs.emplace_back(o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC, TPCFLPCMVDevice::getDataDescriptionCMVTrigger(), subSpec}, o2::framework::Lifetime::Timeframe); + } + } + if (triggerPerFlp) { // Single per-FLP trigger output, subspec keyed on the first CRU + const header::DataHeader::SubSpecificationType trigSubSpec{crus.front() << 7}; + outputSpecs.emplace_back(o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC, TPCFLPCMVDevice::getDataDescriptionCMVTrigger(), trigSubSpec}, o2::framework::Lifetime::Timeframe); + } const auto id = fmt::format("tpc-flp-cmv-{:02}", ilane); return o2::framework::DataProcessorSpec{ id.data(), inputSpecs, outputSpecs, - o2::framework::AlgorithmSpec{o2::framework::adaptFromTask(ilane, crus, nTFsBuffer)}, + o2::framework::AlgorithmSpec{o2::framework::adaptFromTask(ilane, crus, triggerPerFlp, nTFsBuffer)}, o2::framework::Options{ {"dump-cmvs-flp", o2::framework::VariantType::Bool, false, {"Dump CMVs to file"}}, {"trigger", o2::framework::VariantType::Bool, false, {"Enable CMV trigger evaluation"}}, - {"trigger-per-flp", o2::framework::VariantType::Bool, false, {"Aggregate triggers of CRUs on FLP to a single trigger"}}, {"trigger-threshold-cmv", o2::framework::VariantType::Float, -10.f, {"CMV threshold: sequence starts when value drops below this (ADC units)"}}, {"trigger-threshold-cmvMeanMax", o2::framework::VariantType::Float, -40.f, {"Upper bound on trigger-sequence mean CMV value"}}, {"trigger-threshold-cmvMeanMin", o2::framework::VariantType::Float, -80.f, {"Lower bound on trigger-sequence mean CMV value"}}, diff --git a/Detectors/TPC/workflow/src/tpc-flp-cmv.cxx b/Detectors/TPC/workflow/src/tpc-flp-cmv.cxx index f41fe5b8fbd15..b7734c5d0b24f 100644 --- a/Detectors/TPC/workflow/src/tpc-flp-cmv.cxx +++ b/Detectors/TPC/workflow/src/tpc-flp-cmv.cxx @@ -32,6 +32,7 @@ void customize(std::vector& workflowOptions) {"time-lanes", VariantType::Int, 1, {"Number of parallel processing lanes (timeframes are split per device)"}}, {"crus", VariantType::String, cruDefault.c_str(), {"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}}, {"n-TFs-buffer", VariantType::Int, 1, {"Buffer n-TFs before sending output"}}, + {"trigger-per-flp", VariantType::Bool, false, {"Aggregate triggers of CRUs on FLP to a single trigger"}}, {"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}}; std::swap(workflowOptions, options); @@ -48,6 +49,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config) const auto nLanes = std::min(static_cast(config.options().get("lanes")), nCRUs); const auto time_lanes = static_cast(config.options().get("time-lanes")); const auto crusPerLane = nCRUs / nLanes + ((nCRUs % nLanes) != 0); + const bool triggerPerFLP = config.options().get("trigger-per-flp"); const int nTFsBuffer = config.options().get("n-TFs-buffer"); o2::conf::ConfigurableParam::updateFromFile(config.options().get("configFile")); @@ -65,8 +67,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config) } const auto last = std::min(tpcCRUs.end(), first + crusPerLane); const std::vector rangeCRUs(first, last); - workflow.emplace_back(timePipeline(getTPCFLPCMVSpec(ilane, rangeCRUs, nTFsBuffer), time_lanes)); + workflow.emplace_back(timePipeline(getTPCFLPCMVSpec(ilane, rangeCRUs, triggerPerFLP, nTFsBuffer), time_lanes)); } return workflow; -} \ No newline at end of file +}