/*! * @file SPeak.h * @author Dan Saunders, on behalf of the SoLid collaboration. * @date 16 Feb 2016 */ #ifndef SPeak_h_ #define SPeak_h_ #include #include #include "TH1F.h" class SChannel; class SWaveform; //! Peak container. class SPeak { private: //! See waveform() SWaveform * m_waveform; //! See time() unsigned int m_time; //! See htime() double m_htime; //! See amplitude() float m_amplitude; //! See integral() float m_integral; //! See shortIntegral() float m_shortIntegral; //! See channel() SChannel * m_channel; //! See eventAssociated() bool m_eventAssociated; //! See waveformPos() std::vector::iterator m_waveformPos; public: SPeak(unsigned int time, double htime, SChannel * channel, SWaveform * wf); ~SPeak() {}; // Setters and getters _______________________________________________________ //! The waveform this peak comes from. SWaveform * waveform() {return m_waveform;} //! The channel this peak came from. SChannel * channel() {return m_channel;} //! Time of the peak in DAQ clock samples (rounded). unsigned int time() {return m_time;} //! Time of the peak in ns (relative to the start of the current cycle). double htime() {return m_htime;} //! Amplitude of the peak - see also setAmplitude() float amplitude() {return m_amplitude;} void setAmplitude(float amp) {m_amplitude = amp;} //! Integral of the peak over the waveform for pre-set range. float integral() {return m_integral;} void setIntegral(float integral) {m_integral = integral;} //! Integral of a short range, suitable for MPPC peaks only. float shortIntegral() {return m_shortIntegral;} void setShortIntegral(float shortIntegral) {m_shortIntegral = shortIntegral;} //! Flag to show if already forming a event. bool eventAssociated() {return m_eventAssociated;} void setEventAssociated(bool s) {m_eventAssociated = s;} //! Iterator to the waveform sample the peak was idenfitied at. std::vector::iterator waveformPos() {return m_waveformPos;} void setWaveformPos(std::vector::iterator it) {m_waveformPos = it;} }; #endif /* SPeak_h_ */