CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
SiStripRecHitMatcher Class Reference

#include <SiStripRecHitMatcher.h>

Public Types

typedef boost::function< void(SiStripMatchedRecHit2D const &)> Collector
 
typedef SiStripMatchedRecHit2DCollectionNew::FastFiller CollectorMatched
 
typedef SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
 
typedef std::vector< const SiStripRecHit2D * > SimpleHitCollection
 
typedef SimpleHitCollection::const_iterator SimpleHitIterator
 
typedef std::pair< LocalPoint, LocalPointStripPosition
 

Public Member Functions

template<typename MonoIterator , typename StereoIterator , typename CollectorHelper >
void doubleMatch (MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
 
std::unique_ptr< SiStripMatchedRecHit2Dmatch (const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
 
void match (const SiStripRecHit2D *monoRH, RecHitIterator begin, RecHitIterator end, CollectorMatched &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, CollectorMatched &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, edm::OwnVector< SiStripMatchedRecHit2D > &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, std::vector< SiStripMatchedRecHit2D * > &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 
void match (const SiStripRecHit2D *monoRH, SimpleHitIterator begin, SimpleHitIterator end, Collector &collector, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
 the actual implementation More...
 
bool preFilter () const
 
StripPosition project (const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
 
 SiStripRecHitMatcher (const edm::ParameterSet &conf)
 
 SiStripRecHitMatcher (const double theScale)
 

Static Public Member Functions

static float sigmaPitch (LocalPoint const &pos, LocalError const &err, const StripTopology &topol)
 

Public Attributes

bool preFilter_ =false
 
float scale_
 

Detailed Description

Definition at line 26 of file SiStripRecHitMatcher.h.

Member Typedef Documentation

typedef boost::function<void(SiStripMatchedRecHit2D const&)> SiStripRecHitMatcher::Collector

Definition at line 36 of file SiStripRecHitMatcher.h.

Definition at line 30 of file SiStripRecHitMatcher.h.

Definition at line 32 of file SiStripRecHitMatcher.h.

Definition at line 33 of file SiStripRecHitMatcher.h.

typedef SimpleHitCollection::const_iterator SiStripRecHitMatcher::SimpleHitIterator

Definition at line 34 of file SiStripRecHitMatcher.h.

Definition at line 39 of file SiStripRecHitMatcher.h.

Constructor & Destructor Documentation

SiStripRecHitMatcher::SiStripRecHitMatcher ( const edm::ParameterSet conf)

Definition at line 18 of file SiStripRecHitMatcher.cc.

18  :
19  scale_(conf.getParameter<double>("NSigmaInside")),
20  preFilter_(conf.existsAs<bool>("PreFilter") ? conf.getParameter<bool>("PreFilter") : false)
21  {}
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
SiStripRecHitMatcher::SiStripRecHitMatcher ( const double  theScale)

Member Function Documentation

template<typename MonoIterator , typename StereoIterator , typename CollectorHelper >
void SiStripRecHitMatcher::doubleMatch ( MonoIterator  monoRHiter,
MonoIterator  monoRHend,
StereoIterator  seconditer,
StereoIterator  seconditerend,
const GluedGeomDet gluedDet,
LocalVector  trdir,
CollectorHelper &  collectorHelper 
) const
std::unique_ptr< SiStripMatchedRecHit2D > SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
const SiStripRecHit2D stereoRH,
const GluedGeomDet gluedDet,
LocalVector  trackdirection,
bool  force 
) const

Definition at line 269 of file SiStripRecHitMatcher.cc.

References EnergyCorrector::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, diffTreeTool::diff, relativeConstraints::error, f, objects.autophobj::float, StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), BaseTrackerRecHit::localPositionFast(), funct::m, PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementPosition(), GluedGeomDet::monoDet(), position, project(), indexGen::s2, scale_, sigmaPitch(), GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDet::topology(), x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, and geometryCSVtoXML::yy.

Referenced by TkGluedMeasurementDet::collectRecHits(), SiStripRecHitConverterAlgorithm::match(), match(), TkClonerImpl::operator()(), and sigmaPitch().

272  {
273  // stripdet = mono
274  // partnerstripdet = stereo
275  const GeomDetUnit* stripdet = gluedDet->monoDet();
276  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
277  const StripTopology& topol=(const StripTopology&)stripdet->topology();
278 
279  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
280  auto RPHIpointX = topol.measurementPosition(monoRH->localPositionFast()).x();
281  MeasurementPoint RPHIpointini(RPHIpointX,-0.5f);
282  MeasurementPoint RPHIpointend(RPHIpointX,0.5f);
283 
284  // position of the initial and final point of the strip in local coordinates (mono det)
285  StripPosition stripmono=StripPosition(topol.localPosition(RPHIpointini),topol.localPosition(RPHIpointend));
286 
287  if(trackdirection.mag2()<float(FLT_MIN)){// in case of no track hypothesis assume a track from the origin through the center of the strip
288  const LocalPoint& lcenterofstrip=monoRH->localPositionFast();
289  GlobalPoint gcenterofstrip=(stripdet->surface()).toGlobal(lcenterofstrip);
290  GlobalVector gtrackdirection=gcenterofstrip-GlobalPoint(0,0,0);
291  trackdirection=(gluedDet->surface()).toLocal(gtrackdirection);
292  }
293 
294  //project mono hit on glued det
295  StripPosition projectedstripmono=project(stripdet,gluedDet,stripmono,trackdirection);
296  const StripTopology& partnertopol=(const StripTopology&)partnerstripdet->topology();
297 
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();
301 
302  //error calculation (the part that depends on mono RH only)
303  // LocalVector RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
304  /*
305  double l1 = 1./RPHIpositiononGluedendvector.perp2();
306  double c1 = RPHIpositiononGluedendvector.y();
307  double s1 =-RPHIpositiononGluedendvector.x();
308  */
309  double c1 = -m00;
310  double s1 = -m01;
311  double l1 = 1./(c1*c1+s1*s1);
312 
313 
314  double sigmap12 = sigmaPitch(monoRH->localPosition(), monoRH->localPositionError(),topol);
315  // auto sigmap12 = monoRH->sigmaPitch();
316  // assert(sigmap12>=0);
317 
318 
319 
320 
321  // position of the initial and final point of the strip (STEREO cluster)
322  auto STEREOpointX=partnertopol.measurementPosition(stereoRH->localPositionFast()).x();
323  MeasurementPoint STEREOpointini(STEREOpointX,-0.5f);
324  MeasurementPoint STEREOpointend(STEREOpointX,0.5f);
325 
326  // position of the initial and final point of the strip in local coordinates (stereo det)
327  StripPosition stripstereo(partnertopol.localPosition(STEREOpointini),partnertopol.localPosition(STEREOpointend));
328 
329  //project stereo hit on glued det
330  StripPosition projectedstripstereo=project(partnerstripdet,gluedDet,stripstereo,trackdirection);
331 
332 
333  double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
334  double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
335 
336  //perform the matching
337  //(x2-x1)(y-y1)=(y2-y1)(x-x1)
338  AlgebraicMatrix22 m(ROOT::Math::SMatrixNoInit{});
339  AlgebraicVector2 c(c0,m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x());
340  m(0,0)=m00;
341  m(0,1)=m01;
342  m(1,0)=m10;
343  m(1,1)=m11;
344  m.Invert();
345  AlgebraicVector2 solution = m * c;
346  Local2DPoint position(solution(0),solution(1));
347 
348 
349  if ((!force) && (!((gluedDet->surface()).bounds().inside(position,10.f*scale_))) ) return std::unique_ptr<SiStripMatchedRecHit2D>(nullptr);
350 
351  double c2 = -m10;
352  double s2 = -m11;
353  double l2 = 1./(c2*c2+s2*s2);
354 
355 
356  double sigmap22 = sigmaPitch(stereoRH->localPosition(),stereoRH->localPositionError(),partnertopol);
357  // auto sigmap22 = stereoRH->sigmaPitch();
358  // assert (sigmap22>0);
359 
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);
365  LocalError error(xx,xy,yy);
366 
367 
368  //if it is inside the gluedet bonds
369  //Change NSigmaInside in the configuration file to accept more hits
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);
373 }
T mag2() const
Definition: PV3DBase.h:66
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
virtual const Topology & topology() const
Definition: GeomDet.cc:81
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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.
Definition: GeomDet.h:42
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
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
double f[11][100]
static int position[264][3]
Definition: ReadPGInfo.cc:509
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
ROOT::Math::SVector< double, 2 > AlgebraicVector2
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
RecHitIterator  begin,
RecHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 83 of file SiStripRecHitMatcher.cc.

References end, mps_fire::i, and match().

87  {
88 
89  // is this really needed now????
90  SimpleHitCollection stereoHits;
91  stereoHits.reserve(end-begin);
92  for (RecHitIterator i=begin; i != end; ++i)
93  stereoHits.push_back( &(*i)); // convert to simple pointer
94 
95  return match( monoRH,
96  stereoHits.begin(), stereoHits.end(),
97  collector,
98  gluedDet,trackdirection);
99 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
#define end
Definition: vmac.h:39
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator
#define begin
Definition: vmac.h:32
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 68 of file SiStripRecHitMatcher.cc.

References match(), and mps_fire::result.

72  {
73 
74  Collector result(boost::bind(pb2,boost::ref(collector),_1));
75  match(monoRH,begin,end,result,gluedDet,trackdirection);
76 
77 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
edm::OwnVector< SiStripMatchedRecHit2D > &  collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 42 of file SiStripRecHitMatcher.cc.

References match(), AlCaHLTBitMon_ParallelJobs::p, edm::OwnVector< T, P >::push_back(), and mps_fire::result.

46  {
47 
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();
52  p++) collector.push_back(*p);
53 }
void push_back(D *&d)
Definition: OwnVector.h:290
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
std::vector< SiStripMatchedRecHit2D * > &  collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 57 of file SiStripRecHitMatcher.cc.

References SiStripMatchedRecHit2D::clone(), match(), and mps_fire::result.

61  {
62  Collector result(boost::bind(&pb1,boost::ref(collector),
63  boost::bind(&SiStripMatchedRecHit2D::clone,_1)));
64  match(monoRH,begin,end,result,gluedDet,trackdirection);
65 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
SiStripMatchedRecHit2D * clone() const override
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
Collector collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

the actual implementation

Definition at line 105 of file SiStripRecHitMatcher.cc.

References EnergyCorrector::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, diffTreeTool::diff, end, relativeConstraints::error, StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), BaseTrackerRecHit::localPositionFast(), funct::m, PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementPosition(), GluedGeomDet::monoDet(), position, project(), indexGen::s2, scale_, sigmaPitch(), GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDet::topology(), x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, and geometryCSVtoXML::yy.

109  {
110  // stripdet = mono
111  // partnerstripdet = stereo
112  const GeomDetUnit* stripdet = gluedDet->monoDet();
113  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
114  const StripTopology& topol=(const StripTopology&)stripdet->topology();
115 
116  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
117  double RPHIpointX = topol.measurementPosition(monoRH->localPositionFast()).x();
118  MeasurementPoint RPHIpointini(RPHIpointX,-0.5);
119  MeasurementPoint RPHIpointend(RPHIpointX,0.5);
120 
121  // position of the initial and final point of the strip in local coordinates (mono det)
122  StripPosition stripmono=StripPosition(topol.localPosition(RPHIpointini),topol.localPosition(RPHIpointend));
123 
124  if(trackdirection.mag2()<FLT_MIN){// in case of no track hypothesis assume a track from the origin through the center of the strip
125  const LocalPoint& lcenterofstrip=monoRH->localPositionFast();
126  GlobalPoint gcenterofstrip=(stripdet->surface()).toGlobal(lcenterofstrip);
127  GlobalVector gtrackdirection=gcenterofstrip-GlobalPoint(0,0,0);
128  trackdirection=(gluedDet->surface()).toLocal(gtrackdirection);
129  }
130 
131  //project mono hit on glued det
132  StripPosition projectedstripmono=project(stripdet,gluedDet,stripmono,trackdirection);
133  const StripTopology& partnertopol=(const StripTopology&)partnerstripdet->topology();
134 
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();
138 
139  //error calculation (the part that depends on mono RH only)
140  // LocalVector RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
141  /*
142  double l1 = 1./RPHIpositiononGluedendvector.perp2();
143  double c1 = RPHIpositiononGluedendvector.y();
144  double s1 =-RPHIpositiononGluedendvector.x();
145  */
146  double c1 = -m00;
147  double s1 = -m01;
148  double l1 = 1./(c1*c1+s1*s1);
149 
150 
151  double sigmap12 = sigmaPitch(monoRH->localPosition(), monoRH->localPositionError(),topol);
152  // auto sigmap12 = monoRH->sigmaPitch();
153  // assert(sigmap12>=0);
154 
155 
156  SimpleHitIterator seconditer;
157 
158  for(seconditer=begin;seconditer!=end;++seconditer){//iterate on stereo rechits
159 
160  // position of the initial and final point of the strip (STEREO cluster)
161  double STEREOpointX=partnertopol.measurementPosition((*seconditer)->localPositionFast()).x();
162  MeasurementPoint STEREOpointini(STEREOpointX,-0.5);
163  MeasurementPoint STEREOpointend(STEREOpointX,0.5);
164 
165  // position of the initial and final point of the strip in local coordinates (stereo det)
166  StripPosition stripstereo(partnertopol.localPosition(STEREOpointini),partnertopol.localPosition(STEREOpointend));
167 
168  //project stereo hit on glued det
169  StripPosition projectedstripstereo=project(partnerstripdet,gluedDet,stripstereo,trackdirection);
170 
171 
172  double m10=-(projectedstripstereo.second.y()-projectedstripstereo.first.y());
173  double m11=(projectedstripstereo.second.x()-projectedstripstereo.first.x());
174 
175  //perform the matching
176  //(x2-x1)(y-y1)=(y2-y1)(x-x1)
177  AlgebraicMatrix22 m; AlgebraicVector2 c; // FIXME understand why moving this initializer out of the loop changes the output!
178  m(0,0)=m00;
179  m(0,1)=m01;
180  m(1,0)=m10;
181  m(1,1)=m11;
182  c(0)=c0;
183  c(1)=m11*projectedstripstereo.first.y()+m10*projectedstripstereo.first.x();
184  m.Invert();
185  AlgebraicVector2 solution = m * c;
186  LocalPoint position(solution(0),solution(1));
187 
188  /*
189  {
190  double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y());
191  double m01 = (projectedstripmono.second.x()-projectedstripmono.first.x());
192  double m10 = -(projectedstripstereo.second.y()-projectedstripstereo.first.y());
193  double m11 = (projectedstripstereo.second.x()-projectedstripstereo.first.x());
194  double c0 = m01*projectedstripmono.first.y() + m00*projectedstripmono.first.x();
195  double c1 = m11*projectedstripstereo.first.y() + m10*projectedstripstereo.first.x();
196 
197  double invDet = 1./(m00*m11-m10*m01);
198  }
199  */
200 
201  //
202  // temporary fix by tommaso
203  //
204 
205 
206  LocalError tempError (100,0,100);
207  if (!((gluedDet->surface()).bounds().inside(position,tempError,scale_))) continue;
208 
209  // then calculate the error
210  /*
211  LocalVector stereopositiononGluedendvector=projectedstripstereo.second-projectedstripstereo.first;
212  double l2 = 1./stereopositiononGluedendvector.perp2();
213  double c2 = stereopositiononGluedendvector.y();
214  double s2 =-stereopositiononGluedendvector.x();
215  */
216 
217  double c2 = -m10;
218  double s2 = -m11;
219  double l2 = 1./(c2*c2+s2*s2);
220 
221  double sigmap22 = sigmaPitch((*seconditer)->localPosition(),(*seconditer)->localPositionError(),partnertopol);
222  // auto sigmap22 = (*seconditer)->sigmaPitch();
223  // assert(sigmap22>=0);
224 
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);
230  LocalError error(xx,xy,yy);
231 
232  if((gluedDet->surface()).bounds().inside(position,error,scale_)){ //if it is inside the gluedet bonds
233  //Change NSigmaInside in the configuration file to accept more hits
234  //...and add it to the Rechit collection
235 
236  const SiStripRecHit2D* secondHit = *seconditer;
237  collector(SiStripMatchedRecHit2D(position, error,*gluedDet,
238  monoRH,secondHit));
239  }
240  }
241 }
T mag2() const
Definition: PV3DBase.h:66
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
virtual const Topology & topology() const
Definition: GeomDet.cc:81
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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.
Definition: GeomDet.h:42
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
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
SimpleHitCollection::const_iterator SimpleHitIterator
static int position[264][3]
Definition: ReadPGInfo.cc:509
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
ROOT::Math::SVector< double, 2 > AlgebraicVector2
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
bool SiStripRecHitMatcher::preFilter ( ) const
inline

Definition at line 44 of file SiStripRecHitMatcher.h.

References preFilter_.

SiStripRecHitMatcher::StripPosition SiStripRecHitMatcher::project ( const GeomDetUnit det,
const GluedGeomDet glueddet,
StripPosition  strip,
LocalVector  trackdirection 
) const

Definition at line 245 of file SiStripRecHitMatcher.cc.

References Scenarios_cff::scale, GeomDet::surface(), toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by match(), and sigmaPitch().

246  {
247 
248  GlobalPoint globalpointini=(det->surface()).toGlobal(strip.first);
249  GlobalPoint globalpointend=(det->surface()).toGlobal(strip.second);
250 
251  // position of the initial and final point of the strip in glued local coordinates
252  LocalPoint positiononGluedini=(glueddet->surface()).toLocal(globalpointini);
253  LocalPoint positiononGluedend=(glueddet->surface()).toLocal(globalpointend);
254 
255  //correct the position with the track direction
256 
257  float scale=-positiononGluedini.z()/trackdirection.z();
258 
259  LocalPoint projpositiononGluedini= positiononGluedini + scale*trackdirection;
260  LocalPoint projpositiononGluedend= positiononGluedend + scale*trackdirection;
261 
262  return StripPosition(projpositiononGluedini,projpositiononGluedend);
263 }
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
std::pair< LocalPoint, LocalPoint > StripPosition
T z() const
Definition: PV3DBase.h:64
static float SiStripRecHitMatcher::sigmaPitch ( LocalPoint const &  pos,
LocalError const &  err,
const StripTopology topol 
)
inlinestatic

Definition at line 48 of file SiStripRecHitMatcher.h.

References begin, doubleMatch(), end, relativeConstraints::error, cmsStageWithFailover::force, StripTopology::localPitch(), match(), Topology::measurementError(), project(), digitizers_cfi::strip, and MeasurementError::uu().

Referenced by match().

49  {
51  auto pitch=topol.localPitch(pos);
52  return error.uu()*pitch*pitch;
53  }
float uu() const
virtual float localPitch(const LocalPoint &) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0

Member Data Documentation

bool SiStripRecHitMatcher::preFilter_ =false

Definition at line 124 of file SiStripRecHitMatcher.h.

Referenced by preFilter().

float SiStripRecHitMatcher::scale_

Definition at line 123 of file SiStripRecHitMatcher.h.

Referenced by match().