/*! * @file SWaveform.h * @author Dan Saunders, Nick Ryder, on behalf of the SoLid collaboration. * @date 16 Feb 2016 */ #ifndef SWaveform_h_ #define SWaveform_h_ #include #include #include #include "TH1F.h" #include "SDetector/SChannel.h" //! Waveform container. /*! This container stores all information about a particular waveform. This * includes the ADC samples and time of the first sample. Samples in this object * should be continuous - no gaps due to zero surpression. That implies some signals, * like neutrons, will have mulitple waveforms (known as waveform chunks). These * then undergo a merging stage, when a time cut is placed to merge waveforms * that arrive near eachother in time. In these cases, to remain continuous, appropriate * zeros are added back into the ADC sample vectors. When merging two SWaveforms, * a new waveform object is created to store the information. */ class SWaveform { private: //! See samples() std::vector m_samples; //! See time() uint64_t m_time; //! See htime() double m_htime; //! See channel() SChannel * m_channel; public: SWaveform(uint64_t time, double htime, std::vector, SChannel * channel); SWaveform(uint64_t time, double htime, SChannel * channel); ~SWaveform() {} TH1D* getHistogram(std::string name, std::string title = ""); float integrate(int iSample, int m_integralRange, float baseline); // Setters and getters _______________________________________________________ //! ADC samples of this waveform (continuous). std::vector * samples() {return &m_samples;} //! Time of the first sample in DAQ clock samples since start of sub-run. uint64_t time() {return m_time;} //! Time of the first sample in ns since start of cycle. double htime() {return m_htime;} //! Pointer to the channel this waveform came from. SChannel * channel() {return m_channel;} uint64_t timestamp() {return m_time;} }; class SWaveformBlock { public: SWaveformBlock(uint8_t, uint32_t, uint64_t, uint64_t, uint64_t); ~SWaveformBlock(); uint8_t boardid; uint32_t counter; uint64_t timestamp; uint64_t includedchannels; uint64_t requestedchannels; std::vector waveforms; }; #endif /* SWaveform_h_ */