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 std::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, std::vector< std::unique_ptr< 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

◆ Collector

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

Definition at line 34 of file SiStripRecHitMatcher.h.

◆ CollectorMatched

Definition at line 28 of file SiStripRecHitMatcher.h.

◆ RecHitIterator

Definition at line 30 of file SiStripRecHitMatcher.h.

◆ SimpleHitCollection

Definition at line 31 of file SiStripRecHitMatcher.h.

◆ SimpleHitIterator

typedef SimpleHitCollection::const_iterator SiStripRecHitMatcher::SimpleHitIterator

Definition at line 32 of file SiStripRecHitMatcher.h.

◆ StripPosition

Definition at line 36 of file SiStripRecHitMatcher.h.

Constructor & Destructor Documentation

◆ SiStripRecHitMatcher() [1/2]

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
Definition: ParameterSet.h:307
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172

◆ SiStripRecHitMatcher() [2/2]

SiStripRecHitMatcher::SiStripRecHitMatcher ( const double  theScale)

Definition at line 19 of file SiStripRecHitMatcher.cc.

19 : scale_(theScale) {}

Member Function Documentation

◆ doubleMatch()

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

◆ match() [1/6]

std::unique_ptr< SiStripMatchedRecHit2D > SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
const SiStripRecHit2D stereoRH,
const GluedGeomDet gluedDet,
LocalVector  trackdirection,
bool  force 
) const

Definition at line 239 of file SiStripRecHitMatcher.cc.

References HltBtagPostValidation_cff::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, change_name::diff, relativeConstraints::error, f, cmsStageWithFailover::force, StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), BaseTrackerRecHit::localPositionFast(), visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementPosition(), GluedGeomDet::monoDet(), position, project(), scale_, sigmaPitch(), GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDet::topology(), x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, and geometryCSVtoXML::yy.

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

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

◆ match() [2/6]

void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
RecHitIterator  begin,
RecHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 64 of file SiStripRecHitMatcher.cc.

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

69  {
70  // is this really needed now????
71  SimpleHitCollection stereoHits;
72  stereoHits.reserve(end - begin);
73  for (RecHitIterator i = begin; i != end; ++i)
74  stereoHits.push_back(&(*i)); // convert to simple pointer
75 
76  return match(monoRH, stereoHits.begin(), stereoHits.end(), collector, gluedDet, trackdirection);
77 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollectionNew::DetSet::const_iterator RecHitIterator

◆ match() [3/6]

void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
CollectorMatched collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 53 of file SiStripRecHitMatcher.cc.

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

58  {
59  Collector result(std::bind(pb2, std::ref(collector), std::placeholders::_1));
60  match(monoRH, begin, end, result, gluedDet, trackdirection);
61 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
std::function< void(SiStripMatchedRecHit2D const &)> Collector

◆ match() [4/6]

void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
std::vector< std::unique_ptr< SiStripMatchedRecHit2D >> &  collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

Definition at line 29 of file SiStripRecHitMatcher.cc.

References mps_fire::end, match(), AlCaHLTBitMon_ParallelJobs::p, 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.emplace_back(*p);
40 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const

◆ match() [5/6]

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(), mps_fire::end, match(), and mps_fire::result.

47  {
49  std::bind(&pb1, std::ref(collector), std::bind(&SiStripMatchedRecHit2D::clone, std::placeholders::_1)));
50  match(monoRH, begin, end, result, gluedDet, trackdirection);
51 }
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
std::function< void(SiStripMatchedRecHit2D const &)> Collector
SiStripMatchedRecHit2D * clone() const override

◆ match() [6/6]

void SiStripRecHitMatcher::match ( const SiStripRecHit2D monoRH,
SimpleHitIterator  begin,
SimpleHitIterator  end,
Collector collector,
const GluedGeomDet gluedDet,
LocalVector  trackdirection 
) const

the actual implementation

Definition at line 80 of file SiStripRecHitMatcher.cc.

References HltBtagPostValidation_cff::c, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, change_name::diff, mps_fire::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(), scale_, sigmaPitch(), GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDet::topology(), x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, and geometryCSVtoXML::yy.

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

◆ preFilter()

bool SiStripRecHitMatcher::preFilter ( ) const
inline

Definition at line 41 of file SiStripRecHitMatcher.h.

References preFilter_.

◆ project()

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

Definition at line 217 of file SiStripRecHitMatcher.cc.

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

Referenced by match().

220  {
221  GlobalPoint globalpointini = (det->surface()).toGlobal(strip.first);
222  GlobalPoint globalpointend = (det->surface()).toGlobal(strip.second);
223 
224  // position of the initial and final point of the strip in glued local coordinates
225  LocalPoint positiononGluedini = (glueddet->surface()).toLocal(globalpointini);
226  LocalPoint positiononGluedend = (glueddet->surface()).toLocal(globalpointend);
227 
228  //correct the position with the track direction
229 
230  float scale = -positiononGluedini.z() / trackdirection.z();
231 
232  LocalPoint projpositiononGluedini = positiononGluedini + scale * trackdirection;
233  LocalPoint projpositiononGluedend = positiononGluedend + scale * trackdirection;
234 
235  return StripPosition(projpositiononGluedini, projpositiononGluedend);
236 }
T z() const
Definition: PV3DBase.h:61
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

◆ sigmaPitch()

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

Definition at line 43 of file SiStripRecHitMatcher.h.

References submitPVResolutionJobs::err, relativeConstraints::error, StripTopology::localPitch(), and Topology::measurementError().

Referenced by match().

43  {
45  auto pitch = topol.localPitch(pos);
46  return error.uu() * pitch * pitch;
47  }
virtual float localPitch(const LocalPoint &) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0

Member Data Documentation

◆ preFilter_

bool SiStripRecHitMatcher::preFilter_ = false

Definition at line 112 of file SiStripRecHitMatcher.h.

Referenced by preFilter().

◆ scale_

float SiStripRecHitMatcher::scale_

Definition at line 111 of file SiStripRecHitMatcher.h.

Referenced by match().