CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Calibration/Tools/interface/HouseholderDecomposition.h

Go to the documentation of this file.
00001 #ifndef HouseholderDecomposition_H
00002 #define HouseholderDecomposition_H
00003 
00016 #include <vector>
00017 #include <iostream>
00018 
00019 class HouseholderDecomposition
00020 {
00021 public:
00023   HouseholderDecomposition(int squareMode_ = 5, int mineta_ = 1, int maxeta_ = 85, int minphi_ = 1, int maxphi_ = 20);
00024 
00026   ~HouseholderDecomposition();
00027 
00036   std::vector<float> runRegional(const std::vector<std::vector<float> >& eventMatrix, const std::vector<int>& VmaxCeta, const std::vector<int>& VmaxCphi, const std::vector<float>& energyVector, const int& nIter, const int& regLength = 5);
00037 
00041   std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix, const std::vector<int>& VmaxCeta, const std::vector<int>& VmaxCphi, const std::vector<float>& energyVector, const int& nIter, const bool& normalizeFlag = false);
00042 
00044   std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix, const std::vector<int>& VmaxCeta, const std::vector<int>& VmaxCphi, const std::vector<float>& energyVectorOrig);
00045 
00047   std::vector<float> recalibrateEvent(const std::vector<float>& eventSquare, const int& maxCeta, const int& maxCphi, const std::vector<float>& recalibrateVector); 
00048 
00050   int indexSqr2Reg(const int& sqrIndex, const int& maxCeta, const int& maxCphi);
00051 
00052 
00053 private:
00058   bool decompose();  
00059 
00062   void solve(std::vector<float> &y);
00063 
00065   std::vector<std::vector<float> > unzipMatrix(const std::vector<std::vector<float> >& eventMatrix, const std::vector<int>& VmaxCeta, const std::vector<int>& VmaxCphi);
00066 
00069   void makeRegions(const int& regLength);
00070 
00071   int squareMode, countEvents;
00072   int mineta, maxeta, minphi, maxphi, Neta, Nphi;
00073   int Nchannels, Nxtals, Nevents;
00074   std::vector< std::vector<float> > eventMatrixOrig;
00075   std::vector< std::vector<float> > eventMatrixProc;
00076   std::vector<float> energyVectorProc;
00077   std::vector<float> alpha;
00078   std::vector<int> pivot;
00079 
00080   std::vector <int> regMinPhi, regMaxPhi, regMinEta, regMaxEta;
00081   float sigmaReplacement;
00082 };
00083 
00084 #endif // HouseholderDecomposition_H