#ifndef TAvgRMSPlot_hxx__ #define TAvgRMSPlot_hxx__ #include #include #include #include #include #include #include #include #include #include #include /// Class to represent mean and rms /// of several measurements. class IAvgRMSPlot{ public: int fN; ///< Number of samples double fsum; ///< sum of samples double fsum2; ///< sum squared of samples double fmean; ///< mean of samples double frms; ///< rms of samples float fmin; ///< minimum sample float fmax; ///< maximum sample std::vector fTime; ///< vector of time readings converted to double std::vector fVals; ///< vector of reading values std::string fName; ///< variable name for plots TGraph * fGraph; ///< TGraph of variable. TH1F * fHist; ///< TH1F of variable. int fX0; ///< root taxis time offset bool fIsInteger; ///< Flag to say if this should be an integer quantity /// constructor IAvgRMSPlot(); ~IAvgRMSPlot(){;} ///< destructor /// Method to add data to be averaged / rms'd /// set last to true to do the mean, rms calculation void Add( long atime, double aval, bool alast=false ); /// Print the statistics on a set of measurements void Print(const char * avname, bool doprint=true ); /// Get TGraph time offset due to day light savings time /// messing things up int GetDSTOffset( long atime ); /// Plot the variable vs Time /// Make sure to call Print with /// a name input before calling this method void MakePlot(const char * atagname, bool saveplot=true); }; #endif