00001 #ifndef HouseholderDecomposition_H 00002 #define HouseholderDecomposition_H 00003 00016 #include <vector> 00017 #include <iostream> 00018 00019 using namespace std; 00020 00021 class HouseholderDecomposition 00022 { 00023 public: 00025 HouseholderDecomposition(int squareMode_ = 5, int mineta_ = 1, int maxeta_ = 85, int minphi_ = 1, int maxphi_ = 20); 00026 00028 ~HouseholderDecomposition(); 00029 00038 vector<float> runRegional(const vector<vector<float> >& eventMatrix, const vector<int>& VmaxCeta, const vector<int>& VmaxCphi, const vector<float>& energyVector, const int& nIter, const int& regLength = 5); 00039 00043 vector<float> iterate(const vector<vector<float> >& eventMatrix, const vector<int>& VmaxCeta, const vector<int>& VmaxCphi, const vector<float>& energyVector, const int& nIter, const bool& normalizeFlag = false); 00044 00046 vector<float> iterate(const vector<vector<float> >& eventMatrix, const vector<int>& VmaxCeta, const vector<int>& VmaxCphi, const vector<float>& energyVectorOrig); 00047 00049 vector<float> recalibrateEvent(const vector<float>& eventSquare, const int& maxCeta, const int& maxCphi, const vector<float>& recalibrateVector); 00050 00052 int indexSqr2Reg(const int& sqrIndex, const int& maxCeta, const int& maxCphi); 00053 00054 00055 private: 00060 bool decompose(); 00061 00064 void solve(vector<float> &y); 00065 00067 vector<vector<float> > unzipMatrix(const vector<vector<float> >& eventMatrix, const vector<int>& VmaxCeta, const vector<int>& VmaxCphi); 00068 00071 void makeRegions(const int& regLength); 00072 00073 int squareMode, countEvents; 00074 int mineta, maxeta, minphi, maxphi, Neta, Nphi; 00075 int Nchannels, Nxtals, Nevents; 00076 vector< vector<float> > eventMatrixOrig; 00077 vector< vector<float> > eventMatrixProc; 00078 vector<float> energyVectorProc; 00079 vector<float> alpha; 00080 vector<int> pivot; 00081 00082 vector <int> regMinPhi, regMaxPhi, regMinEta, regMaxEta; 00083 float sigmaReplacement; 00084 }; 00085 00086 #endif // HouseholderDecomposition_H