11 #include<boost/bind.hpp> 19 scale_(conf.getParameter<double>(
"NSigmaInside")),
20 preFilter_(conf.existsAs<
bool>(
"PreFilter") ? conf.getParameter<
bool>(
"PreFilter") :
false)
48 std::vector<SiStripMatchedRecHit2D*>
result;
49 result.reserve(end-begin);
50 match(monoRH,begin,end,result,gluedDet,trackdirection);
51 for (std::vector<SiStripMatchedRecHit2D*>::iterator
p=result.begin();
p!=result.end();
59 std::vector<SiStripMatchedRecHit2D*> & collector,
64 match(monoRH,begin,end,result,gluedDet,trackdirection);
75 match(monoRH,begin,end,result,gluedDet,trackdirection);
91 stereoHits.reserve(end-begin);
93 stereoHits.push_back( &(*
i));
96 stereoHits.begin(), stereoHits.end(),
98 gluedDet,trackdirection);
124 if(trackdirection.
mag2()<FLT_MIN){
135 double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y());
136 double m01 = (projectedstripmono.second.x()-projectedstripmono.first.x());
137 double c0 = m01*projectedstripmono.first.y() + m00*projectedstripmono.first.x();
148 double l1 = 1./(c1*c1+s1*s1);
158 for(seconditer=begin;seconditer!=
end;++seconditer){
169 StripPosition projectedstripstereo=
project(partnerstripdet,gluedDet,stripstereo,trackdirection);
172 double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
173 double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
183 c(1)=m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x();
207 if (!((gluedDet->
surface()).bounds().inside(position,tempError,
scale_)))
continue;
219 double l2 = 1./(c2*c2+s2*
s2);
221 double sigmap22 =
sigmaPitch((*seconditer)->localPosition(),(*seconditer)->localPositionError(),partnertopol);
225 double diff=(c1*s2-c2*s1);
226 double invdet2=1/(diff*diff*l1*l2);
227 float xx= invdet2*(sigmap12*s2*s2*l2+sigmap22*s1*s1*l1);
228 float xy=-invdet2*(sigmap12*c2*s2*l2+sigmap22*c1*s1*l1);
229 float yy= invdet2*(sigmap12*c2*c2*l2+sigmap22*c1*c1*l1);
232 if((gluedDet->
surface()).bounds().inside(position,error,
scale_)){
257 float scale=-positiononGluedini.
z()/trackdirection.
z();
259 LocalPoint projpositiononGluedini= positiononGluedini + scale*trackdirection;
260 LocalPoint projpositiononGluedend= positiononGluedend + scale*trackdirection;
262 return StripPosition(projpositiononGluedini,projpositiononGluedend);
268 std::unique_ptr<SiStripMatchedRecHit2D>
287 if(trackdirection.
mag2()<
float(FLT_MIN)){
298 double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y());
299 double m01 = (projectedstripmono.second.x()-projectedstripmono.first.x());
300 double c0 = m01*projectedstripmono.first.y() + m00*projectedstripmono.first.x();
311 double l1 = 1./(c1*c1+s1*s1);
330 StripPosition projectedstripstereo=
project(partnerstripdet,gluedDet,stripstereo,trackdirection);
333 double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
334 double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
339 AlgebraicVector2 c(c0,m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x());
349 if ((!force) && (!((gluedDet->
surface()).bounds().inside(position,10.
f*
scale_))) )
return std::unique_ptr<SiStripMatchedRecHit2D>(
nullptr);
353 double l2 = 1./(c2*c2+s2*
s2);
360 double diff=(c1*s2-c2*s1);
361 double invdet2=1/(diff*diff*l1*l2);
362 float xx= invdet2*(sigmap12*s2*s2*l2+sigmap22*s1*s1*l1);
363 float xy=-invdet2*(sigmap12*c2*s2*l2+sigmap22*c1*s1*l1);
364 float yy= invdet2*(sigmap12*c2*c2*l2+sigmap22*c1*c1*l1);
370 if(force || (gluedDet->
surface()).bounds().inside(position,error,scale_))
371 return std::make_unique<SiStripMatchedRecHit2D>(
LocalPoint(position),
error, *gluedDet, monoRH,stereoRH);
372 return std::unique_ptr<SiStripMatchedRecHit2D>(
nullptr);
void push_back(data_type const &d)
Point3DBase< Scalar, LocalTag > LocalPoint
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual const Topology & topology() const
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
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::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
std::pair< LocalPoint, LocalPoint > StripPosition
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]
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
ROOT::Math::SVector< double, 2 > AlgebraicVector2
const GeomDetUnit * stereoDet() const