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

Class for measurements implementing a space point hit geometry. More...

#include <SpacepointMeasurement.h>

Inheritance diagram for genfit::SpacepointMeasurement:
Collaboration diagram for genfit::SpacepointMeasurement:

Public Member Functions

 SpacepointMeasurement (int nDim=3)
 
 SpacepointMeasurement (const TVectorD &rawHitCoords, const TMatrixDSym &rawHitCov, int detId, int hitId, TrackPoint *trackPoint, bool weightedPlaneContruction=true, bool cutCov=true)
 
virtual ~SpacepointMeasurement ()
 
virtual AbsMeasurementclone () const
 Deep copy ctor for polymorphic class.
 
virtual SharedPlanePtr constructPlane (const StateOnPlane &state) const
 Contruct the virtual detector plane.
 
virtual std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane (const StateOnPlane &state) const
 
virtual const AbsHMatrixconstructHMatrix (const AbsTrackRep *) const
 
- Public Member Functions inherited from genfit::AbsMeasurement
 AbsMeasurement ()
 
 AbsMeasurement (int nDims)
 
 AbsMeasurement (const TVectorD &rawHitCoords, const TMatrixDSym &rawHitCov, int detId, int hitId, TrackPoint *trackPoint)
 
virtual ~AbsMeasurement ()
 
TrackPointgetTrackPoint () const
 
void setTrackPoint (TrackPoint *tp)
 
const TVectorD & getRawHitCoords () const
 
const TMatrixDSym & getRawHitCov () const
 
int getDetId () const
 
int getHitId () const
 
unsigned int getDim () const
 
void setDetId (int detId)
 
void setHitId (int hitId)
 
virtual void Print (const Option_t *="") const
 

Private Member Functions

void initG ()
 

Private Attributes

bool weightedPlaneContruction_
 
TMatrixDSym G_
 
bool cutCov_
 inverse of 3x3 cov
 

Additional Inherited Members

- Protected Member Functions inherited from genfit::AbsMeasurement
 AbsMeasurement (const AbsMeasurement &)
 protect from calling copy c'tor from outside the class. Use clone() if you want a copy!
 
- Protected Attributes inherited from genfit::AbsMeasurement
TVectorD rawHitCoords_
 
TMatrixDSym rawHitCov_
 
int detId_
 
int hitId_
 
TrackPointtrackPoint_
 Pointer to TrackPoint where the measurement belongs to.
 

Detailed Description

Class for measurements implementing a space point hit geometry.

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)
Johannes Rauch (Technische Universität München, original author)

For a space point the detector plane has to be defined with respect to a track representation. SpacepointMeasurement implements a scheme where the detectorplane is chosen perpendicular to the track. In a track fit, only two of the three coordinates of a space point are independent (the track is a one-dimensional object). Therefore the 3D data of the hit is used to define a proper detector plane into which the hit coordinates are then projected.

Definition at line 46 of file SpacepointMeasurement.h.

Constructor & Destructor Documentation

◆ SpacepointMeasurement() [1/2]

genfit::SpacepointMeasurement::SpacepointMeasurement ( int  nDim = 3)

Definition at line 33 of file SpacepointMeasurement.cc.

34 : AbsMeasurement(nDim), weightedPlaneContruction_(true), G_(3), cutCov_(true)
35{
36 assert(nDim >= 3);
37
38 //this->initG();
39}

◆ SpacepointMeasurement() [2/2]

genfit::SpacepointMeasurement::SpacepointMeasurement ( const TVectorD &  rawHitCoords,
const TMatrixDSym &  rawHitCov,
int  detId,
int  hitId,
TrackPoint trackPoint,
bool  weightedPlaneContruction = true,
bool  cutCov = true 
)

Definition at line 41 of file SpacepointMeasurement.cc.

43 : AbsMeasurement(rawHitCoords, rawHitCov, detId, hitId, trackPoint),
44 weightedPlaneContruction_(weightedPlaneContruction), cutCov_(cutCov)
45{
46 assert(rawHitCoords_.GetNrows() >= 3);
47
49 this->initG();
50}

◆ ~SpacepointMeasurement()

virtual genfit::SpacepointMeasurement::~SpacepointMeasurement ( )
inlinevirtual

Definition at line 53 of file SpacepointMeasurement.h.

53{;}

Member Function Documentation

◆ clone()

virtual AbsMeasurement * genfit::SpacepointMeasurement::clone ( ) const
inlinevirtual

Deep copy ctor for polymorphic class.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::ProlateSpacepointMeasurement, and genfit::mySpacepointMeasurement.

Definition at line 55 of file SpacepointMeasurement.h.

55{return new SpacepointMeasurement(*this);}

◆ constructHMatrix()

const AbsHMatrix * genfit::SpacepointMeasurement::constructHMatrix ( const AbsTrackRep ) const
virtual

Returns a new AbsHMatrix object. Caller must take ownership.

