43 InDet::TRT_DriftCircleCollection::const_iterator& sb,
44 InDet::TRT_DriftCircleCollection::const_iterator& se,
45 std::pair<Amg::Vector3D,double>& gp,
46 const double* dir,
double width2)
67 InDet::TRT_DriftCircleCollection::const_iterator& sb,
68 InDet::TRT_DriftCircleCollection::const_iterator& se,
69 std::pair<Amg::Vector3D,double>& gp,
70 const double* dir,
double width2)
91(
double dw, std::pair<Amg::Vector3D,double>& gp)
97 double x = gp.first.x();
98 double y = gp.first.y();
99 double z = gp.first.z();
113 m_zMin =
C.z() - rb->halflengthY();
114 m_zMax =
C.z() + rb->halflengthY();
115 double d = std::abs(
z -
C.z());
116 if (d > rb->halflengthY() + dw) {
148 InDet::TRT_DriftCircleCollection::const_iterator& sb,
149 InDet::TRT_DriftCircleCollection::const_iterator& se,
150 std::pair<Amg::Vector3D, double>& gp,
157 double x = gp.first.x();
158 double y = gp.first.y();
159 double z = gp.first.z();
163 double step = std::abs(dir[0] * T(0, 2) + dir[1] * T(1, 2) + dir[2] * T(2, 2));
164 step > .05 ? step = 1. / step : step = 20.;
170 for (
int ns = 0; ns != Nstraws; ++ns) {
178 double d = dx * dx + dy * dy;
183 double Az[3] = { t(0, 2), t(1, 2), t(2, 2) };
184 double D = dir[0] * Az[0] + dir[1] * Az[1] + dir[2] * Az[2];
185 double A = (1. - D) * (1. + D);
186 double dz =
z - t(2, 3);
187 double S = (dx * (D * Az[0] - dir[0]) + dy * (D * Az[1] - dir[1]) +
188 dz * (D * Az[2] - dir[2])) /
193 double Bx = Az[1] * dir[2] - Az[2] * dir[1];
194 double By = Az[2] * dir[0] - Az[0] * dir[2];
195 double Bz = Az[0] * dir[1] - Az[1] * dir[0];
197 (dx * Bx + dy * By + dz * Bz) / std::sqrt(Bx * Bx + By * By + Bz * Bz);
198 double zl = dx * Az[0] + dy * Az[1] + dz * Az[2];
201 if (
y * xs -
x * ys > 0.) {
211 for (
int ns = 0; ns != Nstraws; ++ns) {
217 double as =
m_radius / std::sqrt(xs * xs + ys * ys);
218 double dx =
x - xs * as;
219 double dy =
y - ys * as;
220 double d = dx * dx + dy * dy;
226 double Az[3] = { t(0, 2), t(1, 2), t(2, 2) };
227 double D = dir[0] * Az[0] + dir[1] * Az[1] + dir[2] * Az[2];
228 double A = (1. - D) * (1. + D);
232 double S = (dx * (D * Az[0] - dir[0]) + dy * (D * Az[1] - dir[1]) +
233 dz * (D * Az[2] - dir[2])) /
238 double Bx = Az[1] * dir[2] - Az[2] * dir[1];
239 double By = Az[2] * dir[0] - Az[0] * dir[2];
240 double Bz = Az[0] * dir[1] - Az[1] * dir[0];
242 (dx * Bx + dy * By + dz * Bz) / std::sqrt(Bx * Bx + By * By + Bz * Bz);
243 double zl = dx * Az[0] + dy * Az[1] + dz * Az[2];
246 if (
y * xs -
x * ys > 0.) {
260 for (; sb != se; ++sb) {
262 int ns =
m_trtid->straw((*sb)->identify());
264 for (
int l = 0; l !=
m_nlinks; ++l) {
271 double d =
m_link[l].distance();
294(InDet::TRT_DriftCircleCollection::const_iterator& sb,
295 InDet::TRT_DriftCircleCollection::const_iterator& se,
296 std::pair<Amg::Vector3D,double>& gp,
297 const double* dir,
double width2)
302 double x = gp.first.x();
303 double y = gp.first.y();
304 double z = gp.first.z();
309 std::abs(dir[0] * T(0, 2) + dir[1] * T(1, 2) + dir[2] * T(2, 2));
310 step > .05 ? step = 1. / step : step = 20.;
315 for (
int ns = 0; ns != Nstraws; ++ns) {
323 double d = dx * dx + dy * dy;
328 double Az[3] = { t(0, 2), t(1, 2), t(2, 2) };
329 double D = dir[0] * Az[0] + dir[1] * Az[1] + dir[2] * Az[2];
330 double A = (1. - D) * (1. + D);
331 double dz =
z - t(2, 3);
332 double S = (dx * (D * Az[0] - dir[0]) + dy * (D * Az[1] - dir[1]) +
333 dz * (D * Az[2] - dir[2])) /
338 double Bx = Az[1] * dir[2] - Az[2] * dir[1];
339 double By = Az[2] * dir[0] - Az[0] * dir[2];
340 double Bz = Az[0] * dir[1] - Az[1] * dir[0];
342 (dx * Bx + dy * By + dz * Bz) / std::sqrt(Bx * Bx + By * By + Bz * Bz);
343 double zl = dx * Az[0] + dy * Az[1] + dz * Az[2];
346 if (
y * xs -
x * ys > 0.){
360 for (
int ns = 0; ns != Nstraws; ++ns) {
366 double as =
m_radius / std::sqrt(xs * xs + ys * ys);
367 double dx =
x - xs * as;
368 double dy =
y - ys * as;
369 double d = dx * dx + dy * dy;
375 double Az[3] = { t(0, 2), t(1, 2), t(2, 2) };
376 double D = dir[0] * Az[0] + dir[1] * Az[1] + dir[2] * Az[2];
377 double A = 1. / ((1. - D) * (1. + D));
381 double Dx = (D * Az[0] - dir[0]);
382 double Dy = (D * Az[1] - dir[1]);
383 double S = (dx * Dx + dy * Dy + dz * (D * Az[2] - dir[2])) *
A;
387 double Bx = Az[1] * dir[2] - Az[2] * dir[1];
388 double By = Az[2] * dir[0] - Az[0] * dir[2];
389 double Bz = Az[0] * dir[1] - Az[1] * dir[0];
390 double B = 1. / std::sqrt(Bx * Bx + By * By + Bz * Bz);
391 double im = (dx * Bx + dy * By + dz * Bz) * B;
392 double zl = dx * Az[0] + dy * Az[1] + dz * Az[2];
396 double dS = (ax * Dx + ay * Dy) *
A;
397 double sx = ax + dir[0] * dS;
398 double sy = ay + dir[1] * dS;
399 double sd = (sx * Bx + sy * By) * B;
400 double sz = sx * Az[0] + sy * Az[1];
402 if (
y * xs -
x * ys > 0.) {
404 sd = -std::abs(im + sd) - d;
407 sd = std::abs(im + sd) - d;
422 for (; sb != se; ++sb) {
424 int ns =
m_trtid->straw((*sb)->identify());
426 for (
int l = 0; l !=
m_nlinks; ++l) {
432 double d =
m_link[l].distance();
456(
double a,
double b,
bool& useDriftTime,
bool& hole)
461 hole =
false;
if(!
m_nlinks)
return false;
466 double d =
m_link[l].distance()-v;
467 double ad = std::abs(d);
469 if(ad > 2.05)
continue;
471 if(!
m_link[l].cluster()) {
480 if(!useDriftTime)
return true;
485 if(
r > 2.05)
r = 2.05;
486 double r2 =
r+e;
if(r2 > 2.05) r2 = 2.05;
487 double r1 =
r-e;
if(r1 >= r2) r1 = r2-2.*e;
489 if(ad < r1 || ad > r2) useDriftTime =
false;
else m_status = 2;
502(
double a,
double b,
bool& useDriftTime,
bool& hole)
506 hole =
false;
if(
m_bestlink < 0)
return false;
510 double d =
m_link[l].distance()-v;
511 double ad = std::abs(d);
513 if(ad > 2.05)
return false;
515 if(!
m_link[l].cluster()) {
523 if(!useDriftTime)
return true;
528 if(
r > 2.05)
r = 2.05;
529 double r2 =
r+e;
if(r2 > 2.05) r2 = 2.05;
530 double r1 =
r-e;
if(r1 >= r2) r1 = r2-2.*e;
531 if(ad < r1 || ad > r2) useDriftTime =
false;
else m_status = 2;
548 double d = std::abs(
m_link[l].distance()-v);
566 (&(
m_link[l].cluster()->detectorElement())->surface(
m_link[l].cluster()->identify()));
569 return m_riomakerD->correct(*
m_link[l].cluster(),Tp, Gaudi::Hive::currentContext());
571 return m_riomakerN->correct(*
m_link[l].cluster(),Tp, Gaudi::Hive::currentContext());
578std::unique_ptr<Trk::RIO_OnTrack>
606 (Gaudi::Hive::currentContext(),
631 if(Q && Xi2 < 15.)
return Q;
650 if( l<0 )
return false;
654 double Az[3] = {t(0,2),t(1,2),t(2,2)};
655 double Rc[3] = {t(0,3),t(1,3),t(2,3)};
659 if(std::abs(Az[2]) > .7) {
661 double Ri = 1./std::sqrt(Rc[0]*Rc[0]+Rc[1]*Rc[1]);
662 Bx =-Az[2]*Rc[1]*Ri; By = Az[2]*Rc[0]*Ri;
664 else if(Rc[2] > 0. ) {
666 Bx = Az[1]; By =-Az[0];
670 Bx =-Az[1]; By = Az[0];
672 double zl =
m_link[l].zlocal();
673 double im =
m_link[l].impact();
674 G[0] = zl*Az[0]+Bx*im+Rc[0];
675 G[1] = zl*Az[1]+By*im+Rc[1];
676 G[2] = zl*Az[2] +Rc[2];
690 if(!E1)
return false;
698 int mode; Wa[0] > Wa[1] ? mode=0 : mode=1;
704 double dx = Gp[1][0]-Gp[0][0];
705 double dy = Gp[1][1]-Gp[0][1];
708 Gp[2][2] = Gp[0][2]-(Gp[1][2]-Gp[0][2])*std::sqrt((Gp[0][0]*Gp[0][0]+Gp[0][1]*Gp[0][1])/(dx*dx+dy*dy));
713 double x0 = Gp[0][0] ;
714 double y0 = Gp[0][1] ;
715 double x1 = Gp[1][0]-x0 ;
716 double y1 = Gp[1][1]-y0 ;
717 double x2 = Gp[2][0]-x0 ;
718 double y2 = Gp[2][1]-y0 ;
719 double r1 = std::sqrt(x1*x1+y1*y1) ;
721 double r2 = 1./(x2*x2+y2*y2) ;
724 double u2 = (a*x2+b*y2)*r2 ;
725 double v2 = (a*y2-b*x2)*r2 ;
726 double A = v2/(u2-u1) ;
727 double B = 2.*(v2-
A*u2) ;
728 double C = B/std::sqrt(1.+
A*
A) ;
746 double pos0[3]; pos0[0]=Gp[0][0]; pos0[1]=Gp[0][1]; pos0[2]=Gp[0][2];
747 double pos1[3]; pos1[0]=Gp[1][0]; pos1[1]=Gp[1][1]; pos1[2]=Gp[1][2];
748 double pos2[3]; pos2[0]=Gp[2][0]; pos2[1]=Gp[2][1]; pos2[2]=Gp[2][2];
756 double Hz = .333333*(H0[2]+H1[2]+
H2[2]);
761 double T2 = TP[0]*TP[0];
762 if(std::abs(Hz)>1.e-9) {Cm = 1./(300.*Hz*std::sqrt(1.+T2)); P[4] = -
C*Cm;}
766 double wa; mode != 2 ? wa = 1./(Wa[0]-Wa[2]) : wa = 1./Wa[1];
767 const double dS = 4. ;
770 double dp = 8.*df*wa*Cm ;
773 double c2 = df*df*(1.+T2);
794 if(!E1)
return false;
801 double dx = Gp[2][0]-Gp[1][0];
802 double dy = Gp[2][1]-Gp[1][1];
805 Gp[0][2] = Gp[1][2]-(Gp[2][2]-Gp[1][2])*std::sqrt((Gp[1][0]*Gp[1][0]+Gp[1][1]*Gp[1][1])/(dx*dx+dy*dy));
808 double x0 = Gp[0][0] ;
809 double y0 = Gp[0][1] ;
810 double x1 = Gp[1][0]-x0 ;
811 double y1 = Gp[1][1]-y0 ;
812 double x2 = Gp[2][0]-x0 ;
813 double y2 = Gp[2][1]-y0 ;
814 double r1 = std::sqrt(x1*x1+y1*y1) ;
816 double r2 = 1./(x2*x2+y2*y2) ;
819 double u2 = (a*x2+b*y2)*r2 ;
820 double v2 = (a*y2-b*x2)*r2 ;
821 double A = v2/(u2-u1) ;
822 double B = 2.*(v2-
A*u2) ;
823 double C = B/std::sqrt(1.+
A*
A) ;
831 double P[5] = {0.,Gp[0][2],f,atan2(1.,TP[0]),.0001};
833 double pos0[3]; pos0[0]=Gp[0][0]; pos0[1]=Gp[0][1]; pos0[2]=Gp[0][2];
834 double pos1[3]; pos1[0]=Gp[1][0]; pos1[1]=Gp[1][1]; pos1[2]=Gp[1][2];
835 double pos2[3]; pos2[0]=Gp[2][0]; pos2[1]=Gp[2][1]; pos2[2]=Gp[2][2];
843 double Hz = .333333*(H0[2]+H1[2]+
H2[2]);
848 double T2 = TP[0]*TP[0];
849 if(std::abs(Hz)>1.e-9) {Cm = 1./(300.*Hz*std::sqrt(1.+T2)); P[4] = -
C*Cm;}
853 double wa = 1./Wa[2];
855 const double dS = 4. ;
857 double dp = 8.*df*wa*Cm ;
859 double c1 = ZvHW*ZvHW*.1 ;
860 double c2 = df*df*(1.+T2);
869 Tp.setParametersWithCovariance(
nullptr,P,V);
884 double dx = G1[0]-G0[0] ;
885 double dy = G1[1]-G0[1] ;
886 double dz = G1[2]-G0[2] ;
887 double dr = std::sqrt(dx*dx+dy*dy) ;
889 Tp[0] = dz/(dr*(1.+.04*rc*rc));
891 double r0 = G0[0]*G0[0]+G0[1]*G0[1];
892 double r1 = G1[0]*G1[0]+G1[1]*G1[1];
900 double dT = (dZ+2.*VZ) ;
902 Tp[2] = dT*dT*.1/r0 ;
904 else if(E->m_barrel) {
906 double T2 = Tp[0]*Tp[0] ;
908 Tp[2] = (VZ*VZ)/((1.+T2)*r0) ;
912 double T2 = Tp[0]*Tp[0] ;
914 Tp[2] = (VZ*VZ)/((1.+T2)*r0) ;
921 double dT = (E->m_zMax-E->m_zMin+2.*VZ);
923 Tp[2] = dT*dT*.1/r1 ;
927 double T2 = Tp[0]*Tp[0] ;
928 double dr = std::sqrt(r1)-std::sqrt(r0) ;
929 Tp[1] = dr*dr*VZ*VZ/r1 ;
930 Tp[2] = (VZ*VZ)/((1.+T2)*r1) ;
935 double T2 = Tp[0]*Tp[0] ;
937 Tp[2] = (VZ*VZ)/((1.+T2)*r1) ;
#define AmgSymMatrix(dim)
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
Virtual base class of TRT readout elements.
bool trackParametersEstimation(TRT_TrajectoryElement_xk *, TRT_TrajectoryElement_xk *, Trk::PatternTrackParameters &, double)
bool addCluster(Trk::PatternTrackParameters &, Trk::PatternTrackParameters &, double &)
void polarAngleEstimation(TRT_TrajectoryElement_xk *, Amg::Vector3D &, Amg::Vector3D &, double, double, double *) const
TRT_ExtensionDriftCircleLink_xk m_link[24]
void set(const TRT_ID *, const Trk::IPatternParametersPropagator *, const Trk::IPatternParametersUpdator *, const Trk::IRIO_OnTrackCreator *, const Trk::IRIO_OnTrackCreator *, double)
bool buildForTRTSeed(double, double, bool &, bool &)
void initiateLinksForPrecisionSeed(InDet::TRT_DriftCircleCollection::const_iterator &, InDet::TRT_DriftCircleCollection::const_iterator &, std::pair< Amg::Vector3D, double > &, const double *, double)
TRT_TrajectoryElement_xk()
const Trk::IPatternParametersPropagator * m_proptool
bool boundaryTest(double, std::pair< Amg::Vector3D, double > &)
const Trk::IRIO_OnTrackCreator * m_riomakerD
bool trajectoryGlobalPosition(Amg::Vector3D &, double &)
const Trk::RIO_OnTrack * rioOnTrack()
bool initiateForTRTSeed(bool, const InDetDD::TRT_BaseElement *, InDet::TRT_DriftCircleCollection::const_iterator &, InDet::TRT_DriftCircleCollection::const_iterator &, std::pair< Amg::Vector3D, double > &, const double *, double)
bool propagate(Trk::PatternTrackParameters &, Trk::PatternTrackParameters &)
bool buildForPrecisionSeed(double, double, bool &, bool &)
const Trk::IPatternParametersUpdator * m_updatortool
std::unique_ptr< Trk::RIO_OnTrack > rioOnTrackSimple() const
const Trk::IRIO_OnTrackCreator * m_riomakerN
double findCloseLink(double, double)
Trk::MagneticFieldProperties m_fieldprop
MagField::AtlasFieldCache m_fieldCache
const double & radius() const
const InDetDD::TRT_BaseElement * m_detelement
bool initiateForPrecisionSeed(bool, const InDetDD::TRT_BaseElement *, InDet::TRT_DriftCircleCollection::const_iterator &, InDet::TRT_DriftCircleCollection::const_iterator &, std::pair< Amg::Vector3D, double > &, const double *, double)
void initiateLinksForTRTSeed(InDet::TRT_DriftCircleCollection::const_iterator &, InDet::TRT_DriftCircleCollection::const_iterator &, std::pair< Amg::Vector3D, double > &, const double *, double)
This is an Identifier helper class for the TRT subdetector.
Class to describe the bounds for a planar DiscSurface.
interface for track parameter propagation through the magnetic field, using the Trk::PatternTrackPara...
Interface for updating Trk::PatternTrackParameters, the fast internal representation of track paramet...
Interface class for transforming Trk::PrepRawData to Trk::RIO_OnTrack using a local track hypothesis.
magnetic field properties to steer the behavior of the extrapolation
const Amg::Vector2D & localPosition() const
return the local position reference
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Bounds for a rectangular, planar surface.
Class for a StraightLineSurface in the ATLAS detector to describe dirft tube and straw like detectors...
Abstract base class for surface bounds to be specified.
virtual BoundsType type() const =0
Return the bounds type - for persistency optimization.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersT< TrackParametersDim, Charged, StraightLineSurface > AtaStraightLine
@ NODRIFTTIME
drift time was not used - drift radius is 0.
@ DECIDED
sign of drift radius has been determined
std::pair< double, ParamDefs > DefinedParameter
Typedef to of a std::pair<double, ParamDefs> to identify a passed-through double as a specific type o...
hold the test vectors and ease the comparison
std::string number(const double &d, const std::string &s)