00001 00050 #ifndef _M_APOLLO_HISTO_MAKER_H_ 00051 #define _M_APOLLO_HISTO_MAKER_H_ 00052 00053 #include "QModule.hh" 00054 #include "QEvent.hh" 00055 #include "QRawEvent.hh" 00056 #include "QCuore.hh" 00057 00058 #include <string> 00059 #include <time.h> 00060 #include <list> 00061 00062 class TH1F; 00063 class TH1D; 00064 00065 class MApolloHistoMaker : public QModule { 00066 public: 00067 MApolloHistoMaker(QSequence *s); 00068 00069 virtual ~MApolloHistoMaker(); 00070 00071 // Init method is called before event loop 00072 virtual void Init(); 00073 00074 // Doit method is called for each event, getting the event as argument 00075 virtual QEvent* Do( QEvent* ev); 00076 00077 // Done method is called after event loop 00078 virtual void Done(); 00079 00080 private: 00081 00082 std::string fPath; 00083 std::string fCfgFile; 00084 std::string fLockFile; 00085 bool fDoHistos; 00086 bool fFirstEvent; 00087 int fRun; 00088 int fCurrentChannel; 00089 time_t fLastUpdate; 00090 std::vector<unsigned short> fLgList; 00091 00096 bool CreateHistograms(); 00097 00101 void FillHistograms(const QEvent * event); 00102 00114 bool CheckUpdate(); 00115 00117 void UpdateFile(); 00118 00120 void DeleteHistograms(); 00121 00123 void GetListOfChannels(std::list<unsigned short>& channels); 00124 00125 // one pointer for each general histogram 00126 TH1F* fGhRate; 00138 TH1D* fGhTime; 00139 00140 struct QEventInfo_t 00141 { 00142 TH1F* pulse; 00143 time_t time; 00144 unsigned int rate; 00145 }; 00146 00147 // one map for each channel based histogram 00148 std::map<unsigned short,TH1F*> fChSpectra; 00149 std::map<unsigned short,QEventInfo_t> fChPulses; 00150 }; 00151 #endif