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

Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the coordinate along the wire. More...

#include <WireMeasurement.h>

Inheritance diagram for genfit::WireMeasurement:
Collaboration diagram for genfit::WireMeasurement:

Public Member Functions

 WireMeasurement (int nDim=7)
 
 WireMeasurement (const TVectorD &rawHitCoords, const TMatrixDSym &rawHitCov, int detId, int hitId, TrackPoint *trackPoint)
 
virtual ~WireMeasurement ()
 
virtual AbsMeasurementclone () const
 Deep copy ctor for polymorphic class.
 
virtual SharedPlanePtr constructPlane (const StateOnPlane &state) const
 
virtual std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane (const StateOnPlane &state) const
 
virtual const AbsHMatrixconstructHMatrix (const AbsTrackRep *) const
 
void setMaxDistance (double d)
 
void setLeftRightResolution (int lr)
 
double getMaxDistance ()
 
int getLeftRightResolution () 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
 

Protected Attributes

double maxDistance_
 
double leftRight_
 
- Protected Attributes inherited from genfit::AbsMeasurement
TVectorD rawHitCoords_
 
TMatrixDSym rawHitCov_
 
int detId_
 
int hitId_
 
TrackPointtrackPoint_
 Pointer to TrackPoint where the measurement belongs to.
 

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!
 

Detailed Description

Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the coordinate along the wire.

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

This hit class is not valid for any kind of plane orientation choice: to use it you MUST choose a plane described by u and v axes with v coincident with the wire (and u orthogonal to it, obviously). The hit will be described by 7 coordinates: w_x1, w_y1, w_z1, w_x2, w_y2, w_z2, rdrift where w_ji (with j = x, y, z and i = 1, 2) are the wire extremities coordinates; rdrift = distance from the wire (u coordinate in the plane)

Definition at line 52 of file WireMeasurement.h.

Constructor & Destructor Documentation

◆ WireMeasurement() [1/2]

genfit::WireMeasurement::WireMeasurement ( int  nDim = 7)

Definition at line 38 of file WireMeasurement.cc.

40{
41 assert(nDim >= 7);
42}

◆ WireMeasurement() [2/2]

genfit::WireMeasurement::WireMeasurement ( const TVectorD &  rawHitCoords,
const TMatrixDSym &  rawHitCov,
int  detId,
int  hitId,
TrackPoint trackPoint 
)

Definition at line 44 of file WireMeasurement.cc.

45 : AbsMeasurement(rawHitCoords, rawHitCov, detId, hitId, trackPoint), maxDistance_(2), leftRight_(0)
46{
47 assert(rawHitCoords_.GetNrows() >= 7);
48}

◆ ~WireMeasurement()

virtual genfit::WireMeasurement::~WireMeasurement ( )
inlinevirtual

Definition at line 58 of file WireMeasurement.h.

58{;}

Member Function Documentation

◆ clone()

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

Deep copy ctor for polymorphic class.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::WirePointMeasurement.

Definition at line 60 of file WireMeasurement.h.

60{return new WireMeasurement(*this);}

◆ constructHMatrix()

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

Returns a new AbsHMatrix object. Caller must take ownership.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::WirePointMeasurement.

Definition at line 124 of file WireMeasurement.cc.

124 {
125 if (dynamic_cast<const RKTrackRep*>(rep) == NULL) {
126 Exception exc("WireMeasurement default implementation can only handle state vectors of type RKTrackRep!", __LINE__,__FILE__);
127 throw exc;
128 }
129
130 return new HMatrixU();
131}

◆ constructMeasurementsOnPlane()

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

Hits with a small drift distance get a higher weight, whereas hits with big drift distances become weighted down. When these initial weights are used by the DAF, the smoothed track will be closer to the real trajectory than if both sides are weighted with 0.5 regardless of the drift distance. This helps a lot when resolving l/r ambiguities with the DAF. The idea is that for the first iteration of the DAF, the wire positions are taken. For small drift radii, the wire position does not bend the fit away from the trajectory, whereas the wire position for hits with large drift radii is further away from the trajectory and will therefore bias the fit if not weighted down.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::WirePointMeasurement.

Definition at line 89 of file WireMeasurement.cc.

