11 #include <boost/bind.hpp> 16 : scale_(conf.getParameter<double>(
"NSigmaInside")),
17 preFilter_(conf.existsAs<
bool>(
"PreFilter") ? conf.getParameter<
bool>(
"PreFilter") :
false) {}
35 std::vector<SiStripMatchedRecHit2D*>
result;
36 result.reserve(end - begin);
37 match(monoRH, begin, end, result, gluedDet, trackdirection);
38 for (std::vector<SiStripMatchedRecHit2D*>::iterator
p = result.begin();
p != result.end();
p++)
45 std::vector<SiStripMatchedRecHit2D*>& collector,
49 match(monoRH, begin, end, result, gluedDet, trackdirection);
59 match(monoRH, begin, end, result, gluedDet, trackdirection);
71 stereoHits.reserve(end - begin);
73 stereoHits.push_back(&(*
i));
75 return match(monoRH, stereoHits.begin(), stereoHits.end(), collector, gluedDet, trackdirection);
100 if (trackdirection.
mag2() < FLT_MIN) {
111 double m00 = -(projectedstripmono.second.y() - projectedstripmono.first.y());
112 double m01 = (projectedstripmono.second.x() - projectedstripmono.first.x());
113 double c0 = m01 * projectedstripmono.first.y() + m00 * projectedstripmono.first.x();
124 double l1 = 1. / (c1 * c1 + s1 * s1);
132 for (seconditer = begin; seconditer !=
end; ++seconditer) {
143 StripPosition projectedstripstereo =
project(partnerstripdet, gluedDet, stripstereo, trackdirection);
145 double m10 = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
146 double m11 = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
157 c(1) = m11 * projectedstripstereo.first.y() + m10 * projectedstripstereo.first.x();
180 if (!((gluedDet->
surface()).bounds().inside(position, tempError,
scale_)))
193 double l2 = 1. / (c2 * c2 + s2 *
s2);
195 double sigmap22 =
sigmaPitch((*seconditer)->localPosition(), (*seconditer)->localPositionError(), partnertopol);
199 double diff = (c1 * s2 - c2 * s1);
200 double invdet2 = 1 / (diff * diff * l1 * l2);
201 float xx = invdet2 * (sigmap12 * s2 * s2 * l2 + sigmap22 * s1 * s1 * l1);
202 float xy = -invdet2 * (sigmap12 * c2 * s2 * l2 + sigmap22 * c1 * s1 * l1);
203 float yy = invdet2 * (sigmap12 * c2 * c2 * l2 + sigmap22 * c1 * c1 * l1);
206 if ((gluedDet->
surface()).bounds().inside(position, error,
scale_)) {
229 float scale = -positiononGluedini.
z() / trackdirection.
z();
231 LocalPoint projpositiononGluedini = positiononGluedini + scale * trackdirection;
232 LocalPoint projpositiononGluedend = positiononGluedend + scale * trackdirection;
234 return StripPosition(projpositiononGluedini, projpositiononGluedend);
258 if (trackdirection.
mag2() < FLT_MIN) {
269 double m00 = -(projectedstripmono.second.y() - projectedstripmono.first.y());
270 double m01 = (projectedstripmono.second.x() - projectedstripmono.first.x());
271 double c0 = m01 * projectedstripmono.first.y() + m00 * projectedstripmono.first.x();
282 double l1 = 1. / (c1 * c1 + s1 * s1);
297 StripPosition projectedstripstereo =
project(partnerstripdet, gluedDet, stripstereo, trackdirection);
299 double m10 = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
300 double m11 = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
305 AlgebraicVector2 c(c0, m11 * projectedstripstereo.first.y() + m10 * projectedstripstereo.first.x());
314 if ((!force) && (!((gluedDet->
surface()).bounds().inside(position, 10.
f *
scale_))))
315 return std::unique_ptr<SiStripMatchedRecHit2D>(
nullptr);
319 double l2 = 1. / (c2 * c2 + s2 *
s2);
325 double diff = (c1 * s2 - c2 * s1);
326 double invdet2 = 1 / (diff * diff * l1 * l2);
327 float xx = invdet2 * (sigmap12 * s2 * s2 * l2 + sigmap22 * s1 * s1 * l1);
328 float xy = -invdet2 * (sigmap12 * c2 * s2 * l2 + sigmap22 * c1 * s1 * l1);
329 float yy = invdet2 * (sigmap12 * c2 * c2 * l2 + sigmap22 * c1 * c1 * l1);
334 if (force || (gluedDet->
surface()).bounds().inside(position, error, scale_))
335 return std::make_unique<SiStripMatchedRecHit2D>(
LocalPoint(position),
error, *gluedDet, monoRH, stereoRH);
336 return std::unique_ptr<SiStripMatchedRecHit2D>(
nullptr);
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void push_back(data_type const &d)
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)
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
ROOT::Math::SVector< double, 2 > AlgebraicVector2
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
SiStripMatchedRecHit2D * clone() const override
SiStripRecHitMatcher(const edm::ParameterSet &conf)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
SimpleHitCollection::const_iterator SimpleHitIterator
static int position[264][3]
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
const GeomDetUnit * stereoDet() const