From 3ce5db8f1d16e85f120a5570239ab6e3110a11ff Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Thu, 14 Nov 2013 12:34:47 +0000 Subject: [PATCH] receiver complete change git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@688 951219d9-93cf-4727-9268-0efd64621fa3 --- .../slsDetectorAnalysis/movingStat.h | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/slsDetectorSoftware/slsDetectorAnalysis/movingStat.h b/slsDetectorSoftware/slsDetectorAnalysis/movingStat.h index 45b7a4058..c8daf505c 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/movingStat.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/movingStat.h @@ -5,7 +5,7 @@ #ifndef MOVINGSTAT_H #define MOVINGSTAT_H -#include "sls_detector_defs.h" +//#include "sls_detector_defs.h" #include #include @@ -17,6 +17,13 @@ #include using namespace std; + + +typedef double double32_t; +typedef float float32_t; +typedef int int32_t; + + /** @short class handling pedestal data and moves according to data */ @@ -32,24 +39,24 @@ public: /** * Clear number of data values */ - void Clear(){ + inline void Clear(){ m_n = 0; } /** * Set Pedestal */ - void SetN(int i) {n=i;}; + inline void SetN(int i) {n=i;}; /** * Get Pedestal */ - int GetN() {return n;}; + inline int GetN() {return n;}; /** * Calculate Pedestal */ - void Calc(double x) { + inline void Calc(double x) { if (m_n 0) ? m_newM/m_n : 0.0; } /** * Get mean 2 */ - double M2() const{ + inline double M2() const{ return ( (m_n > 1) ? m_newM2/m_n : 0.0 ); } /** * Get variance */ - double Variance() const{ + inline double Variance() const{ return ( (m_n > 1) ? (M2()-Mean()*Mean()) : 0.0 ); } /** * Get standard deviation */ - double StandardDeviation() const{ + inline double StandardDeviation() const{ return ( (Variance() > 0) ? sqrt( Variance() ) : -1 ); }