90{
91 double mR = rawHitCoords_(6);
92 double mL = -mR;
93 double V = rawHitCov_(6,6);
94
95 MeasurementOnPlane* mopL = new MeasurementOnPlane(TVectorD(1, &mL),
96 TMatrixDSym(1, &V),
97 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
98
99 MeasurementOnPlane* mopR = new MeasurementOnPlane(TVectorD(1, &mR),
100 TMatrixDSym(1, &V),
101 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
102
103 // set left/right weights
104 if (leftRight_ < 0) {
105 mopL->setWeight(1);
106 mopR->setWeight(0);
107 }
108 else if (leftRight_ > 0) {
109 mopL->setWeight(0);
110 mopR->setWeight(1);
111 }
112 else {
113 double val = 0.5 * pow(std::max(0., 1 - mR/maxDistance_), 2.);
114 mopL->setWeight(val);
115 mopR->setWeight(val);
116 }
117
118 std::vector<MeasurementOnPlane*> retVal;
119 retVal.push_back(mopL);
120 retVal.push_back(mopR);
121 return retVal;
122}
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const

◆ constructPlane()

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

Construct (virtual) detector plane (use state's AbsTrackRep). It's possible to make corrections to the plane here. The state should be defined somewhere near the measurement. For virtual planes, the state will be extrapolated to the POCA to point (SpacepointMeasurement) or line (WireMeasurement), and from this info the plane will be constructed.

Implements genfit::AbsMeasurement.

Reimplemented in genfit::WirePointMeasurement.

Definition at line 50 of file WireMeasurement.cc.

50 {
51
52 // copy state. Neglect covariance.
53 StateOnPlane st(state);
54
55 TVector3 wire1(rawHitCoords_(0), rawHitCoords_(1), rawHitCoords_(2));
56 TVector3 wire2(rawHitCoords_(3), rawHitCoords_(4), rawHitCoords_(5));
57
58 //std::cout << " wire1(" << rawHitCoords_(0) << ", " << rawHitCoords_(1) << ", " << rawHitCoords_(2) << ")" << std::endl;
59 //std::cout << " wire2(" << rawHitCoords_(3) << ", " << rawHitCoords_(4) << ", " << rawHitCoords_(5) << ")" << std::endl;
60
61 // unit vector along the wire (V)
62 TVector3 wireDirection = wire2 - wire1;
63 wireDirection.SetMag(1.);
64
65 //std::cout << " wireDirection(" << wireDirection.X() << ", " << wireDirection.Y() << ", " << wireDirection.Z() << ")" << std::endl;
66
67 // point of closest approach
68 const AbsTrackRep* rep = state.getRep();
69 rep->extrapolateToLine(st, wire1, wireDirection);
70 const TVector3& poca = rep->getPos(st);
71 TVector3 dirInPoca = rep->getMom(st);
72 dirInPoca.SetMag(1.);
73 const TVector3& pocaOnWire = wire1 + wireDirection.Dot(poca - wire1)*wireDirection;
74
75 // check if direction is parallel to wire
76 if (fabs(wireDirection.Angle(dirInPoca)) < 0.01){
77 Exception exc("WireMeasurement::detPlane(): Cannot construct detector plane, direction is parallel to wire", __LINE__,__FILE__);
78 throw exc;
79 }
80
81 // construct orthogonal vector
82 TVector3 U = dirInPoca.Cross(wireDirection);
83 // U.SetMag(1.); automatically assured
84
85 return SharedPlanePtr(new DetPlane(pocaOnWire, U, wireDirection));
86}
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.

◆ getLeftRightResolution()

int genfit::WireMeasurement::getLeftRightResolution ( ) const
inline

Definition at line 91 of file WireMeasurement.h.

91{return leftRight_;}

◆ getMaxDistance()

double genfit::WireMeasurement::getMaxDistance ( )
inline

Definition at line 90 of file WireMeasurement.h.

90{return maxDistance_;}

◆ setLeftRightResolution()

void genfit::WireMeasurement::setLeftRightResolution ( int  lr)

select how to resolve the left/right ambiguity: -1: negative (left) side on vector (track direction) x (wire direction) 0: auto select (take side with smallest distance to track) 1: positive (right) side on vector (track direction) x (wire direction)

Definition at line 133 of file WireMeasurement.cc.

133 {
134 if (lr==0) leftRight_ = 0;
135 else if (lr<0) leftRight_ = -1;
136 else leftRight_ = 1;
137}

◆ setMaxDistance()

void genfit::WireMeasurement::setMaxDistance ( double  d)
inline

Set maximum drift distance. This is used to calculate the start weights of the two measurementsOnPlane.

Definition at line 81 of file WireMeasurement.h.

Member Data Documentation

◆ leftRight_

double genfit::WireMeasurement::leftRight_
protected

Definition at line 96 of file WireMeasurement.h.

◆ maxDistance_

double genfit::WireMeasurement::maxDistance_
protected

Definition at line 95 of file WireMeasurement.h.


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