-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from DUNE-DAQ/dte/datahandlingmodel_with_idt_…
…tpa_vector DataHandlingModel with IDT
- Loading branch information
Showing
7 changed files
with
116 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @file TriggerDataHandlingModel.hpp Glue between data source, payload raw processor, | ||
* latency buffer and request handler. | ||
* | ||
* This is part of the DUNE DAQ, copyright 2024. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
#ifndef TRIGGER_INCLUDE_TRIGGER_TRIGGERDATAHANDLINGMODEL_HPP_ | ||
#define TRIGGER_INCLUDE_TRIGGER_TRIGGERDATAHANDLINGMODEL_HPP_ | ||
|
||
#include "datahandlinglibs/models/DataHandlingModel.hpp" | ||
#include <vector> | ||
|
||
namespace dunedaq::trigger { | ||
|
||
template<class ReadoutType, | ||
class RequestHandlerType, | ||
class LatencyBufferType, | ||
class RawDataProcessorType, | ||
class InputDataType = ReadoutType> | ||
class TriggerDataHandlingModel | ||
: public datahandlinglibs:: | ||
DataHandlingModel<ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType> | ||
{ | ||
public: | ||
using Base = datahandlinglibs:: | ||
DataHandlingModel<ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType>; | ||
using RDT = typename Base::RDT; | ||
using RHT = typename Base::RHT; | ||
using LBT = typename Base::LBT; | ||
using RPT = typename Base::RPT; | ||
using IDT = typename Base::IDT; | ||
|
||
explicit TriggerDataHandlingModel(std::atomic<bool>& run_marker); | ||
|
||
// Transform input data type to readout | ||
std::vector<ReadoutType> transform_payload(IDT& original) const override; | ||
}; | ||
|
||
} // namespace dunedaq::trigger | ||
|
||
// Declarations | ||
#include "detail/TriggerDataHandlingModel.hxx" | ||
|
||
#endif // TRIGGER_INCLUDE_TRIGGER_TRIGGERDATAHANDLINGMODEL_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* @file TriggerDataHandlingModel.hxx Glue between data source, payload raw processor, | ||
* latency buffer and request handler. | ||
* | ||
* This is part of the DUNE DAQ, copyright 2024. | ||
* Licensing/copyright details are in the COPYING file that you should have | ||
* received with this code. | ||
*/ | ||
#include "triggeralgs/TriggerActivity.hpp" | ||
#include "triggeralgs/TriggerCandidate.hpp" | ||
|
||
namespace dunedaq::trigger { | ||
|
||
template<class RDT, class RHT, class LBT, class RPT, class IDT> | ||
TriggerDataHandlingModel<RDT, RHT, LBT, RPT, IDT>::TriggerDataHandlingModel(std::atomic<bool>& run_marker) | ||
: Base(run_marker) | ||
{ | ||
} | ||
|
||
template<class RDT, class RHT, class LBT, class RPT, class IDT> | ||
std::vector<RDT> | ||
TriggerDataHandlingModel<RDT, RHT, LBT, RPT, IDT>::transform_payload(IDT& original) const | ||
{ | ||
if constexpr (std::is_same_v<IDT, trigger::TPSet>) { | ||
std::vector<RDT> transformed(original.objects.size()); | ||
for (std::size_t i = 0; i < transformed.size(); ++i) { | ||
transformed[i].tp = std::move(original.objects[i]); | ||
} | ||
return transformed; | ||
} else if constexpr (std::is_same_v<IDT, std::vector<TriggerPrimitiveTypeAdapter>>) { | ||
return std::move(original); | ||
} else if constexpr (std::is_same_v<IDT, triggeralgs::TriggerActivity> || | ||
std::is_same_v<IDT, triggeralgs::TriggerCandidate>) { | ||
return { RDT(std::move(original)) }; | ||
|
||
} else { | ||
return Base::transform_payload(original); | ||
} | ||
} | ||
|
||
} // namespace dunedaq::trigger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.