32 TMatrixT<Double_t> returnMat(2,1);
34 TMatrixT<Double_t> _D(3,1);
38 _D[0][0] = (plane.
getO())[0];
39 _D[1][0] = (plane.
getO())[1];
40 _D[2][0] = (plane.
getO())[2];
51 returnMat[0][0] = _D[0][0] * _U[0] + _D[1][0] * _U[1] + _D[2][0] * _U[2];
52 returnMat[1][0] = _D[0][0] * _V[0] + _D[1][0] * _V[1] + _D[2][0] * _V[2];
62 TMatrixT<Double_t> returnMat(5,1);
64 TMatrixT<Double_t> _D(3,1);
68 _D[0][0] = (plane.
getO())[0];
69 _D[1][0] = (plane.
getO())[1];
70 _D[2][0] = (plane.
getO())[2];
81 returnMat[0][0] = _D[0][0] * _U[0] + _D[1][0] * _U[1] + _D[2][0] * _U[2];
82 returnMat[1][0] = _D[0][0] * _V[0] + _D[1][0] * _V[1] + _D[2][0] * _V[2];
101 TMatrixT<Double_t> jac(3,2);
111 TMatrixT<Double_t> jac_t = jac.T();
112 TMatrixT<Double_t> jac_orig = jac;
114 TMatrixT<Double_t>
result=jac_t * (rawCov * jac_orig);
133 std::vector <double> tmpRawCov;
134 tmpRawCov.push_back(rawCov[0][0]);
135 tmpRawCov.push_back(rawCov[1][1]);
136 tmpRawCov.push_back(rawCov[2][2]);
137 tmpRawCov.push_back(rawCov[2][1]);
139 static std::vector <double> oldRawCov(tmpRawCov);
140 static std::vector <double> oldOldRawCov(tmpRawCov);
142 rawCov.ResizeTo(7,7);
145 rawCov[0][0] = tmpRawCov[0];
146 rawCov[1][1] = tmpRawCov[1];
147 rawCov[2][2] = tmpRawCov[2];
148 rawCov[1][2] = tmpRawCov[3];
149 rawCov[2][1] = tmpRawCov[3];
153 TMatrixT<Double_t> jac(7,5);
163 Double_t mom = fabs(1.0/state[0][0]);
164 Double_t
beta = mom/sqrt(mass*mass+mom*mom);
165 dist = (plane.
getO()-planePrev.
getO()).Mag();
166 C = 0.0136/beta*sqrt(dist/14.0)*(1+0.038*log(dist/14.0));
174 rawCov[3][3] = (oldRawCov[0]+tmpRawCov[0])/
pow(dist,4.) *
182 pow((plane.
getO()-planePrev.
getO()).
Y(),2.) * (oldRawCov[1]+tmpRawCov[1]) +
183 pow((plane.
getO()-planePrev.
getO()).
Z(),2.) * (oldRawCov[2]+tmpRawCov[2])
187 3.0* (plane.
getO()-planePrev.
getO()).
X() * (plane.
getO()-planePrev.
getO()).
Y() * (plane.
getO()-planePrev.
getO()).
Z() /
pow(dist,5.) * (tmpRawCov[3] + oldRawCov[3])
190 rawCov[4][4] = (oldRawCov[1]+tmpRawCov[1])/
pow(dist,4.) *
198 pow((plane.
getO()-planePrev.
getO()).
X(),2.) * (oldRawCov[0]+tmpRawCov[0]) +
199 pow((plane.
getO()-planePrev.
getO()).
Z(),2.) * (oldRawCov[2]+tmpRawCov[2])
203 3.0* ( (plane.
getO()-planePrev.
getO()).
X() * (plane.
getO()-planePrev.
getO()).
Y() * (plane.
getO()-planePrev.
getO()).
Z() /
pow(dist,5.) + (plane.
getO()-planePrev.
getO()).
Z() /
pow(dist,3.) ) * ( tmpRawCov[3] + oldRawCov[3] )
206 rawCov[5][5] = (oldRawCov[2]+tmpRawCov[2])/
pow(dist,4.) *
214 pow((plane.
getO()-planePrev.
getO()).
Y(),2.) * (oldRawCov[0]+tmpRawCov[0])+
215 pow((plane.
getO()-planePrev.
getO()).
X(),2.) * (oldRawCov[1]+tmpRawCov[1])
219 3.0* ( (plane.
getO()-planePrev.
getO()).
X() * (plane.
getO()-planePrev.
getO()).
Y() * (plane.
getO()-planePrev.
getO()).
Z() /
pow(dist,5.) + (plane.
getO()-planePrev.
getO()).
Y() /
pow(dist,3.) ) * ( tmpRawCov[3] + oldRawCov[3] )
224 Double_t d1 = (plane.
getO()-planePrev.
getO()).Mag();
225 Double_t d2 = (planePrev.
getO()-planePrevPrev.
getO()).Mag();
232 pow(((planePrev.
getO()-planePrevPrev.
getO()).
X()*d1*d2 -
233 num * (plane.
getO()-planePrev.
getO()).
X() *d2/d1) /
234 pow(d1,2.0)/
pow(d2,2.0),2.0) * tmpRawCov[0] +
235 pow(((planePrev.
getO()-planePrevPrev.
getO()).
Y()*d1*d2 +
236 num * (plane.
getO()-planePrev.
getO()).
Y() *d2/d1) /
237 pow(d1,2.0)/
pow(d2,2.0),2.0) * tmpRawCov[1] +
238 pow(((planePrev.
getO()-planePrevPrev.
getO()).
Z()*d1*d2 +
239 num * (plane.
getO()-planePrev.
getO()).
Z() *d2/d1) /
240 pow(d1,2.0)/
pow(d2,2.0),2.0) * tmpRawCov[2] +
243 num * (planePrev.
getO()-planePrevPrev.
getO()).
X() *d1/d2) /
244 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldOldRawCov[0] +
246 num * (planePrev.
getO()-planePrevPrev.
getO()).
Y() *d1/d2) /
247 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldOldRawCov[1] +
249 num * (planePrev.
getO()-planePrevPrev.
getO()).
Z() *d1/d2) /
250 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldOldRawCov[2] +
253 num * (plane.
getO()-planePrev.
getO()).
X() *d2/d1 +
254 num * (planePrev.
getO()-planePrevPrev.
getO()).
X() *d1/d2
256 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldRawCov[0] +
258 num * (plane.
getO()-planePrev.
getO()).
Y() *d2/d1 +
259 num * (planePrev.
getO()-planePrevPrev.
getO()).
Y() *d1/d2
261 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldRawCov[1] +
263 num * (plane.
getO()-planePrev.
getO()).
Z() *d2/d1 +
264 num * (planePrev.
getO()-planePrevPrev.
getO()).
Z() *d1/d2
266 pow(d1,2.0)/
pow(d2,2.0),2.0) * oldRawCov[2]
284 3.*(planePrevPrev.
getO()-planePrev.
getO()).
Y() * (planePrevPrev.
getO()-planePrev.
getO()).
Z() * num /
pow(d1,5.)/d2
289 ( (plane.
getO()-planePrev.
getO()).
Y() - (planePrev.
getO()-planePrevPrev.
getO()).
Y() ) *
291 (planePrev.
getO()-planePrevPrev.
getO()).
Z()/
pow(d2,3.)/d1
295 (-(planePrev.
getO()-planePrevPrev.
getO()).
Z() +
299 ( -3.* (plane.
getO()-planePrev.
getO()).
Z()*d1*d2 +
300 (planePrev.
getO()-planePrevPrev.
getO()).
Z()*
pow(d1,3.)/d2
302 ) /
pow(d1,6.) /
pow(d2,2.)
304 (planePrev.
getO()-planePrevPrev.
getO()).
Y()*
306 (-(planePrev.
getO()-planePrevPrev.
getO()).
Z() +
310 ( 3.* (planePrev.
getO()-planePrevPrev.
getO()).
Z()*d1*d2 -
313 ) /
pow(d1,2.) /
pow(d2,6.)
318 Double_t
theta(TMath::ACos((plane.
getO()-planePrev.
getO()).Unit() * (planePrev.
getO()-planePrevPrev.
getO()).Unit()));
319 rawCov[6][6] = TMath::Min(
pow(dcosTh,2.)/
pow(TMath::Sin(theta),2.),
pow(TMath::Pi()/2.0,2.));
323 if (d1 == 0 || d2 == 0)
325 rawCov[3][3] =
pow(0.2,2.0);
326 rawCov[4][4] =
pow(0.2,2.0);
327 rawCov[5][5] =
pow(0.2,2.0);
328 rawCov[6][6] =
pow(0.1,2.0);
330 C = 0.0136/beta*sqrt(dist/14.0)*(1+0.038*log(dist/14.0));
336 TVector3 u=plane.
getU();
337 TVector3 v=plane.
getV();
338 TVector3
w=u.Cross(v);
344 double pTildeMag = pTilde.Mag();
359 jac[3][1] = 1.0/pTildeMag*(u.X()-pTilde.X()/(pTildeMag*pTildeMag)*u*pTilde);
360 jac[4][1] = 1.0/pTildeMag*(u.Y()-pTilde.Y()/(pTildeMag*pTildeMag)*u*pTilde);
361 jac[5][1] = 1.0/pTildeMag*(u.Z()-pTilde.Z()/(pTildeMag*pTildeMag)*u*pTilde);
363 jac[3][2] = 1.0/pTildeMag*(v.X()-pTilde.X()/(pTildeMag*pTildeMag)*v*pTilde);
364 jac[4][2] = 1.0/pTildeMag*(v.Y()-pTilde.Y()/(pTildeMag*pTildeMag)*v*pTilde);
365 jac[5][2] = 1.0/pTildeMag*(v.Z()-pTilde.Z()/(pTildeMag*pTildeMag)*v*pTilde);
367 TMatrixT<Double_t> jac_orig = jac;
368 TMatrixT<Double_t> jac_t = jac.T();
370 TMatrixT<Double_t>
result=jac_t * (rawCov * jac_orig);
375 oldOldRawCov = oldRawCov;
376 oldRawCov = tmpRawCov;
377 planePrevPrev = planePrev;
386 TVector3 point(rawcoord[0][0],rawcoord[1][0],rawcoord[2][0]);
388 TVector3 poca,dirInPoca;
double beta(double KE, const simb::MCParticle *part)
void setO(const TVector3 &o)
TMatrixT< Double_t > getRawHitCoord() const
Get raw hit coordinates.
TMatrixT< double > hitCoord(GFAbsRecoHit *, const GFDetPlane &)
Hit coordinates in detector plane.
Base Class for genfit track representations. Defines interface for track parameterizations.
TVector3 getNormal() const
TMatrixT< double > hitCov(GFAbsRecoHit *, const GFDetPlane &)
Hit covariances in detector plane.
static const std::string fPolicyName
virtual void extrapolateToPoint(const TVector3 &point, TVector3 &poca, TVector3 &normVec)
This method is to extrapolate the track to point of closest approach to a point in space...
Detector simulation of raw signals on wires.
const GFDetPlane & detPlane(GFAbsRecoHit *, GFAbsTrackRep *)
Get detector plane perpendicular to track.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
void setNormal(TVector3 n)
TMatrixT< Double_t > getRawHitCov() const
Get raw hit covariances.