Implements genfit::AbsMeasurement.

Definition at line 120 of file SpacepointMeasurement.cc.

120 {
121 if (dynamic_cast<const RKTrackRep*>(rep) == NULL) {
122 Exception exc("SpacepointMeasurement default implementation can only handle state vectors of type RKTrackRep!", __LINE__,__FILE__);
123 throw exc;
124 }
125
126 return new HMatrixUV();
127}

◆ constructMeasurementsOnPlane()

std::vector< MeasurementOnPlane * > genfit::SpacepointMeasurement::constructMeasurementsOnPlane ( const StateOnPlane state) const
virtual

Construct MeasurementOnPlane on plane of the state and wrt the states TrackRep. The state will usually be the prediction or reference state, and has to be defined AT the measurement. The AbsMeasurement will be projected onto the plane. It's possible to make corrections to the coordinates here (e.g. by using the state coordinates). Usually the vector will contain only one element. But in the case of e.g. a WireMeasurement, it will be 2 (left and right).

Implements genfit::AbsMeasurement.

Definition at line 69 of file SpacepointMeasurement.cc.

70{
71 MeasurementOnPlane* mop = new MeasurementOnPlane(TVectorD(2),
72 TMatrixDSym(3), // will be resized to 2x2 by Similarity later
73 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
74
75 TVectorD& m = mop->getState();
76 TMatrixDSym& V = mop->getCov();
77
78 const TVector3& o(state.getPlane()->getO());
79 const TVector3& u(state.getPlane()->getU());
80 const TVector3& v(state.getPlane()->getV());
81
82 // m
83 m(0) = (rawHitCoords_(0)-o.X()) * u.X() +
84 (rawHitCoords_(1)-o.Y()) * u.Y() +
85 (rawHitCoords_(2)-o.Z()) * u.Z();
86
87 m(1) = (rawHitCoords_(0)-o.X()) * v.X() +
88 (rawHitCoords_(1)-o.Y()) * v.Y() +
89 (rawHitCoords_(2)-o.Z()) * v.Z();
90
91 //
92 // V
93 //
94 V = rawHitCov_;
95
96 // jac = dF_i/dx_j = s_unitvec * t_untivec, with s=u,v and t=x,y,z
97 TMatrixD jac(3,2);
98 jac(0,0) = u.X();
99 jac(1,0) = u.Y();
100 jac(2,0) = u.Z();
101 jac(0,1) = v.X();
102 jac(1,1) = v.Y();
103 jac(2,1) = v.Z();
104
105 if (cutCov_) { // cut (default)
107 V.SimilarityT(jac);
109 }
110 else { // projection
111 V.SimilarityT(jac);
112 }
113
114 std::vector<MeasurementOnPlane*> retVal;
115 retVal.push_back(mop);
116 return retVal;
117}
Double_t m
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const
void invertMatrix(const TMatrixDSym &mat, TMatrixDSym &inv, double *determinant=NULL)
Invert a matrix, throwing an Exception when inversion fails. Optional calculation of determinant.
Definition Tools.cc:38

◆ constructPlane()

SharedPlanePtr genfit::SpacepointMeasurement::constructPlane ( const StateOnPlane state) const
virtual

Contruct the virtual detector plane.

Per default, the plane will be constructed such that it contains the measurement and POCA to the measurement in cartesian space. The plane is perpendicular to the track (at the POCA).

If weightedPlaneContruction_ is set, the POCA will be calculated in a space weighted with the inverse of the 3D covariance. E.g. if the covariance is very oblate, the plane will be almost defined by the covariance shape. If the covariance is very prolate, the behaviour will be very similar to the ProlateSpacepointHit.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::ProlateSpacepointMeasurement.

Definition at line 53 of file SpacepointMeasurement.cc.

53 {
54
55 // copy state. Neglect covariance.
56 StateOnPlane st(state);
57
58 const TVector3 point(rawHitCoords_(0), rawHitCoords_(1), rawHitCoords_(2));
59
61 st.extrapolateToPoint(point, G_);
62 else
63 st.extrapolateToPoint(point);
64
65 return st.getPlane();
66}

◆ initG()

void genfit::SpacepointMeasurement::initG ( )
private

Definition at line 130 of file SpacepointMeasurement.cc.

130 {
131 rawHitCov_.GetSub(0, 2, G_);
133}

Member Data Documentation

◆ cutCov_

bool genfit::SpacepointMeasurement::cutCov_
private

inverse of 3x3 cov

Definition at line 79 of file SpacepointMeasurement.h.

◆ G_

TMatrixDSym genfit::SpacepointMeasurement::G_
private

Definition at line 78 of file SpacepointMeasurement.h.

◆ weightedPlaneContruction_

bool genfit::SpacepointMeasurement::weightedPlaneContruction_
private

Definition at line 77 of file SpacepointMeasurement.h.


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