Luiza  v03-01
GloriaClusterStatistics.h
1 // -*- mode: c++; mode: auto-fill; mode: flyspell-prog; -*-
2 
3 
4 #ifndef GloriaClusterStatistics_h
5 #define GloriaClusterStatistics_h 1
6 
7 /*
8  * This source code is part of the LUIZA software package for GLORIA.
9  * You are free to use this source files for your own development as
10  * long as it stays in a public research context. You are not
11  * allowed to use it for commercial purpose. You must put this
12  * header with author names in all development based on this file.
13  *
14  */
15 
16 namespace gloria {
17 
19 
29 
30  public:
31 
32 
35 
38 
40  void Clear();
41 
43 
51  void AddPixel(int ix, int iy, double signal);
52 
53 
55  inline int GetNpixel() { return _nPixel; };
56 
58  inline double GetSignal() { return _signal; };
59 
61  inline double GetXpos(){ return _sumX/_signal + _seedX; };
62 
64  inline double GetYpos(){ return _sumY/_signal + _seedY; };
65 
67  double GetXspread();
68 
70  double GetYspread();
71 
73  double GetXYcorr();
74 
76  double GetFWHM();
77 
79  double GetElongation();
80 
82  double GetOrientation();
83 
85  double GetLength();
86 
88  double GetWidth();
89 
90 
91 private:
92 
93  void CalculateAverages();
94 
95  // Number of pixels in the cluster
96  int _nPixel;
97 
98  // Position of first (seed?) pixel
99  // Used as offset for sum calculations
100  double _seedX, _seedY;
101 
102  // Total signal in the cluster
103  double _signal;
104 
105  // Weighted sums
106  double _sumX, _sumY, _sumXX, _sumYY, _sumXY;
107 
108  //Flag for doing basic statistics
109  bool _averDone;
110 
111  //Results of calculations
112  double _cogX, _cogY, _rmsX2, _rmsY2, _rmsX, _rmsY, _corrXY;
113  } ;
114 
115 
116 }
117 
118 #endif
119 
120 
121 
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
int GetNpixel()
Get cluster multiplicity (number of pixels)
Definition: GloriaClusterStatistics.h:55
~GloriaClusterStatistics()
Destructor.
Definition: GloriaClusterStatistics.cc:30
Class for calculating basic properties of pixel cluster.
Definition: GloriaClusterStatistics.h:28
void AddPixel(int ix, int iy, double signal)
Add pixel to the cluster.
Definition: GloriaClusterStatistics.cc:56
GloriaClusterStatistics()
Dummy constructor - creates empty cluster.
Definition: GloriaClusterStatistics.cc:22
double GetXspread()
Get cluster spread (RMS) in X.
Definition: GloriaClusterStatistics.cc:126
double GetYspread()
Get cluster spread (RMS) in Y.
Definition: GloriaClusterStatistics.cc:134
double GetWidth()
Get cluster width (length of secondary axis)
Definition: GloriaClusterStatistics.cc:212
double GetYpos()
Get cluster position (CoG) in Y.
Definition: GloriaClusterStatistics.h:64
double GetFWHM()
Get effective cluster width.
Definition: GloriaClusterStatistics.cc:151
double GetXYcorr()
Get X-Y correlation for the cluster.
Definition: GloriaClusterStatistics.cc:143
double GetXpos()
Get cluster position (CoG) in X.
Definition: GloriaClusterStatistics.h:61
double GetElongation()
Get cluster elongation.
Definition: GloriaClusterStatistics.cc:164
double GetLength()
Get cluster length (length of primary axis)
Definition: GloriaClusterStatistics.cc:193
double GetSignal()
Get cluster signal (sum of pixel signals)
Definition: GloriaClusterStatistics.h:58
double GetOrientation()
Get cluster orientation (direction of primary axis)
Definition: GloriaClusterStatistics.cc:183
void Clear()
Clear cluster statistics.
Definition: GloriaClusterStatistics.cc:37