diff --git a/src/TRestRawPeaksFinderProcess.cxx b/src/TRestRawPeaksFinderProcess.cxx index d8304c08..296283a5 100644 --- a/src/TRestRawPeaksFinderProcess.cxx +++ b/src/TRestRawPeaksFinderProcess.cxx @@ -1,13 +1,8 @@ -// -// Created by lobis on 24-Aug-23. -// #include "TRestRawPeaksFinderProcess.h" #include -#include "TRestRawReadoutMetadata.h" - ClassImp(TRestRawPeaksFinderProcess); using namespace std; @@ -62,7 +57,20 @@ TRestEvent* TRestRawPeaksFinderProcess::ProcessEvent(TRestEvent* inputEvent) { return std::tie(std::get<1>(a), std::get<0>(a)) < std::tie(std::get<1>(b), std::get<0>(b)); }); - SetObservableValue("peaks", eventPeaks); + // SetObservableValue("peaks", eventPeaks); // problems with dictionaries + std::vector peaksChannelId; + std::vector peaksTime; + std::vector peaksAmplitude; + + for (const auto& [channelId, time, amplitude] : eventPeaks) { + peaksChannelId.push_back(channelId); + peaksTime.push_back(time); + peaksAmplitude.push_back(amplitude); + } + + SetObservableValue("peaksChannelId", peaksChannelId); + SetObservableValue("peaksTime", peaksTime); + SetObservableValue("peaksAmplitude", peaksAmplitude); std::vector windowIndex(eventPeaks.size(), 0); // Initialize with zeros std::vector windowCenter; // for each different window, the center of the window