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; 00095 // key: event type, value: ptr to histogram with event rate 00096 std::map<QApolloMonitorDefs::QMonitorEventType_t, TH1F*> fGhRate; 00097 00099 Double_t fTimeOfLastEventSec; 00100 00105 struct QEventInfo_t 00106 { 00107 TH1F* pulse; 00108 time_t time; 00109 unsigned int rate; 00110 QApolloMonitorDefs::QMonitorEventType_t type; 00111 }; 00112 00119 std::map<unsigned int, 00120 std::map<QApolloMonitorDefs::QMonitorEventType_t, 00121 TH1F*> > fChSpectra; 00122 00124 std::map<unsigned int,QEventInfo_t> fChPulses; 00125 00127 QMonitorHistogramWriter *fWriter; 00129 QMonitorConfigHandler *fConfigHandler; 00130 00135 bool CreateHistograms(); 00136 00140 void FillHistograms(const QEvent * event); 00141 00143 void UpdateFile(); 00144 00146 void DeleteHistograms(); 00147 00149 void GetListOfChannels(std::list<unsigned int>& channels); 00150 }; 00151 #endif