1 #ifndef RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H 2 #define RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H 33 typedef std::function<void(SiStripMatchedRecHit2D const&)>
Collector;
45 return error.uu() * pitch * pitch;
49 template <
typename MonoIterator,
typename StereoIterator,
typename CollectorHelper>
51 MonoIterator monoRHend,
52 StereoIterator seconditer,
53 StereoIterator seconditerend,
56 CollectorHelper& collectorHelper)
const;
98 std::vector<SiStripMatchedRecHit2D*>& collector,
115 #if defined(USE_SSEVECT) || defined(USE_EXTVECT) 121 #if defined(USE_SSEVECT) 131 namespace matcherDetails {
142 template <
typename MonoIterator,
typename StereoIterator,
typename CollectorHelper>
144 MonoIterator monoRHend,
145 StereoIterator seconditer,
146 StereoIterator seconditerend,
149 CollectorHelper& collectorHelper)
const {
150 using matcherDetails::StereoInfo;
157 bool notk = trdir.
mag2() <
float(FLT_MIN);
168 ToGlobal
const& stripDetTrans = stripdet->
surface();
169 ToGlobal
const& partnerStripDetTrans = partnerstripdet->
surface();
170 ToLocal gluedDetInvTrans(gluedDet->
surface());
176 for (; seconditer != seconditerend; ++seconditer) {
177 const SiStripRecHit2D& secondHit = CollectorHelper::stereoHit(seconditer);
189 GlobalPoint globalpointini = partnerStripDetTrans.toGlobal(locp1);
190 GlobalPoint globalpointend = partnerStripDetTrans.toGlobal(locp2);
193 LocalPoint positiononGluedini = gluedDetInvTrans.toLocal(globalpointini);
194 LocalPoint positiononGluedend = gluedDetInvTrans.toLocal(globalpointend);
199 GlobalPoint gcenterofstrip = partnerStripDetTrans.toGlobal(lcenterofstrip);
201 trdir = gluedDetInvTrans.toLocal(gtrackdirection);
209 double m10 = -(ret2[1] - ret1[1]);
210 double m11 = ret2[0] - ret1[0];
211 double dd = m11 * ret1[1] + m10 * ret1[0];
216 StereoInfo
info = {c1vec, &secondHit, sigmap22, m10, m11};
220 for (; monoRHiter != monoRHend; ++monoRHiter) {
236 GlobalPoint gcenterofstrip = stripDetTrans.toGlobal(lcenterofstrip);
238 trdir = gluedDetInvTrans.toLocal(gtrackdirection);
244 GlobalPoint globalpointini = stripDetTrans.toGlobal(locp1o);
245 GlobalPoint globalpointend = stripDetTrans.toGlobal(locp2o);
248 LocalPoint positiononGluedini = gluedDetInvTrans.toLocal(globalpointini);
249 LocalPoint positiononGluedend = gluedDetInvTrans.toLocal(globalpointend);
259 double m00 = -(projend[1] - projini[1]);
260 double m01 = (projend[0] - projini[0]);
262 m01 * projini[1] + m00 * projini[0];
265 Vec2D minv00{-m01, m00};
270 double l1 = 1. / (
c1 *
c1 + s1 * s1);
277 float fc1(
c1), fs1(s1);
278 Vec3F scc1{fs1, fc1, fc1, 0.f};
279 Vec3F ssc1{fs1, fs1, fc1, 0.f};
280 const Vec3F cslsimd = scc1 * ssc1 *
float(l1);
282 for (
int i = 0;
i != cacheSize; ++
i) {
283 StereoInfo
const si =
cache[
i];
286 Vec2D minv10{si.m11, -si.m10};
287 double mult = 1. / (m00 * si.m11 - m01 * si.m10);
288 Vec2D resultmatmul =
mult * (minv10 * c0vec + minv00 * si.c1vec);
298 double l2 = 1. / (c2 * c2 + s2 * s2);
300 double diff = (
c1 * s2 - c2 * s1);
301 double invdet2 = 1. / (
diff *
diff * l1 * l2);
303 float fc2(c2), fs2(s2), fid2(invdet2);
304 Vec3F invdet2simd{fid2, -fid2, fid2, 0.f};
305 Vec3F ccssimd{fs2, fc2, fc2, 0.f};
306 Vec3F csssimd{fs2, fs2, fc2, 0.f};
307 Vec3F result = invdet2simd * (si.sigmap22 * cslsimd + sigmap12 * ccssimd * csssimd *
float(l2));
316 collectorHelper.collector()(
322 collectorHelper.closure(monoRHiter);
326 #endif //DOUBLE_MATCH 328 #endif // RECOLOCALTRACKER_SISTRIPCLUSTERIZER_SISTRIPRECHITMATCH_H
Point3DBase< Scalar, LocalTag > LocalPoint
virtual const Topology & topology() const
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
Global3DPoint GlobalPoint
std::function< void(SiStripMatchedRecHit2D const &)> Collector
std::pair< LocalPoint, LocalPoint > StripPosition
static float sigmaPitch(LocalPoint const &pos, LocalError const &err, const StripTopology &topol)
virtual float localPitch(const LocalPoint &) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
SiStripRecHitMatcher(const edm::ParameterSet &conf)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalPoint & localPositionFast() const
const BasicVectorType & basicVector() const
const GeomDetUnit * monoDet() const
SiStripMatchedRecHit2DCollectionNew::FastFiller CollectorMatched
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
LocalError localPositionError() const override
const Plane & surface() const
The nominal surface of the GeomDet.
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
const GeomDetUnit * stereoDet() const
void doubleMatch(MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
SimpleHitCollection::const_iterator SimpleHitIterator
LocalPoint localPosition() const override
static int position[264][3]
virtual LocalPoint localPosition(float strip) const =0
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const