20 #include "WirePointMeasurement.h"
22 #include <Exception.h>
23 #include <RKTrackRep.h>
24 #include <HMatrixUV.h>
32 WirePointMeasurement::WirePointMeasurement(
int nDim)
33 : WireMeasurement(nDim)
38 WirePointMeasurement::WirePointMeasurement(
const TVectorD& rawHitCoords,
const TMatrixDSym& rawHitCov,
int detId,
int hitId, TrackPoint* trackPoint)
39 : WireMeasurement(rawHitCoords, rawHitCov, detId, hitId, trackPoint)
41 assert(rawHitCoords_.GetNrows() >= 8);
50 TVector3 wire1(rawHitCoords_(0), rawHitCoords_(1), rawHitCoords_(2));
51 TVector3 wire2(rawHitCoords_(3), rawHitCoords_(4), rawHitCoords_(5));
54 TVector3 wireDirection = wire2 - wire1;
55 wireDirection.SetMag(1.);
61 TVector3 dirInPoca = rep->
getMom(st);
66 if (fabs(wireDirection.Angle(dirInPoca)) < 0.01){
67 Exception exc(
"WireMeasurement::detPlane(): Cannot construct detector plane, direction is parallel to wire", __LINE__,__FILE__);
72 TVector3 U = dirInPoca.Cross(wireDirection);
79 std::vector<MeasurementOnPlane*> WirePointMeasurement::constructMeasurementsOnPlane(
const StateOnPlane& state)
const
83 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
85 mopR->getState()(0) = rawHitCoords_(6);
86 mopR->getState()(1) = rawHitCoords_(7);
88 mopR->getCov()(0,0) = rawHitCov_(6,6);
89 mopR->getCov()(1,0) = rawHitCov_(7,6);
90 mopR->getCov()(0,1) = rawHitCov_(6,7);
91 mopR->getCov()(1,1) = rawHitCov_(7,7);
95 mopL->getState()(0) *= -1;
102 else if (leftRight_ > 0) {
107 double val = 0.5 * pow(std::max(0., 1 - rawHitCoords_(6)/maxDistance_), 2.);
108 mopL->setWeight(val);
109 mopR->setWeight(val);
112 std::vector<MeasurementOnPlane*> retVal;
113 retVal.push_back(mopL);
114 retVal.push_back(mopR);
119 if (
dynamic_cast<const RKTrackRep*
>(rep) ==
nullptr) {
120 Exception exc(
"WirePointMeasurement default implementation can only handle state vectors of type RKTrackRep!", __LINE__,__FILE__);
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Abstract base class for a track representation.
virtual double extrapolateToLine(StateOnPlane &state, const TVector3 &linePoint, const TVector3 &lineDirection, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a line, and returns the extrapolation length and,...
virtual TVector3 getMom(const StateOnPlane &state) const =0
Get the cartesian momentum vector of a state.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
AbsHMatrix implementation for two-dimensional MeasurementOnPlane and RKTrackRep parameterization.
Measured coordinates on a plane.
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v)
A state with arbitrary dimension defined in a DetPlane.
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.