#include <HouseholderDecomposition.h>
Public Member Functions | |
HouseholderDecomposition (int squareMode_=5, int mineta_=1, int maxeta_=85, int minphi_=1, int maxphi_=20) | |
Default constructor. More... | |
int | indexSqr2Reg (const int &sqrIndex, const int &maxCeta, const int &maxCphi) |
Method to translate from square indices to region indices. More... | |
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) |
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) |
Run the Householder Algorithm. Returns the vector of calibration coefficients. More... | |
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. More... | |
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 ®Length=5) |
~HouseholderDecomposition () | |
Destructor. More... | |
Private Member Functions | |
bool | decompose () |
void | makeRegions (const int ®Length) |
void | solve (std::vector< float > &y) |
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. More... | |
Private Attributes | |
std::vector< float > | alpha |
int | countEvents |
std::vector< float > | energyVectorProc |
std::vector< std::vector< float > > | eventMatrixOrig |
std::vector< std::vector< float > > | eventMatrixProc |
int | maxeta |
int | maxphi |
int | mineta |
int | minphi |
int | Nchannels |
int | Neta |
int | Nevents |
int | Nphi |
int | Nxtals |
std::vector< int > | pivot |
std::vector< int > | regMaxEta |
std::vector< int > | regMaxPhi |
std::vector< int > | regMinEta |
std::vector< int > | regMinPhi |
float | sigmaReplacement |
int | squareMode |
Implementation of the QR decomposition of a matrix using Householder transformation
13.03.2007: R.Ofierzynski
Definition at line 19 of file HouseholderDecomposition.h.
HouseholderDecomposition::HouseholderDecomposition | ( | int | squareMode_ = 5 , |
int | mineta_ = 1 , |
||
int | maxeta_ = 85 , |
||
int | minphi_ = 1 , |
||
int | maxphi_ = 20 |
||
) |
Default constructor.
Definition at line 14 of file HouseholderDecomposition.cc.
References maxeta, maxphi, mineta, minphi, Nchannels, Neta, Nphi, Nxtals, sigmaReplacement, and squareMode.
HouseholderDecomposition::~HouseholderDecomposition | ( | ) |
|
private |
Make decomposition input: m=number of events, n=number of channels, qr=event matrix output: qr = transformed event matrix, alpha, pivot returns a boolean value, true if decomposition worked, false if it didn't
Definition at line 347 of file HouseholderDecomposition.cc.
References alpha, beta, eventMatrixProc, i, j, gen::k, Nchannels, Nevents, pivot, sigmaReplacement, mathSSE::sqrt(), and detailsBasic3DVector::y.
Referenced by iterate().
int HouseholderDecomposition::indexSqr2Reg | ( | const int & | sqrIndex, |
const int & | maxCeta, | ||
const int & | maxCphi | ||
) |
Method to translate from square indices to region indices.
Definition at line 529 of file HouseholderDecomposition.cc.
References maxeta, maxphi, mineta, minphi, and squareMode.
Referenced by recalibrateEvent(), runRegional(), and unzipMatrix().
std::vector< float > HouseholderDecomposition::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 |
||
) |
Run the Householder Algorithm several times (nIter). Returns the final vector of calibration coefficients. Comment from author: unless you do a new selection in between the iterations you don't need to run more than once; a second iteration on the same events does not improve the result in this case
Definition at line 134 of file HouseholderDecomposition.cc.
References i, j, Nchannels, Nevents, Nxtals, recalibrateEvent(), and pileupReCalc_HLTpaths::scale.
Referenced by ElectronCalibration::endJob(), ElectronCalibrationUniv::endJob(), and runRegional().
std::vector< float > HouseholderDecomposition::iterate | ( | const std::vector< std::vector< float > > & | eventMatrix, |
const std::vector< int > & | VmaxCeta, | ||
const std::vector< int > & | VmaxCphi, | ||
const std::vector< float > & | energyVectorOrig | ||
) |
Run the Householder Algorithm. Returns the vector of calibration coefficients.
Definition at line 193 of file HouseholderDecomposition.cc.
References alpha, gather_cfg::cout, decompose(), alignCSCRings::e, energyVectorProc, eventMatrixOrig, eventMatrixProc, i, j, Nchannels, Nevents, pivot, solve(), and unzipMatrix().
|
private |
Determines the regions used for splitting of the full matrix and calibrating separately used by the public runRegional method
Definition at line 579 of file HouseholderDecomposition.cc.
References abs, i, j, mineta, minphi, Neta, Nphi, regMaxEta, regMaxPhi, regMinEta, regMinPhi, and squareMode.
Referenced by runRegional().
std::vector< float > HouseholderDecomposition::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 at line 514 of file HouseholderDecomposition.cc.
References i, indexSqr2Reg(), and Nxtals.
Referenced by iterate(), and runRegional().
std::vector< float > HouseholderDecomposition::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 |
||
) |
Run Regional HouseholderAlgorithm (fast version), that splits matrix into regional matrices and inverts them separately. Returns the final vector of calibration coefficients. input: eventMatrix - the skimmed event matrix, VmaxCeta, VmaxCphi - vectors containing eta and phi indices of the maximum containment crystal for each event, energyVector - the energy vector, nIter - number of iterations to be performed, regLength - default length of the region (in eta- and phi-indices), regLength=5 recommended Comment from author: if you use the same events, 2 iterations are recommended; the second iteration gives corrections of the order of 0.0001
Definition at line 35 of file HouseholderDecomposition.cc.
References i, indexSqr2Reg(), iterate(), makeRegions(), maxeta, maxphi, mineta, minphi, Nchannels, Nevents, Nphi, Nxtals, recalibrateEvent(), regMaxEta, regMaxPhi, regMinEta, regMinPhi, and squareMode.
Referenced by ElectronCalibration::endJob(), and ElectronCalibrationUniv::endJob().
|
private |
Apply transformations to rhs output: r = residual vector (energy vector), y = solution
Definition at line 467 of file HouseholderDecomposition.cc.
References alpha, energyVectorProc, eventMatrixProc, i, j, Nchannels, Nevents, pivot, and detailsBasic3DVector::z.
Referenced by iterate().
|
private |
Unzips the skimmed matrix into a full matrix.
Definition at line 558 of file HouseholderDecomposition.cc.
References i, indexSqr2Reg(), gen::k, Nchannels, Nevents, and Nxtals.
Referenced by iterate().
|
private |
Definition at line 77 of file HouseholderDecomposition.h.
Referenced by decompose(), iterate(), and solve().
|
private |
Definition at line 71 of file HouseholderDecomposition.h.
|
private |
Definition at line 76 of file HouseholderDecomposition.h.
|
private |
Definition at line 74 of file HouseholderDecomposition.h.
Referenced by iterate().
|
private |
Definition at line 75 of file HouseholderDecomposition.h.
Referenced by decompose(), iterate(), and solve().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), indexSqr2Reg(), and runRegional().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), indexSqr2Reg(), and runRegional().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), indexSqr2Reg(), makeRegions(), and runRegional().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), indexSqr2Reg(), makeRegions(), and runRegional().
|
private |
Definition at line 73 of file HouseholderDecomposition.h.
Referenced by decompose(), HouseholderDecomposition(), iterate(), runRegional(), solve(), and unzipMatrix().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), and makeRegions().
|
private |
Definition at line 73 of file HouseholderDecomposition.h.
Referenced by decompose(), iterate(), runRegional(), solve(), and unzipMatrix().
|
private |
Definition at line 72 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), makeRegions(), and runRegional().
|
private |
Definition at line 73 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), iterate(), recalibrateEvent(), runRegional(), and unzipMatrix().
|
private |
Definition at line 78 of file HouseholderDecomposition.h.
Referenced by decompose(), iterate(), and solve().
|
private |
Definition at line 80 of file HouseholderDecomposition.h.
Referenced by makeRegions(), and runRegional().
|
private |
Definition at line 80 of file HouseholderDecomposition.h.
Referenced by makeRegions(), and runRegional().
|
private |
Definition at line 80 of file HouseholderDecomposition.h.
Referenced by makeRegions(), and runRegional().
|
private |
Definition at line 80 of file HouseholderDecomposition.h.
Referenced by makeRegions(), and runRegional().
|
private |
Definition at line 81 of file HouseholderDecomposition.h.
Referenced by decompose(), and HouseholderDecomposition().
|
private |
Definition at line 71 of file HouseholderDecomposition.h.
Referenced by HouseholderDecomposition(), indexSqr2Reg(), makeRegions(), and runRegional().