43 std::string mInputFileName{};
50 std::vector<o2::dcs::test::HintType> mDataPointHints;
54DCSDataReplayer::DCSDataReplayer(std::vector<o2::dcs::test::HintType> hints,
56 mDataDescription(description) {}
60 mMaxTF = ic.
options().
get<int64_t>(
"max-timeframes");
61 mInputFileName = ic.
options().
get<std::string>(
"input-file");
62 mInputData.ReadFile(mInputFileName.data(),
"time/D:alias/C:value/D",
';');
63 mInputData.SetBranchAddress(
"time", &mTime);
64 mInputData.SetBranchAddress(
"value", &mValue);
65 mInputData.SetBranchAddress(
"alias", mAlias);
71 uint64_t tfid = o2::header::get<o2::framework::DataProcessingHeader*>((*input).header)->startTime;
73 LOG(info) <<
"Data generator reached TF " << tfid <<
", stopping";
78 std::vector<o2::dcs::DataPointCompositeObject> dpcoms;
79 for (Long64_t iEntry = 0; iEntry < mInputData.GetEntries(); ++iEntry) {
80 mInputData.GetEntry(iEntry);
81 const auto ultime = uint64_t(std::round(mTime * 1000));
82 const auto seconds = uint32_t(ultime / 1000);
83 const auto msec = uint16_t(ultime % 1000);
90 <<
"***************** TF " << tfid <<
" has generated " << dpcoms.size() <<
" DPs";
101 std::string desc{detName};
102 desc +=
"DATAPOINTS";
109 "dcs-random-data-generator",
111 Outputs{{{
"outputDCS"},
"DCS", dd}},
114 {
"max-timeframes", VariantType::Int64, 99999999999ll, {
"max TimeFrames to generate"}},
115 {
"delta-fraction", VariantType::Float, 0.05f, {
"fraction of data points to put in the delta"}},
116 {
"input-file", VariantType::String,
"", {
"Input file with data to play back"}}}};
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
virtual void init(InitContext &context)
virtual void run(ProcessingContext &context)=0
o2::framework::DataProcessorSpec getDCSDataReplaySpec(std::vector< HintType > hints={}, const char *detName="TPC")
o2::dcs::DataPointCompositeObject createDataPointCompositeObject(const std::string &alias, T val, uint32_t seconds, uint16_t msec, uint16_t flags=0)
Defining PrimaryVertex explicitly as messageable.
@ Me
Only quit this data processor.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"