11 #include<boost/bind.hpp>
29 const SiStripRecHit2D *stereoRH,
33 std::vector<SiStripMatchedRecHit2D*>
collection;
35 stereoHits.begin(), stereoHits.end(),
37 gluedDet,trackdirection);
39 return collection.empty() ? (SiStripMatchedRecHit2D*)(0) : collection.front();
47 throw "SiStripRecHitMatcher::match(const SiStripMatchedRecHit2D *,..) is obsoltete since 5.2.0";
75 stereoHits.reserve(end-begin);
78 stereoHits.push_back( &(*
i));
81 stereoHits.begin(), stereoHits.end(),
82 gluedDet,trackdirection);
92 match(monoRH,begin,end,collector,gluedDet,trackdirection);
104 std::vector<SiStripMatchedRecHit2D*>
result;
105 result.reserve(end-begin);
106 match(monoRH,begin,end,result,gluedDet,trackdirection);
107 for (std::vector<SiStripMatchedRecHit2D*>::iterator
p=result.begin();
p!=result.end();
113 inline void pb1(std::vector<SiStripMatchedRecHit2D*> &
v, SiStripMatchedRecHit2D*
h) {
125 std::vector<SiStripMatchedRecHit2D*> & collector,
130 match(monoRH,begin,end,result,gluedDet,trackdirection);
144 stereoHits.reserve(end-begin);
146 stereoHits.push_back( &(*
i));
148 return match( monoRH,
149 stereoHits.begin(), stereoHits.end(),
151 gluedDet,trackdirection);
162 match(monoRH,begin,end,result,gluedDet,trackdirection);
188 if(trackdirection.
mag2()<FLT_MIN){
189 LocalPoint lcenterofstrip=monoRH->localPositionFast();
199 double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y());
200 double m01 = (projectedstripmono.second.x()-projectedstripmono.first.x());
201 double c0 = m01*projectedstripmono.first.y() + m00*projectedstripmono.first.x();
212 double l1 = 1./(c1*c1+s1*s1);
216 double sigmap12 = monoRH->sigmaPitch();
226 LocalError tmpError(monoRH->localPositionErrorFast());
236 double pitch=topol.
localPitch(monoRH->localPositionFast());
237 monoRH->setSigmaPitch(sigmap12=errormonoRH.
uu()*pitch*pitch);
242 for(seconditer=begin;seconditer!=
end;++seconditer){
253 StripPosition projectedstripstereo=
project(partnerstripdet,gluedDet,stripstereo,trackdirection);
256 double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
257 double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
267 c(1)=m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x();
291 if (!((gluedDet->
surface()).bounds().inside(position,tempError,
scale_)))
continue;
303 double l2 = 1./(c2*c2+s2*
s2);
307 double sigmap22 = (*seconditer)->sigmaPitch();
310 LocalError tmpError((*seconditer)->localPositionErrorFast());
314 double pitch=partnertopol.
localPitch((*seconditer)->localPositionFast());
315 (*seconditer)->setSigmaPitch(sigmap22=errorstereoRH.
uu()*pitch*pitch);
318 double diff=(c1*s2-c2*s1);
319 double invdet2=1/(diff*diff*l1*l2);
320 float xx= invdet2*(sigmap12*s2*s2*l2+sigmap22*s1*s1*l1);
321 float xy=-invdet2*(sigmap12*c2*s2*l2+sigmap22*c1*s1*l1);
322 float yy= invdet2*(sigmap12*c2*c2*l2+sigmap22*c1*c1*l1);
325 if((gluedDet->
surface()).bounds().inside(position,error,
scale_)){
329 const SiStripRecHit2D* secondHit = *seconditer;
330 collector(SiStripMatchedRecHit2D(position, error,gluedDet->
geographicalId() ,
349 float scale=-positiononGluedini.
z()/trackdirection.
z();
351 LocalPoint projpositiononGluedini= positiononGluedini + scale*trackdirection;
352 LocalPoint projpositiononGluedend= positiononGluedend + scale*trackdirection;
354 return StripPosition(projpositiononGluedini,projpositiononGluedend);
T getParameter(std::string const &) const
void push_back(data_type const &d)
const GeomDetUnit * monoDet() const
SiStripMatchedRecHit2D * match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
static void updateWithAPE(LocalError &le, const GeomDet &det)
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
static int position[TOTALCHAMBERS][3]
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
virtual const Topology & topology() const =0
virtual float localPitch(const LocalPoint &) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
std::pair< LocalPoint, LocalPoint > StripPosition
SiStripRecHitMatcher(const edm::ParameterSet &conf)
DetId geographicalId() const
The label of this GeomDet.
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
SimpleHitCollection::const_iterator SimpleHitIterator
virtual LocalPoint localPosition(float strip) const =0
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
ROOT::Math::SVector< double, 2 > AlgebraicVector2
const GeomDetUnit * stereoDet() const