Blame view

src/ParamOutputImpl/Plot/Scatter/Histo2DFunction.hh 3.44 KB
5953671a   Erdogan Furkan   For now
1
/*
97f9b74e   Erdogan Furkan   #10776 - Density ...
2
 * Histo2Dfunction.hh
5953671a   Erdogan Furkan   For now
3
4
5
6
7
8
9
10
11
12
13
14
 *
 *  Created on: Jan 30, 2023
 *      Author: AKKODIS
 */

#ifndef HISTO2DFUNCTION_HH_
#define HISTO2DFUNCTION_HH_

#include <iostream>
#include <map>
#include <string>
#include "Matrix.hh"
34c311b3   Erdogan Furkan   Smooting works
15
#include "Range.hh"
5953671a   Erdogan Furkan   For now
16
17
18

namespace plot {

97f9b74e   Erdogan Furkan   #10776 - Density ...
19
20
21
22
/**
* Class that manages the function to apply on the 2Dhistogram
*/

5953671a   Erdogan Furkan   For now
23
24
25
26
27
28
29
class Histo2DFunction {
	public:
		Histo2DFunction(){

		}
		~Histo2DFunction(){}

4a5cc373   Erdogan Furkan   Added Mean and Ma...
30
		virtual void apply(MatrixGrid &matrixGrid, double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
34c311b3   Erdogan Furkan   Smooting works
31
32
										int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor) = 0;
		void applySmooth(MatrixGrid &matrixGrid, int smoothFactor, int columnSize );
5953671a   Erdogan Furkan   For now
33

97f9b74e   Erdogan Furkan   #10776 - Density ...
34
35
36
37
38
		virtual std::string getTextLegend()
		{
			return "";
		}

4a5cc373   Erdogan Furkan   Added Mean and Ma...
39
40
41
		std::map<int,std::vector<double>> getMatrixValues(double* xData, double* yData, double* zData, int nbData, 
																	Range xRange, Range yRange, int xBinNumber,int yBinNumber);

5953671a   Erdogan Furkan   For now
42
43
};

97f9b74e   Erdogan Furkan   #10776 - Density ...
44
45
46
47
/**
*  All the way down, different classes that apply a function on 2Dhistogram and return result
*/

5953671a   Erdogan Furkan   For now
48
49
50
51
52
class Density2DFunction : public Histo2DFunction {
public:
	Density2DFunction() {}
	~Density2DFunction() {}

4a5cc373   Erdogan Furkan   Added Mean and Ma...
53
	virtual void apply(MatrixGrid &matrixGrid, double* xData, double* yData, double* /*zData*/, int nbData, Range xRange, Range yRange,
34c311b3   Erdogan Furkan   Smooting works
54
						int xBinNumber,int yBinNumber,double& zMin, double& zMax, int smoothFactor);
97f9b74e   Erdogan Furkan   #10776 - Density ...
55
56
57
58
	virtual std::string getTextLegend()
	{
		return "Counts in bins";
	}
5953671a   Erdogan Furkan   For now
59
60
61
62
63
64
65
};

class Mean2DFunction : public Histo2DFunction {
public:
	Mean2DFunction() {}
	~Mean2DFunction() {}

4a5cc373   Erdogan Furkan   Added Mean and Ma...
66
67
	virtual void apply(MatrixGrid &matrixGrid,  double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
						int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor);
97f9b74e   Erdogan Furkan   #10776 - Density ...
68
69
70
71
	virtual std::string getTextLegend()
	{
		return "Mean on bins for ";
	}
4a5cc373   Erdogan Furkan   Added Mean and Ma...
72
73
74
75
76
77
78
79
};

class Max2DFunction : public Histo2DFunction {
public:
	Max2DFunction() {}
	~Max2DFunction() {}

	virtual void apply(MatrixGrid &matrixGrid,  double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
34c311b3   Erdogan Furkan   Smooting works
80
						int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor);
97f9b74e   Erdogan Furkan   #10776 - Density ...
81
82
83
84
	virtual std::string getTextLegend()
	{
		return "Max on bins for ";
	}
5953671a   Erdogan Furkan   For now
85
86
};

97f9b74e   Erdogan Furkan   #10776 - Density ...
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class Min2DFunction : public Histo2DFunction {
public:
	Min2DFunction() {}
	~Min2DFunction() {}

	virtual void apply(MatrixGrid &matrixGrid,  double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
						int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor);
	virtual std::string getTextLegend()
	{
		return "Min on bins for ";
	}
};

class Median2DFunction : public Histo2DFunction {
public:
	Median2DFunction() {}
	~Median2DFunction() {}

	virtual void apply(MatrixGrid &matrixGrid,  double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
						int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor);
	virtual std::string getTextLegend()
	{
		return "Median on bins for ";
	}
};

class StandardDeviation2DFunction : public Histo2DFunction {
public:
	StandardDeviation2DFunction() {}
	~StandardDeviation2DFunction() {}

	virtual void apply(MatrixGrid &matrixGrid,  double* xData, double* yData, double* zData, int nbData, Range xRange, Range yRange,
						int xBinNumber,int yBinNumber, double& zMin, double& zMax,int smoothFactor);
	virtual std::string getTextLegend()
	{
		return "Sta. deviation on bins for ";
	}
};
5953671a   Erdogan Furkan   For now
125
126
127
128
129


} /* namespace plot */

#endif /* HISTO2DFUNCTION_HH_ */