1 #ifndef RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H 2 #define RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H 23 #include <boost/function.hpp> 34 typedef boost::function<void(SiStripMatchedRecHit2D const&)>
Collector;
46 return error.
uu() * pitch * pitch;
50 template <
typename MonoIterator,
typename StereoIterator,
typename CollectorHelper>
52 MonoIterator monoRHend,
53 StereoIterator seconditer,
54 StereoIterator seconditerend,
57 CollectorHelper& collectorHelper)
const;
70 CollectorMatched& collector,
75 SimpleHitIterator begin,
76 SimpleHitIterator end,
77 CollectorMatched& collector,
90 SimpleHitIterator begin,
91 SimpleHitIterator end,
97 SimpleHitIterator begin,
98 SimpleHitIterator end,
99 std::vector<SiStripMatchedRecHit2D*>& collector,
105 SimpleHitIterator begin,
106 SimpleHitIterator end,
107 Collector& collector,
116 #if defined(USE_SSEVECT) || defined(USE_EXTVECT) 122 #if defined(USE_SSEVECT) 132 namespace matcherDetails {
143 template <
typename MonoIterator,
typename StereoIterator,
typename CollectorHelper>
145 MonoIterator monoRHend,
146 StereoIterator seconditer,
147 StereoIterator seconditerend,
150 CollectorHelper& collectorHelper)
const {
151 using matcherDetails::StereoInfo;
158 bool notk = trdir.
mag2() <
float(FLT_MIN);
169 ToGlobal
const& stripDetTrans = stripdet->
surface();
170 ToGlobal
const& partnerStripDetTrans = partnerstripdet->
surface();
171 ToLocal gluedDetInvTrans(gluedDet->
surface());
177 for (; seconditer != seconditerend; ++seconditer) {
178 const SiStripRecHit2D& secondHit = CollectorHelper::stereoHit(seconditer);
190 GlobalPoint globalpointini = partnerStripDetTrans.toGlobal(locp1);
191 GlobalPoint globalpointend = partnerStripDetTrans.toGlobal(locp2);
194 LocalPoint positiononGluedini = gluedDetInvTrans.toLocal(globalpointini);
195 LocalPoint positiononGluedend = gluedDetInvTrans.toLocal(globalpointend);
200 GlobalPoint gcenterofstrip = partnerStripDetTrans.toGlobal(lcenterofstrip);
202 trdir = gluedDetInvTrans.toLocal(gtrackdirection);
210 double m10 = -(ret2[1] - ret1[1]);
211 double m11 = ret2[0] - ret1[0];
212 double dd = m11 * ret1[1] + m10 * ret1[0];
217 StereoInfo
info = {c1vec, &secondHit, sigmap22, m10, m11};
218 cache[cacheSize++] =
info;
221 for (; monoRHiter != monoRHend; ++monoRHiter) {
237 GlobalPoint gcenterofstrip = stripDetTrans.toGlobal(lcenterofstrip);
239 trdir = gluedDetInvTrans.toLocal(gtrackdirection);
245 GlobalPoint globalpointini = stripDetTrans.toGlobal(locp1o);
246 GlobalPoint globalpointend = stripDetTrans.toGlobal(locp2o);
249 LocalPoint positiononGluedini = gluedDetInvTrans.toLocal(globalpointini);
250 LocalPoint positiononGluedend = gluedDetInvTrans.toLocal(globalpointend);
260 double m00 = -(projend[1] - projini[1]);
261 double m01 = (projend[0] - projini[0]);
263 m01 * projini[1] + m00 * projini[0];
266 Vec2D minv00{-m01, m00};
271 double l1 = 1. / (c1 * c1 + s1 * s1);
278 float fc1(c1), fs1(s1);
279 Vec3F scc1{fs1, fc1, fc1, 0.f};
280 Vec3F ssc1{fs1, fs1, fc1, 0.f};
281 const Vec3F cslsimd = scc1 * ssc1 *
float(l1);
283 for (
int i = 0;
i != cacheSize; ++
i) {
284 StereoInfo
const si = cache[
i];
287 Vec2D minv10{si.m11, -si.m10};
288 double mult = 1. / (m00 * si.m11 - m01 * si.m10);
289 Vec2D resultmatmul = mult * (minv10 * c0vec + minv00 * si.c1vec);
294 if (!((gluedDet->
surface()).bounds().inside(position, 10.
f *
scale_)))
299 double l2 = 1. / (c2 * c2 + s2 *
s2);
301 double diff = (c1 * s2 - c2 * s1);
302 double invdet2 = 1. / (diff * diff * l1 * l2);
304 float fc2(c2), fs2(s2), fid2(invdet2);
305 Vec3F invdet2simd{fid2, -fid2, fid2, 0.f};
306 Vec3F ccssimd{fs2, fc2, fc2, 0.f};
307 Vec3F csssimd{fs2, fs2, fc2, 0.f};
308 Vec3F result = invdet2simd * (si.sigmap22 * cslsimd + sigmap12 * ccssimd * csssimd *
float(l2));
312 if ((gluedDet->
surface()).bounds().inside(position, error, scale_)) {
317 collectorHelper.collector()(
323 collectorHelper.closure(monoRHiter);
327 #endif //DOUBLE_MATCH 329 #endif // RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H
Point3DBase< Scalar, LocalTag > LocalPoint
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
virtual const Topology & topology() const
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
std::pair< LocalPoint, LocalPoint > StripPosition
static float sigmaPitch(LocalPoint const &pos, LocalError const &err, const StripTopology &topol)
const Plane & surface() const
The nominal surface of the GeomDet.
virtual LocalPoint localPosition(float strip) const =0
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
SiStripRecHitMatcher(const edm::ParameterSet &conf)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
void doubleMatch(MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
SiStripMatchedRecHit2DCollectionNew::FastFiller CollectorMatched
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
virtual float localPitch(const LocalPoint &) const =0
SimpleHitCollection::const_iterator SimpleHitIterator
static int position[264][3]
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
const BasicVectorType & basicVector() const
const GeomDetUnit * stereoDet() const