File indexing completed on 2025-08-05 08:18:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "ProlateSpacepointMeasurement.h"
0021
0022 #include <cmath>
0023
0024 #include "Exception.h"
0025 #include "RKTrackRep.h"
0026
0027
0028 namespace genfit {
0029
0030 ProlateSpacepointMeasurement::ProlateSpacepointMeasurement(int nDim)
0031 : SpacepointMeasurement(nDim), largestErrorDirection_(0,0,1)
0032 {
0033 ;
0034 }
0035
0036 ProlateSpacepointMeasurement::ProlateSpacepointMeasurement(const TVectorD& rawHitCoords, const TMatrixDSym& rawHitCov, int detId, int hitId, TrackPoint* trackPoint)
0037 : SpacepointMeasurement(rawHitCoords, rawHitCov, detId, hitId, trackPoint), largestErrorDirection_(0,0,1)
0038 {
0039 ;
0040 }
0041
0042
0043 SharedPlanePtr ProlateSpacepointMeasurement::constructPlane(const StateOnPlane& state) const {
0044
0045
0046 StateOnPlane st(state);
0047
0048
0049 const TVector3 wire1(rawHitCoords_(0), rawHitCoords_(1), rawHitCoords_(2));
0050
0051 const AbsTrackRep* rep = state.getRep();
0052 rep->extrapolateToLine(st, wire1, largestErrorDirection_);
0053
0054 TVector3 dirInPoca = rep->getMom(st);
0055 dirInPoca.SetMag(1.);
0056
0057
0058 if (fabs(largestErrorDirection_.Angle(dirInPoca)) < 0.01){
0059 Exception exc("ProlateSpacepointMeasurement::constructPlane(): Cannot construct detector plane, track direction is parallel to largest error direction", __LINE__,__FILE__);
0060 throw exc;
0061 }
0062
0063
0064 TVector3 U = largestErrorDirection_.Cross(dirInPoca);
0065
0066 return SharedPlanePtr(new DetPlane(wire1, U, largestErrorDirection_));
0067 }
0068
0069
0070 }