55 bool stereLayerFirst)
const;
65 <<
"all rechits in simHit2RecHitMap must be instances of FastSingleTrackerRecHit. recHit's rtti: "
66 <<
recHit->rtti() << std::endl;
68 return dynamic_cast<const FastSingleTrackerRecHit*>(
recHit);
83 produces<FastTrackerRecHitCollection>();
84 produces<FastTrackerRecHitRefCollection>(
"simHit2RecHitMap");
100 auto output_recHits = std::make_unique<FastTrackerRecHitCollection>();
101 auto output_simHit2RecHitMap =
106 bool skipNext =
false;
107 for (
unsigned simHitCounter = 0; simHitCounter <
simHits->size(); ++simHitCounter) {
128 unsigned int subdet = detid.subdetId();
132 (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
140 if (!stripSubDetId.
glued()) {
141 (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
158 if (simHitCounter + 1 <
simHits->size()) {
160 const PSimHit& nextSimHit = (*simHits)[simHitCounter + 1];
171 std::unique_ptr<FastTrackerRecHit> newRecHit(
nullptr);
178 gluedLocalSimTrackDir,
185 output_recHits->push_back(
std::move(newRecHit));
186 (*output_simHit2RecHitMap)[simHitCounter] =
200 bool stereoHitFirst)
const {
217 if (trackdirection.
mag2() <
230 LocalVector RPHIpositiononGluedendvector = projectedstripmono.second - projectedstripmono.first;
231 double c1 =
sin(RPHIpositiononGluedendvector.
phi());
232 double s1 = -
cos(RPHIpositiononGluedendvector.
phi());
235 double sigmap12 = errormonoRH.uu() * pitch * pitch;
247 StripPosition projectedstripstereo =
project(partnerstripdet, gluedDet, stripstereo, trackdirection);
253 m(0, 0) = -(projectedstripmono.second.y() - projectedstripmono.first.y());
254 m(0, 1) = (projectedstripmono.second.x() - projectedstripmono.first.x());
255 m(1, 0) = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
256 m(1, 1) = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
257 c(0) =
m(0, 1) * projectedstripmono.first.y() +
m(0, 0) * projectedstripmono.first.x();
258 c(1) =
m(1, 1) * projectedstripstereo.first.y() +
m(1, 0) * projectedstripstereo.first.x();
270 LocalVector stereopositiononGluedendvector = projectedstripstereo.second - projectedstripstereo.first;
271 double c2 =
sin(stereopositiononGluedendvector.
phi());
272 double s2 = -
cos(stereopositiononGluedendvector.
phi());
276 double sigmap22 = errorstereoRH.uu() * pitch * pitch;
279 float xx = invdet2 * (sigmap12 *
s2 *
s2 + sigmap22 * s1 * s1);
280 float xy = -invdet2 * (sigmap12 * c2 *
s2 + sigmap22 *
c1 * s1);
281 float yy = invdet2 * (sigmap12 * c2 * c2 + sigmap22 *
c1 *
c1);
286 if (det.subdetId() > 2) {
287 return std::make_unique<FastMatchedTrackerRecHit>(
position,
error, *gluedDet, *monoRH, *stereoRH, stereoHitFirst);
292 throw cms::Exception(
"FastTrackerRecHitMatcher") <<
"Matched Pixel!?";
309 float scale = -positiononGluedini.
z() / trackdirection.
z();
311 LocalPoint projpositiononGluedini = positiononGluedini +
scale * trackdirection;
312 LocalPoint projpositiononGluedend = positiononGluedend +
scale * trackdirection;
314 return StripPosition(projpositiononGluedini, projpositiononGluedend);
325 double delta = gluedPlane.localZ(hitPlane.position());
333 if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
350 if ((isMono && isStereo) || (!isMono && !isStereo))
351 throw cms::Exception(
"FastTrackerRecHitMatcher") <<
"Something wrong with DetIds.";
352 return std::make_unique<FastProjectedTrackerRecHit>(projectedHitPos, rotatedError, *gluedDet, *originalRH);