00001 00002 #ifndef _M_APOLLO_HISTO_MAKER_H_ 00003 #define _M_APOLLO_HISTO_MAKER_H_ 00004 00005 #include "QModule.hh" 00006 #include "QEvent.hh" 00007 #include "QRawEvent.hh" 00008 #include "QCuore.hh" 00009 #include "QApolloMonitorDefs.hh" 00010 00011 #include <string> 00012 #include <time.h> 00013 #include <list> 00014 00015 class TH1F; 00016 class TH1D; 00017 class QMonitorHistogramWriter; 00018 class QMonitorConfigHandler; 00019 00067 class MApolloHistoMaker : public QModule 00068 { 00069 public: 00071 MApolloHistoMaker(QSequence *s); 00072 00074 virtual ~MApolloHistoMaker(); 00075 00077 virtual void Init(); 00078 00080 virtual QEvent* Do( QEvent* ev); 00081 00083 virtual void Done(); 00084 00085 private: 00086 00087 std::string fPath; 00088 std::string fCfgFile; 00089 std::string fLockFile; 00090 bool fDoHistos; 00091 bool fFirstEvent; 00092 int fRun; 00093 int fCurrentChannel; 00094 int fSpectrumMaxMv; 00095 double fSpectrumBinWidthMv; 00098 std::map<QApolloMonitorDefs::QMonitorEventType_t, TH1F*> fGhRate; 00099 00101 Double_t fTimeOfLastEventSec; 00102 00107 struct QEventInfo_t 00108 { 00109 TH1F* pulse; 00110 time_t time; 00111 unsigned int rate; 00112 QApolloMonitorDefs::QMonitorEventType_t type; 00113 }; 00114 00121 std::map<unsigned int, 00122 std::map<QApolloMonitorDefs::QMonitorEventType_t, 00123 TH1F*> > fChSpectra; 00124 00126 std::map<unsigned int,QEventInfo_t> fChPulses; 00127 00129 QMonitorHistogramWriter *fWriter; 00131 QMonitorConfigHandler *fConfigHandler; 00132 00137 bool CreateHistograms(); 00138 00142 void FillHistograms(const QEvent * event); 00143 00145 void UpdateFile(); 00146 00148 void DeleteHistograms(); 00149 00151 void GetListOfChannels(std::list<unsigned int>& channels); 00152 }; 00153 #endif