File indexing completed on 2024-04-06 11:59:28
0001 #ifndef HouseholderDecomposition_H
0002 #define HouseholderDecomposition_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <vector>
0015 #include <iostream>
0016
0017 class HouseholderDecomposition {
0018 public:
0019
0020 HouseholderDecomposition(int squareMode_ = 5, int mineta_ = 1, int maxeta_ = 85, int minphi_ = 1, int maxphi_ = 20);
0021
0022
0023 ~HouseholderDecomposition();
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 std::vector<float> runRegional(const std::vector<std::vector<float> >& eventMatrix,
0034 const std::vector<int>& VmaxCeta,
0035 const std::vector<int>& VmaxCphi,
0036 const std::vector<float>& energyVector,
0037 const int& nIter,
0038 const int& regLength = 5);
0039
0040
0041
0042
0043 std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix,
0044 const std::vector<int>& VmaxCeta,
0045 const std::vector<int>& VmaxCphi,
0046 const std::vector<float>& energyVector,
0047 const int& nIter,
0048 const bool& normalizeFlag = false);
0049
0050
0051 std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix,
0052 const std::vector<int>& VmaxCeta,
0053 const std::vector<int>& VmaxCphi,
0054 const std::vector<float>& energyVectorOrig);
0055
0056
0057 std::vector<float> recalibrateEvent(const std::vector<float>& eventSquare,
0058 const int& maxCeta,
0059 const int& maxCphi,
0060 const std::vector<float>& recalibrateVector);
0061
0062
0063 int indexSqr2Reg(const int& sqrIndex, const int& maxCeta, const int& maxCphi);
0064
0065 private:
0066
0067
0068
0069
0070 bool decompose();
0071
0072
0073
0074 void solve(std::vector<float>& y);
0075
0076
0077 std::vector<std::vector<float> > unzipMatrix(const std::vector<std::vector<float> >& eventMatrix,
0078 const std::vector<int>& VmaxCeta,
0079 const std::vector<int>& VmaxCphi);
0080
0081
0082
0083 void makeRegions(const int& regLength);
0084
0085 int squareMode, countEvents;
0086 int mineta, maxeta, minphi, maxphi, Neta, Nphi;
0087 int Nchannels, Nxtals, Nevents;
0088 std::vector<std::vector<float> > eventMatrixOrig;
0089 std::vector<std::vector<float> > eventMatrixProc;
0090 std::vector<float> energyVectorProc;
0091 std::vector<float> alpha;
0092 std::vector<int> pivot;
0093
0094 std::vector<int> regMinPhi, regMaxPhi, regMinEta, regMaxEta;
0095 float sigmaReplacement;
0096 };
0097
0098 #endif