SignalProcessor.hh

00001 
00010 #ifndef __QSIGNAL_PROCESSOR_HH_
00011 #define __QSIGNAL_PROCESSOR_HH_
00012 
00013 
00014 #include "QVector.hh"
00015 
00016 using namespace Cuore;
00017 
00018 double f(double i, void* params);
00019 
00020 class TH1F;
00021 class TH2F;
00022 class TGraph;
00023 class TCanvas;
00024 
00025 class QSignalProcessor {
00026         public:
00027 
00028                 QSignalProcessor();
00029 
00030                 virtual ~QSignalProcessor();
00031 
00032                 void Dump();
00037                 void Smooth(QVector& v, QVector& r, unsigned int n);
00042                 void Derivate(QVector& v, QVector& r, QVector& er);
00048                 void FindPeaks(QVector& v, QVector& r, int debounce, double nSigma, int minPoints);
00054                 void FindPeaks(QVector& v, QVector& r, int debounceUp, int debounceDown, double nSigmaUp, double nSigmaDown, int minPoints, bool useAve, unsigned int derivDistance);
00059                 void SaveDiscontinuities();
00060                 /*
00061                  *  @brief Fill the @discAmpl vecotor with the amplitudes of the discoutinuities at points @discPoints
00062                  *
00063                  */
00064                 void EvaluateDiscontAmplitudes(QVector& v, QVector& discPoints, QVector& discAmpl, int halfNPoints);
00069                 TH1F* Plot(QVector& v);
00073                 TH2F* Plot2D(QVector& v, QVector& t);
00077                 TGraph* PlotGraph(QVector& v, QVector& t);
00078 
00084                 void PlaceMarkers(TCanvas& c, QVector& v);
00090                 void LookUp(QVector& lVec, QVector& indexes, QVector& res);
00091                 /*
00092                  * @brief calculate the standard deviation of the distribution
00093                  * contained in vector @param v
00094                  * nDiscard points from each end of the vector will be discarded
00095                  */
00096                 double GetStandardDev(QVector& v, int nDiscard = 0);
00097                 /*
00098                  * @brief calculate the momenta of the distribution
00099                  * contained in vector @param v
00100                  * nDiscard points from each end of the vector will be discarded
00101                  */
00102                 void ComputeMomenta(QVector& v, double &average, double &skew, double &adev, double &var, double &sdev, double& curt, int nDiscard = 0);
00103                 /*
00104                  * @brief calculate the average of the distribution
00105                  * contained in vector @param v
00106                  * nDiscard points from each end of the vector will be discarded
00107                  */
00108                 double GetAverage(QVector& v, int nDiscard = 0);
00109                 /*
00110                  * @brief calculate the mode of the distribution
00111                  * contained in vector @param v
00112                  */
00113                 double GetMode(QVector& v);
00114                 /*
00115                  * @brief calculate the median of the distribution
00116                  * contained in vector @param v
00117                  */
00118                 double GetMedian(QVector& v);
00119 
00120 
00121 
00122         private:
00123                 double Average(QVector& v, int index, unsigned int n);
00124                 int ElementsInRange(QVector& v, double min, double max);
00125 
00126                 double GetMax(QVector&);
00127                 double GetMin(QVector&);
00128 
00129 
00130 
00131 };
00132 
00133 #endif

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