20 #include "HMatrixPhi.h"
37 HMatrixPhi::HMatrixPhi(
double phi) :
45 const TMatrixD& HMatrixPhi::getMatrix()
const {
46 static const double HMatrixContent[5] = {0, 0, 0, cosPhi_, sinPhi_};
48 static const TMatrixD HMatrix(1,5, HMatrixContent);
54 TVectorD HMatrixPhi::Hv(
const TVectorD& v)
const {
55 assert (v.GetNrows() == 5);
57 double* retValArray =(
double *)alloca(
sizeof(
double) * 1);
59 retValArray[0] = cosPhi_*v(3) + sinPhi_*v(4);
61 return TVectorD(1, retValArray);
65 TMatrixD HMatrixPhi::MHt(
const TMatrixDSym& M)
const {
66 assert (M.GetNcols() == 5);
68 double* retValArray =(
double *)alloca(
sizeof(
double) * 5);
69 const double* MatArray = M.GetMatrixArray();
71 for (
unsigned int i=0; i<5; ++i) {
72 retValArray[i] = cosPhi_*MatArray[i*5 + 3] + sinPhi_*MatArray[i*5 + 4];
75 return TMatrixD(5,1, retValArray);
79 TMatrixD HMatrixPhi::MHt(
const TMatrixD& M)
const {
80 assert (M.GetNcols() == 5);
82 double* retValArray =(
double *)alloca(
sizeof(
double) * M.GetNrows());
83 const double* MatArray = M.GetMatrixArray();
85 for (
int i = 0; i < M.GetNrows(); ++i) {
86 retValArray[i] = cosPhi_*MatArray[i*5 + 3] + sinPhi_*MatArray[i*5 + 4];
89 return TMatrixD(M.GetNrows(),1, retValArray);
93 void HMatrixPhi::HMHt(TMatrixDSym& M)
const {
94 assert (M.GetNrows() == 5);
96 M(0,0) = cosPhi_ * (cosPhi_*M(3,3) + sinPhi_*M(3,4))
97 + sinPhi_ * (cosPhi_*M(4,3) + sinPhi_*M(4,4));
103 bool HMatrixPhi::isEqual(
const AbsHMatrix& other)
const {
104 if (
dynamic_cast<const HMatrixPhi*
>(&other) ==
nullptr)
107 return (phi_ ==
static_cast<const HMatrixPhi*
>(&other)->phi_);
110 void HMatrixPhi::Print(
const Option_t*)
const
112 printOut <<
"phi = " << phi_ << std::endl;
115 void HMatrixPhi::Streamer(TBuffer &R__b) {
120 if (R__b.IsReading()) {
121 R__b.ReadClassBuffer(genfit::HMatrixPhi::Class(),
this);
125 R__b.WriteClassBuffer(genfit::HMatrixPhi::Class(),
this);
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization.
Defines for I/O streams used for error and debug printing.