ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::SeedFitterTool Class Reference

Estimate the initial track parameters for a list of spacepoints/measurements (i.e. More...

#include <SeedFitterTool.h>

Inheritance diagram for InDet::SeedFitterTool:
Collaboration diagram for InDet::SeedFitterTool:

Public Member Functions

 SeedFitterTool (const std::string &, const std::string &, const IInterface *)
virtual std::unique_ptr< const Trk::TrackParametersfit (const std::vector< const Trk::SpacePoint * > &spacepoints) const override
virtual MsgStream & dump (MsgStream &out) const override
virtual std::ostream & dump (std::ostream &out) const override
MsgStream & dumpevent (MsgStream &out) const

Protected Member Functions

 SeedFitterTool ()=delete
 SeedFitterTool (const SeedFitterTool &)=delete
SeedFitterTooloperator= (const SeedFitterTool &)=delete

Detailed Description

Estimate the initial track parameters for a list of spacepoints/measurements (i.e.

Track candidates), which latter can be used as input for the track fitter. The method is based on a simple linear conformal mapping.

Author
xiang.nosp@m.yang.nosp@m..ju@c.nosp@m.ern..nosp@m.ch

Definition at line 22 of file SeedFitterTool.h.

Constructor & Destructor Documentation

◆ SeedFitterTool() [1/3]

InDet::SeedFitterTool::SeedFitterTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 11 of file SeedFitterTool.cxx.

12 :
13 base_class(type, name, parent)
14{
15 declareInterface<ISeedFitter>(this);
16}

◆ SeedFitterTool() [2/3]

InDet::SeedFitterTool::SeedFitterTool ( )
protecteddelete

◆ SeedFitterTool() [3/3]

InDet::SeedFitterTool::SeedFitterTool ( const SeedFitterTool & )
protecteddelete

Member Function Documentation

◆ dump() [1/2]

MsgStream & InDet::SeedFitterTool::dump ( MsgStream & out) const
overridevirtual

Definition at line 137 of file SeedFitterTool.cxx.

138{
139 out<<std::endl;
140 return dumpevent(out);
141}
MsgStream & dumpevent(MsgStream &out) const

◆ dump() [2/2]

std::ostream & InDet::SeedFitterTool::dump ( std::ostream & out) const
overridevirtual

Definition at line 143 of file SeedFitterTool.cxx.

144{
145 return out;
146}

◆ dumpevent()

MsgStream & InDet::SeedFitterTool::dumpevent ( MsgStream & out) const

Definition at line 148 of file SeedFitterTool.cxx.

149{
150 out<<"|Nothing to dump-|"
151 <<std::endl;
152 return out;
153}

◆ fit()

std::unique_ptr< const Trk::TrackParameters > InDet::SeedFitterTool::fit ( const std::vector< const Trk::SpacePoint * > & spacepoints) const
overridevirtual

get the first cluster on the first hit

and use the surface from this cluster as our reference plane

local x of the surface in the global frame

local y of the surface in the global frame

centre of the surface in the global frame

location of the first SP w.r.t centre of the surface

local x, y - coordinates of the first SP in the local frame

Definition at line 18 of file SeedFitterTool.cxx.

20{
24
27
28 if (spacePoints.size() < 3) {
29 return nullptr;
30 }
31
32 // Try to use first last and midlle SP in pixel, for better lever arm
33 std::vector<const Trk::SpacePoint*> pixelSP,SP;
34
35 for(const auto& sp : spacePoints){
36 if( sp->clusterList().first->type(Trk::PrepRawDataType::PixelCluster) ){
37 pixelSP.push_back(sp);
38 }
39 }
40
41 if(pixelSP.size()<3){
42 SP = spacePoints;
43 }
44 else{
45 unsigned int middleIdx = pixelSP.size() == 3 ? 1 : pixelSP.size()/2;
46 SP = {pixelSP[0], pixelSP[middleIdx], pixelSP.back()};
47 }
48
50 const Trk::PrepRawData* cl = SP[0]->clusterList().first;
51 if(!cl) return nullptr;
53 const Trk::PlaneSurface* pla =
54 static_cast<const Trk::PlaneSurface*>(&cl->detectorElement()->surface());
55 if(!pla) return nullptr;
56
57 // translate second and third SP w.r.t first one
58 double x0 = SP[0]->globalPosition().x();
59 double y0 = SP[0]->globalPosition().y();
60 double z0 = SP[0]->globalPosition().z();
61
62 double x1 = SP[1]->globalPosition().x() - x0;
63 double y1 = SP[1]->globalPosition().y() - y0;
64
65 double x2 = SP[2]->globalPosition().x() - x0;
66 double y2 = SP[2]->globalPosition().y() - y0;
67 double z2 = SP[2]->globalPosition().z() - z0;
68
69 // distance of second SP to first in transverse plane
70 // Also happens to be u-coordinate of second SP in conformal mapping
71 double u1 = 1./std::sqrt(x1*x1+y1*y1);
72 // denominator for conformal mapping
73 double rn = x2*x2+y2*y2;
74 double r2 = 1./rn;
75 // coordinate system for conformal mapping - this is local x
76 double a = x1*u1;
77 double b = y1*u1;
78 // u/v-coordinate of third SP in conformal mapping
79 double u2 = (a*x2+b*y2)*r2;
80 double v2 = (a*y2-b*x2)*r2;
81 // A,B are slope and intercept of the straight line in the u,v plane
82 // connecting the three points.
83 double A = v2/(u2-u1);
84 double T = z2*sqrt(r2);
85
86 const Amg::Transform3D& Tp = pla->transform();
87
89 double Ax[3] = {Tp(0,0),Tp(1,0),Tp(2,0)};
91 double Ay[3] = {Tp(0,1),Tp(1,1),Tp(2,1)};
93 double D [3] = {Tp(0,3),Tp(1,3),Tp(2,3)};
95 double d[3] = {x0-D[0],y0-D[1],z0-D[2]};
96
97 double track_paras[5];
99 track_paras[0] = d[0]*Ax[0]+d[1]*Ax[1]+d[2]*Ax[2];
100 track_paras[1] = d[0]*Ay[0]+d[1]*Ay[1]+d[2]*Ay[2];
101 track_paras[2] = std::atan2(b+a*A, a-b*A);
102 track_paras[3] = std::atan2(1.,T) ;
103 track_paras[4] = 0.001/std::sqrt(1.+T*T); // qoverp from qoverpt and theta
104
106 "linearConformalMapping: \n" << \
107 "\nlocal x = " << track_paras[0] << \
108 "\nlocal y = " << track_paras[1] << \
109 "\nphi = " << track_paras[2] << \
110 "\ntheta = " << track_paras[3] << \
111 "\nqoverp = " << track_paras[4]);
112
113 bool any_nan = false;
114 for (int i = 0; i < 5; i++) {
115 if (std::isnan(track_paras[i])) {
116 any_nan = true;
117 break;
118 }
119 }
120 if (any_nan){
121 ATH_MSG_DEBUG("Seed parameters contain NaN elements - skipping this track ");
122 return nullptr;
123 }
124
125 std::unique_ptr<const Trk::TrackParameters> trkParameters(
126 pla->createUniqueTrackParameters(track_paras[0],track_paras[1],track_paras[2],track_paras[3],track_paras[4],std::nullopt));
127
128 if (!trkParameters) {
129 ATH_MSG_DEBUG("Failed to create track parameters");
130 return nullptr;
131 }
132
133 return trkParameters;
134}
#define ATH_MSG_DEBUG(x)
static Double_t sp
static Double_t a
static Double_t Tp(Double_t *t, Double_t *par)
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Eigen::Affine3d Transform3D
unsigned long long T
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]

◆ operator=()

SeedFitterTool & InDet::SeedFitterTool::operator= ( const SeedFitterTool & )
protecteddelete

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