00001 00025 #ifndef _M_NOISEAVGPOWERSPECTRUM_H_ 00026 #define _M_NOISEAVGPOWERSPECTRUM_H_ 00027 00028 #include <map> 00029 #include "QModule.hh" 00030 #include "QCuore.hh" 00031 #include "QVector.hh" 00032 #include "QFFT.hh" 00033 00034 class TH1D; 00035 00036 class MNoiseAvgPowerSpectrum : public QModule { 00037 00038 public: 00039 MNoiseAvgPowerSpectrum(QSequence* s); 00040 00041 virtual ~MNoiseAvgPowerSpectrum(); 00042 00043 // Init method is called before event loop 00044 virtual void Init(); 00045 00046 // Do method is called for each event, getting the event as argument 00047 virtual QEvent* Do( QEvent* ev); 00048 00049 // Done method is called after event loop 00050 virtual void Done(); 00051 00052 private: 00054 int fNumChannels; 00057 int fNumFreq; 00059 bool fProcessedFirstEvent; 00061 std::map<int, int> fCount; 00063 std::map<int,QVector> fNoiseAvgPowerSpectrum; 00065 std::map<int,QVector> fNoiseAvgDiffPS; 00066 int fSelect; 00067 time_t fBeginValidity; 00068 time_t fEndValidity; 00069 std::string fOutputFile; 00070 std::string fWindow; 00071 QFFT::WindowType fWindowType; 00072 bool fCoherentGain; 00073 }; 00074 00075 #endif