File indexing completed on 2025-08-05 08:18:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "HMatrixU.h"
0021
0022 #include "IO.h"
0023
0024 #include <cassert>
0025 #include <alloca.h>
0026
0027
0028 namespace genfit {
0029
0030
0031
0032
0033 const TMatrixD& HMatrixU::getMatrix() const {
0034 static const double HMatrixContent[5] = {0, 0, 0, 1, 0};
0035
0036 static const TMatrixD HMatrix(1,5, HMatrixContent);
0037
0038 return HMatrix;
0039 }
0040
0041
0042 TVectorD HMatrixU::Hv(const TVectorD& v) const {
0043 assert (v.GetNrows() == 5);
0044
0045 double* retValArray =(double *)alloca(sizeof(double) * 1);
0046
0047 retValArray[0] = v(3);
0048
0049 return TVectorD(1, retValArray);
0050 }
0051
0052
0053 TMatrixD HMatrixU::MHt(const TMatrixDSym& M) const {
0054 assert (M.GetNcols() == 5);
0055
0056 double* retValArray =(double *)alloca(sizeof(double) * 5);
0057 const double* MatArray = M.GetMatrixArray();
0058
0059 for (unsigned int i=0; i<5; ++i) {
0060 retValArray[i] = MatArray[i*5 + 3];
0061 }
0062
0063 return TMatrixD(5,1, retValArray);
0064 }
0065
0066
0067 TMatrixD HMatrixU::MHt(const TMatrixD& M) const {
0068 assert (M.GetNcols() == 5);
0069
0070 double* retValArray =(double *)alloca(sizeof(double) * M.GetNrows());
0071 const double* MatArray = M.GetMatrixArray();
0072
0073 for (int i = 0; i < M.GetNrows(); ++i) {
0074 retValArray[i] = MatArray[i*5 + 3];
0075 }
0076
0077 return TMatrixD(M.GetNrows(),1, retValArray);
0078 }
0079
0080
0081 void HMatrixU::HMHt(TMatrixDSym& M) const {
0082 assert (M.GetNrows() == 5);
0083
0084 M(0,0) = M(3,3);
0085
0086 M.ResizeTo(1,1);
0087 }
0088
0089
0090 void HMatrixU::Print(const Option_t*) const {
0091 printOut << "U" << std::endl;
0092 }
0093
0094
0095 }