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 "HMatrixV.h"
0021
0022 #include "IO.h"
0023
0024 #include <cassert>
0025 #include <alloca.h>
0026
0027 namespace genfit {
0028
0029
0030
0031
0032 const TMatrixD& HMatrixV::getMatrix() const {
0033 static const double HMatrixContent[5] = {0, 0, 0, 0, 1};
0034
0035 static const TMatrixD HMatrix(1,5, HMatrixContent);
0036
0037 return HMatrix;
0038 }
0039
0040
0041 TVectorD HMatrixV::Hv(const TVectorD& v) const {
0042 assert (v.GetNrows() == 5);
0043
0044 double* retValArray =(double *)alloca(sizeof(double) * 1);
0045
0046 retValArray[0] = v(4);
0047
0048 return TVectorD(1, retValArray);
0049 }
0050
0051
0052 TMatrixD HMatrixV::MHt(const TMatrixDSym& M) const {
0053 assert (M.GetNcols() == 5);
0054
0055 double* retValArray =(double *)alloca(sizeof(double) * 5);
0056 const double* MatArray = M.GetMatrixArray();
0057
0058 for (unsigned int i=0; i<5; ++i) {
0059 retValArray[i] = MatArray[i*5 + 4];
0060 }
0061
0062 return TMatrixD(5,1, retValArray);
0063 }
0064
0065
0066 TMatrixD HMatrixV::MHt(const TMatrixD& M) const {
0067 assert (M.GetNcols() == 5);
0068
0069 double* retValArray =(double *)alloca(sizeof(double) * M.GetNrows());
0070 const double* MatArray = M.GetMatrixArray();
0071
0072 for (int i = 0; i < M.GetNrows(); ++i) {
0073 retValArray[i] = MatArray[i*5 + 4];
0074 }
0075
0076 return TMatrixD(M.GetNrows(),1, retValArray);
0077 }
0078
0079
0080 void HMatrixV::HMHt(TMatrixDSym& M) const {
0081 assert (M.GetNrows() == 5);
0082
0083 M(0,0) = M(4,4);
0084
0085 M.ResizeTo(1,1);
0086 }
0087
0088
0089 void HMatrixV::Print(const Option_t*) const {
0090 printOut << "V" << std::endl;
0091 }
0092
0093 }