CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HouseholderDecomposition.h
Go to the documentation of this file.
1 #ifndef HouseholderDecomposition_H
2 #define HouseholderDecomposition_H
3 
14 #include <vector>
15 #include <iostream>
16 
18 public:
20  HouseholderDecomposition(int squareMode_ = 5, int mineta_ = 1, int maxeta_ = 85, int minphi_ = 1, int maxphi_ = 20);
21 
24 
33  std::vector<float> runRegional(const std::vector<std::vector<float> >& eventMatrix,
34  const std::vector<int>& VmaxCeta,
35  const std::vector<int>& VmaxCphi,
36  const std::vector<float>& energyVector,
37  const int& nIter,
38  const int& regLength = 5);
39 
43  std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix,
44  const std::vector<int>& VmaxCeta,
45  const std::vector<int>& VmaxCphi,
46  const std::vector<float>& energyVector,
47  const int& nIter,
48  const bool& normalizeFlag = false);
49 
51  std::vector<float> iterate(const std::vector<std::vector<float> >& eventMatrix,
52  const std::vector<int>& VmaxCeta,
53  const std::vector<int>& VmaxCphi,
54  const std::vector<float>& energyVectorOrig);
55 
57  std::vector<float> recalibrateEvent(const std::vector<float>& eventSquare,
58  const int& maxCeta,
59  const int& maxCphi,
60  const std::vector<float>& recalibrateVector);
61 
63  int indexSqr2Reg(const int& sqrIndex, const int& maxCeta, const int& maxCphi);
64 
65 private:
70  bool decompose();
71 
74  void solve(std::vector<float>& y);
75 
77  std::vector<std::vector<float> > unzipMatrix(const std::vector<std::vector<float> >& eventMatrix,
78  const std::vector<int>& VmaxCeta,
79  const std::vector<int>& VmaxCphi);
80 
83  void makeRegions(const int& regLength);
84 
88  std::vector<std::vector<float> > eventMatrixOrig;
89  std::vector<std::vector<float> > eventMatrixProc;
90  std::vector<float> energyVectorProc;
91  std::vector<float> alpha;
92  std::vector<int> pivot;
93 
94  std::vector<int> regMinPhi, regMaxPhi, regMinEta, regMaxEta;
96 };
97 
98 #endif // HouseholderDecomposition_H
void solve(std::vector< float > &y)
std::vector< std::vector< float > > eventMatrixProc
std::vector< float > recalibrateEvent(const std::vector< float > &eventSquare, const int &maxCeta, const int &maxCphi, const std::vector< float > &recalibrateVector)
Recalibrate before next iteration: give previous solution vector as argument.
void makeRegions(const int &regLength)
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)
int indexSqr2Reg(const int &sqrIndex, const int &maxCeta, const int &maxCphi)
Method to translate from square indices to region indices.
std::vector< float > energyVectorProc
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)
std::vector< std::vector< float > > unzipMatrix(const std::vector< std::vector< float > > &eventMatrix, const std::vector< int > &VmaxCeta, const std::vector< int > &VmaxCphi)
Unzips the skimmed matrix into a full matrix.
HouseholderDecomposition(int squareMode_=5, int mineta_=1, int maxeta_=85, int minphi_=1, int maxphi_=20)
Default constructor.
std::vector< std::vector< float > > eventMatrixOrig