1 #ifndef RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H
2 #define RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H
23 #include <boost/function.hpp>
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;
99 std::vector<SiStripMatchedRecHit2D*>& 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};
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);
299 double l2 = 1. / (c2 * c2 +
s2 *
s2);
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));
317 collectorHelper.collector()(
323 collectorHelper.closure(monoRHiter);
327 #endif //DOUBLE_MATCH
329 #endif // RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H