56 bool stereLayerFirst)
const;
66 <<
"all rechits in simHit2RecHitMap must be instances of FastSingleTrackerRecHit. recHit's rtti: "
67 <<
recHit->rtti() << std::endl;
69 return dynamic_cast<const FastSingleTrackerRecHit*>(
recHit);
84 produces<FastTrackerRecHitCollection>();
85 produces<FastTrackerRecHitRefCollection>(
"simHit2RecHitMap");
101 auto output_recHits = std::make_unique<FastTrackerRecHitCollection>();
102 auto output_simHit2RecHitMap =
107 bool skipNext =
false;
108 for (
unsigned simHitCounter = 0; simHitCounter <
simHits->size(); ++simHitCounter) {
129 unsigned int subdet = detid.subdetId();
133 (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
141 if (!stripSubDetId.
glued()) {
142 (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
159 if (simHitCounter + 1 <
simHits->size()) {
161 const PSimHit& nextSimHit = (*simHits)[simHitCounter + 1];
172 std::unique_ptr<FastTrackerRecHit> newRecHit(
nullptr);
179 gluedLocalSimTrackDir,
186 output_recHits->push_back(
std::move(newRecHit));
187 (*output_simHit2RecHitMap)[simHitCounter] =
201 bool stereoHitFirst)
const {
219 if (trackdirection.
mag2() < FLT_MIN) {
231 LocalVector RPHIpositiononGluedendvector = projectedstripmono.second - projectedstripmono.first;
232 double c1 =
sin(RPHIpositiononGluedendvector.
phi());
233 double s1 = -
cos(RPHIpositiononGluedendvector.
phi());
236 double sigmap12 = errormonoRH.uu() * pitch * pitch;
248 StripPosition projectedstripstereo =
project(partnerstripdet, gluedDet, stripstereo, trackdirection);
254 m(0, 0) = -(projectedstripmono.second.y() - projectedstripmono.first.y());
255 m(0, 1) = (projectedstripmono.second.x() - projectedstripmono.first.x());
256 m(1, 0) = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
257 m(1, 1) = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
258 c(0) =
m(0, 1) * projectedstripmono.first.y() +
m(0, 0) * projectedstripmono.first.x();
259 c(1) =
m(1, 1) * projectedstripstereo.first.y() +
m(1, 0) * projectedstripstereo.first.x();
271 LocalVector stereopositiononGluedendvector = projectedstripstereo.second - projectedstripstereo.first;
272 double c2 =
sin(stereopositiononGluedendvector.
phi());
273 double s2 = -
cos(stereopositiononGluedendvector.
phi());
277 double sigmap22 = errorstereoRH.uu() * pitch * pitch;
278 double diff = (
c1 * s2 - c2 * s1);
280 float xx = invdet2 * (sigmap12 * s2 * s2 + sigmap22 * s1 * s1);
281 float xy = -invdet2 * (sigmap12 * c2 * s2 + sigmap22 *
c1 * s1);
282 float yy = invdet2 * (sigmap12 * c2 * c2 + sigmap22 *
c1 *
c1);
287 if (det.subdetId() > 2) {
288 return std::make_unique<FastMatchedTrackerRecHit>(
position,
error, *gluedDet, *monoRH, *stereoRH, stereoHitFirst);
293 throw cms::Exception(
"FastTrackerRecHitMatcher") <<
"Matched Pixel!?";
310 float scale = -positiononGluedini.
z() / trackdirection.
z();
312 LocalPoint projpositiononGluedini = positiononGluedini +
scale * trackdirection;
313 LocalPoint projpositiononGluedend = positiononGluedend +
scale * trackdirection;
315 return StripPosition(projpositiononGluedini, projpositiononGluedend);
326 double delta = gluedPlane.localZ(hitPlane.position());
334 if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
351 if ((isMono && isStereo) || (!isMono && !isStereo))
352 throw cms::Exception(
"FastTrackerRecHitMatcher") <<
"Something wrong with DetIds.";
353 return std::make_unique<FastProjectedTrackerRecHit>(projectedHitPos, rotatedError, *gluedDet, *originalRH);