/*! * @file SWaveformParser.h * @author Nick Ryder & Dan Saunders, on behalf of the SoLid collaboration. * @date 17 Aug 2016 */ #ifndef SWaveformParser_h_ #define SWaveformParser_h_ #include "SAlgorithms/ISAlgorithm.h" enum ParserStatus { parserContinue = 0x0, parserEnd = 0x1, parserError = 0x2 }; //! Parsing raw data into waveforms. class SWaveformParser : public ISAlgorithm { public: SWaveformParser(SDetector * dtr, SClipboard * cb); ~SWaveformParser(); void initialize(); void execute(); void finalize(); private: /** * Parse a data containing a single time block from a single plane. * * @param block: reference to data in SRawBuffer * @returns true for successful parsing. */ STriggerRecord * parseTriggerBlock(SRawBlock block); SWaveformBlock * parseWaveformBlock(SRawBlock block); SRawBuffer * m_buf; std::vector * m_timeblocks; STimeBlock* m_timeblock; uint64_t m_cyclestarttime; STriggerRecord * m_triggerrecord; bool m_stopnext; //! maximum (human time [ns]) within one cycle double m_maxhtime; //! maximum gap between two successive time blocks within a single cycle. double m_maxgaphtime; }; #endif /* SWaveformParser_h_ */