@@ -37,14 +37,13 @@ namespace o2::tpc
3737class TPCFLPCMVDevice : public o2 ::framework::Task
3838{
3939 public:
40- TPCFLPCMVDevice (const int lane, const std::vector<uint32_t >& crus, const int nTFsBuffer)
41- : mLane {lane}, mCRUs {crus}, mNTFsBuffer {nTFsBuffer} {}
40+ TPCFLPCMVDevice (const int lane, const std::vector<uint32_t >& crus, const bool triggerPerFlp, const int nTFsBuffer)
41+ : mLane {lane}, mCRUs {crus}, mTriggerPerFLP {triggerPerFlp}, mNTFsBuffer {nTFsBuffer} {}
4242
4343 void init (o2::framework::InitContext& ic) final
4444 {
4545 mDumpCMVs = ic.options ().get <bool >(" dump-cmvs-flp" );
4646 mEnableTrigger = ic.options ().get <bool >(" trigger" );
47- mTriggerPerFLP = ic.options ().get <bool >(" trigger-per-flp" );
4847 mTriggerThresholdCMV = ic.options ().get <float >(" trigger-threshold-cmv" );
4948 mTriggerThresholdMeanMax = ic.options ().get <float >(" trigger-threshold-cmvMeanMax" );
5049 mTriggerThresholdMeanMin = ic.options ().get <float >(" trigger-threshold-cmvMeanMin" );
@@ -200,7 +199,7 @@ class TPCFLPCMVDevice : public o2::framework::Task
200199 }
201200};
202201
203- o2::framework::DataProcessorSpec getTPCFLPCMVSpec (const int ilane, const std::vector<uint32_t >& crus, const int nTFsBuffer = 1 )
202+ o2::framework::DataProcessorSpec getTPCFLPCMVSpec (const int ilane, const std::vector<uint32_t >& crus, const bool triggerPerFlp, const int nTFsBuffer = 1 )
204203{
205204 std::vector<o2::framework::OutputSpec> outputSpecs;
206205 std::vector<o2::framework::InputSpec> inputSpecs;
@@ -217,22 +216,25 @@ o2::framework::DataProcessorSpec getTPCFLPCMVSpec(const int ilane, const std::ve
217216 // Outputs to TPCDistributeCMVSpec
218217 outputSpecs.emplace_back (o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC , TPCFLPCMVDevice::getDataDescriptionCMVGroup (), subSpec}, o2::framework::Lifetime::Sporadic);
219218 outputSpecs.emplace_back (o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC , TPCFLPCMVDevice::getDataDescriptionCMVOrbitInfo (), subSpec}, o2::framework::Lifetime::Sporadic);
220- }
221219
222- // Single per-FLP trigger output, subspec keyed on the first CRU
223- const header::DataHeader::SubSpecificationType trigSubSpec{crus.front () << 7 };
224- outputSpecs.emplace_back (o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC , TPCFLPCMVDevice::getDataDescriptionCMVTrigger (), trigSubSpec}, o2::framework::Lifetime::Timeframe);
220+ if (!triggerPerFlp) {
221+ outputSpecs.emplace_back (o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC , TPCFLPCMVDevice::getDataDescriptionCMVTrigger (), subSpec}, o2::framework::Lifetime::Timeframe);
222+ }
223+ }
224+ if (triggerPerFlp) { // Single per-FLP trigger output, subspec keyed on the first CRU
225+ const header::DataHeader::SubSpecificationType trigSubSpec{crus.front () << 7 };
226+ outputSpecs.emplace_back (o2::framework::ConcreteDataMatcher{o2::header::gDataOriginTPC , TPCFLPCMVDevice::getDataDescriptionCMVTrigger (), trigSubSpec}, o2::framework::Lifetime::Timeframe);
227+ }
225228
226229 const auto id = fmt::format (" tpc-flp-cmv-{:02}" , ilane);
227230 return o2::framework::DataProcessorSpec{
228231 id.data (),
229232 inputSpecs,
230233 outputSpecs,
231- o2::framework::AlgorithmSpec{o2::framework::adaptFromTask<TPCFLPCMVDevice>(ilane, crus, nTFsBuffer)},
234+ o2::framework::AlgorithmSpec{o2::framework::adaptFromTask<TPCFLPCMVDevice>(ilane, crus, triggerPerFlp, nTFsBuffer)},
232235 o2::framework::Options{
233236 {" dump-cmvs-flp" , o2::framework::VariantType::Bool, false , {" Dump CMVs to file" }},
234237 {" trigger" , o2::framework::VariantType::Bool, false , {" Enable CMV trigger evaluation" }},
235- {" trigger-per-flp" , o2::framework::VariantType::Bool, false , {" Aggregate triggers of CRUs on FLP to a single trigger" }},
236238 {" trigger-threshold-cmv" , o2::framework::VariantType::Float, -10 .f , {" CMV threshold: sequence starts when value drops below this (ADC units)" }},
237239 {" trigger-threshold-cmvMeanMax" , o2::framework::VariantType::Float, -40 .f , {" Upper bound on trigger-sequence mean CMV value" }},
238240 {" trigger-threshold-cmvMeanMin" , o2::framework::VariantType::Float, -80 .f , {" Lower bound on trigger-sequence mean CMV value" }},
0 commit comments