SND@LHC Software
Loading...
Searching...
No Matches
genfit::HMatrixPhi Class Reference

AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...

#include <HMatrixPhi.h>

Inheritance diagram for genfit::HMatrixPhi:
Collaboration diagram for genfit::HMatrixPhi:

Public Member Functions

 HMatrixPhi (double phi=0)
 
const TMatrixD & getMatrix () const
 Get the actual matrix representation.
 
TVectorD Hv (const TVectorD &v) const
 H*v.
 
TMatrixD MHt (const TMatrixDSym &M) const
 M*H^t.
 
TMatrixD MHt (const TMatrixD &M) const
 
void HMHt (TMatrixDSym &M) const
 similarity: H*M*H^t
 
virtual AbsHMatrixclone () const
 
virtual bool isEqual (const AbsHMatrix &other) const
 
- Public Member Functions inherited from genfit::AbsHMatrix
 AbsHMatrix ()
 
virtual ~AbsHMatrix ()
 
bool operator== (const AbsHMatrix &other) const
 
bool operator!= (const AbsHMatrix &other) const
 
virtual void Print (const Option_t *="") const
 

Public Attributes

ClassDef(HMatrixPhi, 1) private double cosPhi_
 
double sinPhi_
 

Additional Inherited Members

- Protected Member Functions inherited from genfit::AbsHMatrix
 AbsHMatrix (const AbsHMatrix &o)
 
AbsHMatrixoperator= (const AbsHMatrix &)
 

Detailed Description

AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization.

For one dimensional measurements which are rotated by phi against U of the DetPlane H = (0, 0, 0, cos(phi), sin(phi))

Definition at line 37 of file HMatrixPhi.h.

Constructor & Destructor Documentation

◆ HMatrixPhi()

genfit::HMatrixPhi::HMatrixPhi ( double  phi = 0)

Definition at line 33 of file HMatrixPhi.cc.

33 :
34 phi_(phi),
35 cosPhi_(cos(phi)),
36 sinPhi_(sin(phi))
37{
38 ;
39}
ClassDef(HMatrixPhi, 1) private double cosPhi_
Definition HMatrixPhi.h:56

Member Function Documentation

◆ clone()

virtual AbsHMatrix * genfit::HMatrixPhi::clone ( ) const
inlinevirtual

Implements genfit::AbsHMatrix.

Definition at line 52 of file HMatrixPhi.h.

52{return new HMatrixPhi(*this);}
HMatrixPhi(double phi=0)
Definition HMatrixPhi.cc:33

◆ getMatrix()

const TMatrixD & genfit::HMatrixPhi::getMatrix ( ) const
virtual

Get the actual matrix representation.

Implements genfit::AbsHMatrix.

Definition at line 41 of file HMatrixPhi.cc.

41 {
42 static const double HMatrixContent[5] = {0, 0, 0, cosPhi_, sinPhi_};
43
44 static const TMatrixD HMatrix(1,5, HMatrixContent);
45
46 return HMatrix;
47}

◆ HMHt()

void genfit::HMatrixPhi::HMHt ( TMatrixDSym &  M) const
virtual

similarity: H*M*H^t

Reimplemented from genfit::AbsHMatrix.

Definition at line 89 of file HMatrixPhi.cc.

89 {
90 assert (M.GetNrows() == 5);
91
92 M(0,0) = cosPhi_ * (cosPhi_*M(3,3) + sinPhi_*M(3,4))
93 + sinPhi_ * (cosPhi_*M(4,3) + sinPhi_*M(4,4));
94
95 M.ResizeTo(1,1);
96}

◆ Hv()

TVectorD genfit::HMatrixPhi::Hv ( const TVectorD &  v) const
virtual

H*v.

Reimplemented from genfit::AbsHMatrix.

Definition at line 50 of file HMatrixPhi.cc.

50 {
51 assert (v.GetNrows() == 5);
52
53 double* retValArray =(double *)alloca(sizeof(double) * 1);
54
55 retValArray[0] = cosPhi_*v(3) + sinPhi_*v(4);
56
57 return TVectorD(1, retValArray);
58}

◆ isEqual()

bool genfit::HMatrixPhi::isEqual ( const AbsHMatrix other) const
virtual

Implements genfit::AbsHMatrix.

Definition at line 99 of file HMatrixPhi.cc.

99 {
100 if (dynamic_cast<const HMatrixPhi*>(&other) == NULL)
101 return false;
102
103 return (phi_ == static_cast<const HMatrixPhi*>(&other)->phi_);
104}

◆ MHt() [1/2]

TMatrixD genfit::HMatrixPhi::MHt ( const TMatrixD &  M) const
virtual

Reimplemented from genfit::AbsHMatrix.

Definition at line 75 of file HMatrixPhi.cc.

75 {
76 assert (M.GetNcols() == 5);
77
78 double* retValArray =(double *)alloca(sizeof(double) * M.GetNrows());
79 const double* MatArray = M.GetMatrixArray();
80
81 for (int i = 0; i < M.GetNrows(); ++i) {
82 retValArray[i] = cosPhi_*MatArray[i*5 + 3] + sinPhi_*MatArray[i*5 + 4];
83 }
84
85 return TMatrixD(M.GetNrows(),1, retValArray);
86}
int i
Definition ShipAna.py:86

◆ MHt() [2/2]

TMatrixD genfit::HMatrixPhi::MHt ( const TMatrixDSym &  M) const
virtual

M*H^t.

Reimplemented from genfit::AbsHMatrix.

Definition at line 61 of file HMatrixPhi.cc.

61 {
62 assert (M.GetNcols() == 5);
63
64 double* retValArray =(double *)alloca(sizeof(double) * 5);
65 const double* MatArray = M.GetMatrixArray();
66
67 for (unsigned int i=0; i<5; ++i) {
68 retValArray[i] = cosPhi_*MatArray[i*5 + 3] + sinPhi_*MatArray[i*5 + 4];
69 }
70
71 return TMatrixD(5,1, retValArray);
72}

Member Data Documentation

◆ cosPhi_

ClassDef (HMatrixPhi,1) private double genfit::HMatrixPhi::cosPhi_

Definition at line 61 of file HMatrixPhi.h.

◆ sinPhi_

double genfit::HMatrixPhi::sinPhi_

Definition at line 62 of file HMatrixPhi.h.


The documentation for this class was generated from the following files: