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 25 of file SiStripRecHitMatcher.h.

Member Typedef Documentation

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

Definition at line 34 of file SiStripRecHitMatcher.h.

Definition at line 28 of file SiStripRecHitMatcher.h.

Definition at line 30 of file SiStripRecHitMatcher.h.

Definition at line 31 of file SiStripRecHitMatcher.h.

typedef SimpleHitCollection::const_iterator SiStripRecHitMatcher::SimpleHitIterator

Definition at line 32 of file SiStripRecHitMatcher.h.

Definition at line 36 of file SiStripRecHitMatcher.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file SiStripRecHitMatcher.cc.

16  : scale_(conf.getParameter<double>("NSigmaInside")),
17  preFilter_(conf.existsAs<bool>("PreFilter") ? conf.getParameter<bool>("PreFilter") : false) {}
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:160
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 238 of file SiStripRecHitMatcher.cc.

References HltBtagPostValidation_cff::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, change_name::diff, relativeConstraints::error, f, StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), BaseTrackerRecHit::localPositionFast(), visualization-live-secondInstance_cfg::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().

242  {
243  // stripdet = mono
244  // partnerstripdet = stereo
245  const GeomDetUnit* stripdet = gluedDet->monoDet();
246  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
247  const StripTopology& topol = (const StripTopology&)stripdet->topology();
248 
249  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
250  auto RPHIpointX = topol.measurementPosition(monoRH->localPositionFast()).x();
251  MeasurementPoint RPHIpointini(RPHIpointX, -0.5f);
252  MeasurementPoint RPHIpointend(RPHIpointX, 0.5f);
253 
254  // position of the initial and final point of the strip in local coordinates (mono det)
255  StripPosition stripmono = StripPosition(topol.localPosition(RPHIpointini), topol.localPosition(RPHIpointend));
256 
257  // in case of no track hypothesis assume a track from the origin through the center of the strip
258  if (trackdirection.mag2() < FLT_MIN) {
259  const LocalPoint& lcenterofstrip = monoRH->localPositionFast();
260  GlobalPoint gcenterofstrip = (stripdet->surface()).toGlobal(lcenterofstrip);
261  GlobalVector gtrackdirection = gcenterofstrip - GlobalPoint(0, 0, 0);
262  trackdirection = (gluedDet->surface()).toLocal(gtrackdirection);
263  }
264 
265  //project mono hit on glued det
266  StripPosition projectedstripmono = project(stripdet, gluedDet, stripmono, trackdirection);
267  const StripTopology& partnertopol = (const StripTopology&)partnerstripdet->topology();
268 
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();
272 
273  //error calculation (the part that depends on mono RH only)
274  // LocalVector RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
275  /*
276  double l1 = 1./RPHIpositiononGluedendvector.perp2();
277  double c1 = RPHIpositiononGluedendvector.y();
278  double s1 =-RPHIpositiononGluedendvector.x();
279  */
280  double c1 = -m00;
281  double s1 = -m01;
282  double l1 = 1. / (c1 * c1 + s1 * s1);
283 
284  double sigmap12 = sigmaPitch(monoRH->localPosition(), monoRH->localPositionError(), topol);
285  // auto sigmap12 = monoRH->sigmaPitch();
286  // assert(sigmap12>=0);
287 
288  // position of the initial and final point of the strip (STEREO cluster)
289  auto STEREOpointX = partnertopol.measurementPosition(stereoRH->localPositionFast()).x();
290  MeasurementPoint STEREOpointini(STEREOpointX, -0.5f);
291  MeasurementPoint STEREOpointend(STEREOpointX, 0.5f);
292 
293  // position of the initial and final point of the strip in local coordinates (stereo det)
294  StripPosition stripstereo(partnertopol.localPosition(STEREOpointini), partnertopol.localPosition(STEREOpointend));
295 
296  //project stereo hit on glued det
297  StripPosition projectedstripstereo = project(partnerstripdet, gluedDet, stripstereo, trackdirection);
298 
299  double m10 = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
300  double m11 = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
301 
302  //perform the matching
303  //(x2-x1)(y-y1)=(y2-y1)(x-x1)
304  AlgebraicMatrix22 m(ROOT::Math::SMatrixNoInit{});
305  AlgebraicVector2 c(c0, m11 * projectedstripstereo.first.y() + m10 * projectedstripstereo.first.x());
306  m(0, 0) = m00;
307  m(0, 1) = m01;
308  m(1, 0) = m10;
309  m(1, 1) = m11;
310  m.Invert();
311  AlgebraicVector2 solution = m * c;
312  Local2DPoint position(solution(0), solution(1));
313 
314  if ((!force) && (!((gluedDet->surface()).bounds().inside(position, 10.f * scale_))))
315  return std::unique_ptr<SiStripMatchedRecHit2D>(nullptr);
316 
317  double c2 = -m10;
318  double s2 = -m11;
319  double l2 = 1. / (c2 * c2 + s2 * s2);
320 
321  double sigmap22 = sigmaPitch(stereoRH->localPosition(), stereoRH->localPositionError(), partnertopol);
322  // auto sigmap22 = stereoRH->sigmaPitch();
323  // assert (sigmap22>0);
324 
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);
330  LocalError error(xx, xy, yy);
331 
332  //if it is inside the gluedet bonds
333  //Change NSigmaInside in the configuration file to accept more hits
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);
337 }
T mag2() const
Definition: PV3DBase.h:63
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
virtual const Topology & topology() const
Definition: GeomDet.cc:67
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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.
Definition: GeomDet.h:37
ROOT::Math::SVector< double, 2 > AlgebraicVector2
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:289
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
RecHitIterator  begin,
RecHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 63 of file SiStripRecHitMatcher.cc.

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

68  {
69  // is this really needed now????
70  SimpleHitCollection stereoHits;
71  stereoHits.reserve(end - begin);
72  for (RecHitIterator i = begin; i != end; ++i)
73  stereoHits.push_back(&(*i)); // convert to simple pointer
74 
75  return match(monoRH, stereoHits.begin(), stereoHits.end(), collector, gluedDet, trackdirection);
76 }
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 52 of file SiStripRecHitMatcher.cc.

References match(), and mps_fire::result.

57  {
58  Collector result(boost::bind(pb2, boost::ref(collector), _1));
59  match(monoRH, begin, end, result, gluedDet, trackdirection);
60 }
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 29 of file SiStripRecHitMatcher.cc.

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

34  {
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++)
39  collector.push_back(*p);
40 }
void push_back(D *&d)
Definition: OwnVector.h:326
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 42 of file SiStripRecHitMatcher.cc.

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

47  {
48  Collector result(boost::bind(&pb1, boost::ref(collector), boost::bind(&SiStripMatchedRecHit2D::clone, _1)));
49  match(monoRH, begin, end, result, gluedDet, trackdirection);
50 }
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 79 of file SiStripRecHitMatcher.cc.

References HltBtagPostValidation_cff::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, change_name::diff, end, relativeConstraints::error, StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), BaseTrackerRecHit::localPositionFast(), visualization-live-secondInstance_cfg::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.

