32 if(trackdirection.
mag2()<FLT_MIN){
44 LocalVector RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
45 double c1=
sin(RPHIpositiononGluedendvector.
phi());
46 double s1=-
cos(RPHIpositiononGluedendvector.
phi());
49 double sigmap12=errormonoRH.uu()*pitch*pitch;
66 m(0,0)=-(projectedstripmono.second.y()-projectedstripmono.first.y());
m(0,1)=(projectedstripmono.second.x()-projectedstripmono.first.x());
67 m(1,0)=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
m(1,1)=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
68 c(0)=
m(0,1)*projectedstripmono.first.y()+
m(0,0)*projectedstripmono.first.x();
69 c(1)=
m(1,1)*projectedstripstereo.first.y()+
m(1,0)*projectedstripstereo.first.x();
70 m.Invert(); solution = m *
c;
82 LocalVector stereopositiononGluedendvector=projectedstripstereo.second-projectedstripstereo.first;
83 double c2=
sin(stereopositiononGluedendvector.
phi());
double s2=-
cos(stereopositiononGluedendvector.
phi());
86 double sigmap22=errorstereoRH.uu()*pitch*pitch;
87 double diff=(c1*s2-c2*s1);
88 double invdet2=1/(diff*
diff);
89 float xx=invdet2*(sigmap12*s2*s2+sigmap22*s1*s1);
90 float xy=-invdet2*(sigmap12*c2*s2+sigmap22*c1*s1);
91 float yy=invdet2*(sigmap12*c2*c2+sigmap22*c1*
c1);
103 if(det.subdetId() > 2) {
129 true, adjustedMonoRH, adjustedStereoRH);
130 delete adjustedMonoRH;
131 delete adjustedStereoRH;
157 float scale=-positiononGluedini.
z()/trackdirection.
z();
159 LocalPoint projpositiononGluedini= positiononGluedini + scale*trackdirection;
160 LocalPoint projpositiononGluedend= positiononGluedend + scale*trackdirection;
162 return StripPosition(projpositiononGluedini,projpositiononGluedend);
176 double delta = gluedPlane.localZ( hitPlane.position());
179 LocalPoint projectedHitPos = lhitPos - ldir * delta/ldir.
z();
184 if (gluedPlane.normalVector().dot( hitPlane.normalVector()) < 0) {
217 SiTrackerGSRecHit2D *otherRH =
new SiTrackerGSRecHit2D(
LocalPoint(-10000,-10000,-10000),
LocalError(0,0,0),*otherDet, 0,0,0,monoRH->
cluster(),0,0);
218 if ((isMono && isStereo)||(!isMono&&!isStereo))
throw cms::Exception(
"GSRecHitMatcher") <<
"Something wrong with DetIds.";
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const int & simhitId() const
const GeomDetUnit * monoDet() const
SiTrackerGSMatchedRecHit2D * match(const SiTrackerGSRecHit2D *monoRH, const SiTrackerGSRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector &trackdirection) const
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
const int & simtrackId() const
virtual const Topology & topology() const =0
virtual float localPitch(const LocalPoint &) const =0
virtual LocalError localPositionError() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
std::pair< LocalPoint, LocalPoint > StripPosition
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
const GeomDet * det() const
Cos< T >::type cos(const T &t)
DetId geographicalId() const
The label of this GeomDet.
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const int & simMultX() const
const uint32_t & eeId() const
const int & simMultY() const
SiTrackerGSMatchedRecHit2D * projectOnly(const SiTrackerGSRecHit2D *monoRH, const GeomDet *monoDet, const GluedGeomDet *gluedDet, LocalVector &ldir) const
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, const StripPosition &strip, const LocalVector &trackdirection) const
ClusterRef const & cluster() const
static int position[264][3]
virtual LocalPoint localPosition(float strip) const =0
DetId geographicalId() const
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
virtual LocalPoint localPosition() const
ROOT::Math::SVector< double, 2 > AlgebraicVector2
const GeomDetUnit * stereoDet() const