QMonitorHistogramWriter.hh

Go to the documentation of this file.
00001 
00002 #ifndef _Q_MONITOR_HISTOGRAM_WRITER_HH_
00003 #define _Q_MONITOR_HISTOGRAM_WRITER_HH_
00004 
00005 #include "QCuore.hh"
00006 #include "QError.hh"
00007 #include "QApolloMonitorDefs.hh"
00008 
00009 #include <Rtypes.h>
00010 #include <TH1F.h>
00011 #include <TH1D.h>
00012 
00013 #include <string>
00014 #include <map>
00015 
00016 
00030 class QMonitorHistogramWriter
00031 {
00032 public:
00033    
00035    QMonitorHistogramWriter();
00036    
00038    virtual ~QMonitorHistogramWriter();
00039    
00041    bool Write(const std::string& fileName);
00042    
00044    const QError& GetError() const { return fError; }
00045 
00047    bool SetTimeSec(Double_t timeSec);
00048 
00050    bool SetTimeUnix(time_t timeUnix);
00051 
00053    bool SetSamplingRate(Int_t rate);
00054    
00056    bool SetLgChannel(Int_t channel);
00057 
00059    bool SetEventType(QApolloMonitorDefs::QMonitorEventType_t type);
00060 
00062    bool SetPulse(const TH1F* pulse);
00063 
00065    bool SetRateHistogram(const TH1F* rateHisto,
00066                          QApolloMonitorDefs::QMonitorEventType_t type);
00067 
00069    bool SetSpectrum(const TH1F* spectrum,
00070                     QApolloMonitorDefs::QMonitorEventType_t type);
00071 
00073    void Reset()
00074    { fBareVariables.clear(); fHistograms.clear(); }
00075 
00076 private:
00078    QError fError;
00079 
00081    std::map<QApolloMonitorDefs::QMonitorVariable_t, Double_t> fBareVariables;
00082 
00087    std::map<std::string, const TH1F*> fHistograms;
00088 
00096    TH1D fVariablesHisto;
00097 
00099    void ResetError()
00100    { if(fError != QERR_SUCCESS) fError.Set(QERR_SUCCESS, ""); }
00101 };
00102 #endif

Generated on Tue Nov 16 10:49:59 2010 for CUORE Software by  doxygen 1.5.6