84  {
85  // stripdet = mono
86  // partnerstripdet = stereo
87  const GeomDetUnit* stripdet = gluedDet->monoDet();
88  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
89  const StripTopology& topol = (const StripTopology&)stripdet->topology();
90 
91  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
92  double RPHIpointX = topol.measurementPosition(monoRH->localPositionFast()).x();
93  MeasurementPoint RPHIpointini(RPHIpointX, -0.5);
94  MeasurementPoint RPHIpointend(RPHIpointX, 0.5);
95 
96  // position of the initial and final point of the strip in local coordinates (mono det)
97  StripPosition stripmono = StripPosition(topol.localPosition(RPHIpointini), topol.localPosition(RPHIpointend));
98 
99  // in case of no track hypothesis assume a track from the origin through the center of the strip
100  if (trackdirection.mag2() < FLT_MIN) {
101  const LocalPoint& lcenterofstrip = monoRH->localPositionFast();
102  GlobalPoint gcenterofstrip = (stripdet->surface()).toGlobal(lcenterofstrip);
103  GlobalVector gtrackdirection = gcenterofstrip - GlobalPoint(0, 0, 0);
104  trackdirection = (gluedDet->surface()).toLocal(gtrackdirection);
105  }
106 
107  //project mono hit on glued det
108  StripPosition projectedstripmono = project(stripdet, gluedDet, stripmono, trackdirection);
109  const StripTopology& partnertopol = (const StripTopology&)partnerstripdet->topology();
110 
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();
114 
115  //error calculation (the part that depends on mono RH only)
116  // LocalVector RPHIpositiononGluedendvector=projectedstripmono.second-projectedstripmono.first;
117  /*
118  double l1 = 1./RPHIpositiononGluedendvector.perp2();
119  double c1 = RPHIpositiononGluedendvector.y();
120  double s1 =-RPHIpositiononGluedendvector.x();
121  */
122  double c1 = -m00;
123  double s1 = -m01;
124  double l1 = 1. / (c1 * c1 + s1 * s1);
125 
126  double sigmap12 = sigmaPitch(monoRH->localPosition(), monoRH->localPositionError(), topol);
127  // auto sigmap12 = monoRH->sigmaPitch();
128  // assert(sigmap12>=0);
129 
130  SimpleHitIterator seconditer;
131 
132  for (seconditer = begin; seconditer != end; ++seconditer) { //iterate on stereo rechits
133 
134  // position of the initial and final point of the strip (STEREO cluster)
135  double STEREOpointX = partnertopol.measurementPosition((*seconditer)->localPositionFast()).x();
136  MeasurementPoint STEREOpointini(STEREOpointX, -0.5);
137  MeasurementPoint STEREOpointend(STEREOpointX, 0.5);
138 
139  // position of the initial and final point of the strip in local coordinates (stereo det)
140  StripPosition stripstereo(partnertopol.localPosition(STEREOpointini), partnertopol.localPosition(STEREOpointend));
141 
142  //project stereo hit on glued det
143  StripPosition projectedstripstereo = project(partnerstripdet, gluedDet, stripstereo, trackdirection);
144 
145  double m10 = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
146  double m11 = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
147 
148  //perform the matching
149  //(x2-x1)(y-y1)=(y2-y1)(x-x1)
151  AlgebraicVector2 c; // FIXME understand why moving this initializer out of the loop changes the output!
152  m(0, 0) = m00;
153  m(0, 1) = m01;
154  m(1, 0) = m10;
155  m(1, 1) = m11;
156  c(0) = c0;
157  c(1) = m11 * projectedstripstereo.first.y() + m10 * projectedstripstereo.first.x();
158  m.Invert();
159  AlgebraicVector2 solution = m * c;
160  LocalPoint position(solution(0), solution(1));
161 
162  /*
163  {
164  double m00 = -(projectedstripmono.second.y()-projectedstripmono.first.y());
165  double m01 = (projectedstripmono.second.x()-projectedstripmono.first.x());
166  double m10 = -(projectedstripstereo.second.y()-projectedstripstereo.first.y());
167  double m11 = (projectedstripstereo.second.x()-projectedstripstereo.first.x());
168  double c0 = m01*projectedstripmono.first.y() + m00*projectedstripmono.first.x();
169  double c1 = m11*projectedstripstereo.first.y() + m10*projectedstripstereo.first.x();
170 
171  double invDet = 1./(m00*m11-m10*m01);
172  }
173  */
174 
175  //
176  // temporary fix by tommaso
177  //
178 
179  LocalError tempError(100, 0, 100);
180  if (!((gluedDet->surface()).bounds().inside(position, tempError, scale_)))
181  continue;
182 
183  // then calculate the error
184  /*
185  LocalVector stereopositiononGluedendvector=projectedstripstereo.second-projectedstripstereo.first;
186  double l2 = 1./stereopositiononGluedendvector.perp2();
187  double c2 = stereopositiononGluedendvector.y();
188  double s2 =-stereopositiononGluedendvector.x();
189  */
190 
191  double c2 = -m10;
192  double s2 = -m11;
193  double l2 = 1. / (c2 * c2 + s2 * s2);
194 
195  double sigmap22 = sigmaPitch((*seconditer)->localPosition(), (*seconditer)->localPositionError(), partnertopol);
196  // auto sigmap22 = (*seconditer)->sigmaPitch();
197  // assert(sigmap22>=0);
198 
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);
204  LocalError error(xx, xy, yy);
205 
206  if ((gluedDet->surface()).bounds().inside(position, error, scale_)) { //if it is inside the gluedet bonds
207  //Change NSigmaInside in the configuration file to accept more hits
208  //...and add it to the Rechit collection
209 
210  const SiStripRecHit2D* secondHit = *seconditer;
211  collector(SiStripMatchedRecHit2D(position, error, *gluedDet, monoRH, secondHit));
212  }
213  }
214 }
T mag2() const
Definition: PV3DBase.h:63
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
virtual const Topology & topology() const
Definition: GeomDet.cc:67
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, StripPosition strip, LocalVector trackdirection) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
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.
Definition: GeomDet.h:37
ROOT::Math::SVector< double, 2 > AlgebraicVector2
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:289
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
LocalPoint localPosition() const final
const LocalPoint & localPositionFast() const
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
bool SiStripRecHitMatcher::preFilter ( ) const
inline

Definition at line 41 of file SiStripRecHitMatcher.h.

References preFilter_.

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

Definition at line 216 of file SiStripRecHitMatcher.cc.

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

Referenced by match(), and sigmaPitch().

219  {
220  GlobalPoint globalpointini = (det->surface()).toGlobal(strip.first);
221  GlobalPoint globalpointend = (det->surface()).toGlobal(strip.second);
222 
223  // position of the initial and final point of the strip in glued local coordinates
224  LocalPoint positiononGluedini = (glueddet->surface()).toLocal(globalpointini);
225  LocalPoint positiononGluedend = (glueddet->surface()).toLocal(globalpointend);
226 
227  //correct the position with the track direction
228 
229  float scale = -positiononGluedini.z() / trackdirection.z();
230 
231  LocalPoint projpositiononGluedini = positiononGluedini + scale * trackdirection;
232  LocalPoint projpositiononGluedend = positiononGluedend + scale * trackdirection;
233 
234  return StripPosition(projpositiononGluedini, projpositiononGluedend);
235 }
std::pair< LocalPoint, LocalPoint > StripPosition
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
T z() const
Definition: PV3DBase.h:61
static float SiStripRecHitMatcher::sigmaPitch ( LocalPoint const &  pos,
LocalError const &  err,
const StripTopology topol 
)
inlinestatic

Definition at line 43 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().

43  {
45  auto pitch = topol.localPitch(pos);
46  return error.uu() * pitch * pitch;
47  }
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 112 of file SiStripRecHitMatcher.h.

Referenced by preFilter().

float SiStripRecHitMatcher::scale_

Definition at line 111 of file SiStripRecHitMatcher.h.

Referenced by match().