// Author: Andrea Palaia 24/08/09 #ifndef __Waveform__ #define __Waveform__ //////////////////////////////////////////////////////////////// // // // Waveform // // // // The class Waveform provides all methods to perform // // spectrum analysis. // // // //////////////////////////////////////////////////////////////// #include "TObject.h" #include "TVectorD.h" class Waveform : public TObject { public: //wave TVectorD wave; //sampling rate Double_t sampleFreq; TString label; Double_t offset; //acquisition unixtime ULong_t unixtime; Waveform(); Waveform(Double_t v[], UInt_t size); Waveform(Float_t v[], UInt_t size); Waveform(TVectorD v); ~Waveform(); void SetWaveform(Double_t v[], UInt_t size); void SetWaveform(Float_t v[], UInt_t size); void SetWaveform(TVectorD v); TVectorD GetWaveform(); void SetSampleFreq(Double_t f); Double_t GetSampleFreq(); void SetLabel(TString str); TString GetLabel(); void SetOffset(); Double_t GetOffset(); void SetUnixtime(ULong_t t); ULong_t GetUnixtime(); TVectorD Smooth(); Double_t Fwhm(); void Plot(Option_t* option = "", Color_t color = 1); Double_t GetMax(); Double_t Integral(); Int_t GetIndexAt(Double_t frac, Bool_t falling_edge = 0); Double_t GetRisetime(); Double_t GetFalltime(); Double_t GetMean(); Double_t GetRMS(); Int_t IndexOf(Double_t val); Bool_t IsSaturated(); Bool_t IsNoise(); void Shift(Int_t points); ClassDef(Waveform,1); //a waveform }; #endif