CMS 3D CMS Logo

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
HouseholderDecomposition::Nchannels
int Nchannels
Definition: HouseholderDecomposition.h:87
DDAxes::y
HouseholderDecomposition::Neta
int Neta
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::decompose
bool decompose()
Definition: HouseholderDecomposition.cc:315
HouseholderDecomposition::Nevents
int Nevents
Definition: HouseholderDecomposition.h:87
HouseholderDecomposition::minphi
int minphi
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::iterate
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)
Definition: HouseholderDecomposition.cc:123
HouseholderDecomposition::maxeta
int maxeta
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::Nphi
int Nphi
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::unzipMatrix
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.
Definition: HouseholderDecomposition.cc:508
HouseholderDecomposition::energyVectorProc
std::vector< float > energyVectorProc
Definition: HouseholderDecomposition.h:90
HouseholderDecomposition::mineta
int mineta
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::~HouseholderDecomposition
~HouseholderDecomposition()
Destructor.
Definition: HouseholderDecomposition.cc:28
HouseholderDecomposition::maxphi
int maxphi
Definition: HouseholderDecomposition.h:86
HouseholderDecomposition::regMaxEta
std::vector< int > regMaxEta
Definition: HouseholderDecomposition.h:94
HouseholderDecomposition::alpha
std::vector< float > alpha
Definition: HouseholderDecomposition.h:91
HouseholderDecomposition::indexSqr2Reg
int indexSqr2Reg(const int &sqrIndex, const int &maxCeta, const int &maxCphi)
Method to translate from square indices to region indices.
Definition: HouseholderDecomposition.cc:473
HouseholderDecomposition::countEvents
int countEvents
Definition: HouseholderDecomposition.h:85
HouseholderDecomposition::HouseholderDecomposition
HouseholderDecomposition(int squareMode_=5, int mineta_=1, int maxeta_=85, int minphi_=1, int maxphi_=20)
Default constructor.
Definition: HouseholderDecomposition.cc:12
HouseholderDecomposition::regMinPhi
std::vector< int > regMinPhi
Definition: HouseholderDecomposition.h:94
HouseholderDecomposition::solve
void solve(std::vector< float > &y)
Definition: HouseholderDecomposition.cc:420
HouseholderDecomposition::squareMode
int squareMode
Definition: HouseholderDecomposition.h:85
HouseholderDecomposition::recalibrateEvent
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.
Definition: HouseholderDecomposition.cc:458
HouseholderDecomposition::eventMatrixOrig
std::vector< std::vector< float > > eventMatrixOrig
Definition: HouseholderDecomposition.h:88
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HouseholderDecomposition::runRegional
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)
Definition: HouseholderDecomposition.cc:30
HouseholderDecomposition::sigmaReplacement
float sigmaReplacement
Definition: HouseholderDecomposition.h:95
HouseholderDecomposition::pivot
std::vector< int > pivot
Definition: HouseholderDecomposition.h:92
HouseholderDecomposition::regMaxPhi
std::vector< int > regMaxPhi
Definition: HouseholderDecomposition.h:94
HouseholderDecomposition::eventMatrixProc
std::vector< std::vector< float > > eventMatrixProc
Definition: HouseholderDecomposition.h:89
HouseholderDecomposition::Nxtals
int Nxtals
Definition: HouseholderDecomposition.h:87
HouseholderDecomposition
Definition: HouseholderDecomposition.h:17
HouseholderDecomposition::makeRegions
void makeRegions(const int &regLength)
Definition: HouseholderDecomposition.cc:529
HouseholderDecomposition::regMinEta
std::vector< int > regMinEta
Definition: HouseholderDecomposition.h:94