256 float SCl_phi = xmeas.
phi();
258 int charge = int(fcharge);
260 vector<pair<RecHitWithDist, ConstRecHitPointer> >
result;
261 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] entering .. ";
263 vector<TrajectoryMeasurement> validMeasurements;
264 vector<TrajectoryMeasurement> invalidMeasurements;
266 typedef vector<TrajectoryMeasurement>::const_iterator aMeas;
271 typedef vector<BarrelDetLayer*>::const_iterator BarrelLayerIterator;
280 if (tsos.isValid()) {
281 vector<TrajectoryMeasurement> pixelMeasurements =
285 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] nbr of hits compatible with extrapolation to first layer: " << pixelMeasurements.size();
286 for (aMeas
m=pixelMeasurements.begin();
m!=pixelMeasurements.end();
m++){
287 if (
m->recHit()->isValid()) {
288 float localDphi =
normalized_phi(SCl_phi-
m->forwardPredictedState().globalPosition().phi()) ;
289 if(
std::abs(localDphi)>2.5)
continue;
290 CLHEP::Hep3Vector prediction(
m->forwardPredictedState().globalPosition().x(),
291 m->forwardPredictedState().globalPosition().y(),
292 m->forwardPredictedState().globalPosition().z());
293 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] compatible hit position " <<
m->recHit()->globalPosition();
294 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] predicted position " <<
m->forwardPredictedState().globalPosition();
297 validMeasurements.push_back(*
m);
299 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] Found a rechit in layer ";
304 else LogDebug(
"") <<
"Could not downcast!!";
312 vector<TrajectoryMeasurement> pixel2Measurements =
316 for (aMeas
m=pixel2Measurements.begin();
m!=pixel2Measurements.end();
m++){
317 if (
m->recHit()->isValid()) {
318 float localDphi =
normalized_phi(SCl_phi-
m->forwardPredictedState().globalPosition().phi()) ;
319 if(
std::abs(localDphi)>2.5)
continue;
320 CLHEP::Hep3Vector prediction(
m->forwardPredictedState().globalPosition().x(),
321 m->forwardPredictedState().globalPosition().y(),
322 m->forwardPredictedState().globalPosition().z());
324 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] compatible hit position " <<
m->recHit()->globalPosition() << endl;
325 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] predicted position " <<
m->forwardPredictedState().globalPosition() << endl;
327 validMeasurements.push_back(*
m);
328 LogDebug(
"") <<
"[PixelHitMatcher::compatibleHits] Found a rechit in layer ";
333 else LogDebug(
"") <<
"Could not downcast!!";
341 typedef vector<ForwardDetLayer*>::const_iterator ForwardLayerIterator;
342 ForwardLayerIterator flayer;
345 if (tsosfwd.isValid()) {
347 for (
int i=0;
i<2;
i++) {
350 if (
i==0 && xmeas.
z() < -100. )
continue;
351 if (
i==1 && xmeas.
z() > 100. )
continue;
353 vector<TrajectoryMeasurement> pixelMeasurements =
357 for (aMeas
m=pixelMeasurements.begin();
m!=pixelMeasurements.end();
m++){
358 if (
m->recHit()->isValid()) {
359 float localDphi =
normalized_phi(SCl_phi-
m->forwardPredictedState().globalPosition().phi());
360 if(
std::abs(localDphi)>2.5)
continue;
361 CLHEP::Hep3Vector prediction(
m->forwardPredictedState().globalPosition().x(),
362 m->forwardPredictedState().globalPosition().y(),
363 m->forwardPredictedState().globalPosition().z());
366 validMeasurements.push_back(*
m);
374 vector<TrajectoryMeasurement> pixel2Measurements =
378 for (aMeas
m=pixel2Measurements.begin();
m!=pixel2Measurements.end();
m++){
379 if (
m->recHit()->isValid()) {
380 float localDphi =
normalized_phi(SCl_phi-
m->forwardPredictedState().globalPosition().phi()) ;
381 if(
std::abs(localDphi)>2.5)
continue;
382 CLHEP::Hep3Vector prediction(
m->forwardPredictedState().globalPosition().x(),
383 m->forwardPredictedState().globalPosition().y(),
384 m->forwardPredictedState().globalPosition().z());
387 validMeasurements.push_back(*
m);
396 for (
unsigned i=0;
i<validMeasurements.size();
i++){
406 validMeasurements[
i].recHit()->localPosition()).
z();
407 double pxHit1x = validMeasurements[
i].recHit()->det()->surface().toGlobal(
408 validMeasurements[
i].recHit()->localPosition()).x();
409 double pxHit1y = validMeasurements[
i].recHit()->det()->surface().toGlobal(
410 validMeasurements[
i].recHit()->localPosition()).y();
411 double r1diff = (pxHit1x-vprim.
x())*(pxHit1x-vprim.
x()) + (pxHit1y-vprim.
y())*(pxHit1y-vprim.
y());
413 double r2diff = (xmeas.
x()-pxHit1x)*(xmeas.
x()-pxHit1x) + (xmeas.
y()-pxHit1y)*(xmeas.
y()-pxHit1y);
415 zVertex = pxHit1z - r1diff*(xmeas.
z()-pxHit1z)/r2diff;
427 GlobalPoint hitPos( validMeasurements[
i].recHit()->det()->surface().toGlobal( validMeasurements[
i].recHit()->localPosition() ) ) ;
434 vector<CLHEP::Hep3Vector> predictions = secondHit.predictionInNextLayers();
436 for (
unsigned it = 0; it < predictions.size(); it++)
pred2Meas.push_back(predictions[it]);
442 if(!secondHit.measurementsInNextLayers().empty()){
443 for(
unsigned int shit=0; shit<secondHit.measurementsInNextLayers().size(); shit++)
452 pxrh = secondHit.measurementsInNextLayers()[shit].recHit();
454 pair<RecHitWithDist,ConstRecHitPointer> compatiblePair = pair<RecHitWithDist,ConstRecHitPointer>(rh,pxrh) ;
455 result.push_back(compatiblePair);
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
BarrelMeasurementEstimator meas2ndBLayer
BarrelMeasurementEstimator meas1stBLayer
PropagatorWithMaterial * prop1stLayer
Geom::Phi< T > phi() const
std::vector< CLHEP::Hep3Vector > pred1Meas
ForwardLayerIterator neg1stFLayer()
FTSFromVertexToPointFactory myFTS
BarrelLayerIterator firstBLayer()
RealType normalized_phi(RealType phi)
const MagneticField * theMagField
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
ForwardLayerIterator pos1stFLayer()
GlobalVector momentum() const
GlobalPoint position() const
PixelMatchStartLayers startLayers
const GeometricSearchTracker * theGeometricSearchTracker
std::vector< CLHEP::Hep3Vector > pred2Meas
ForwardMeasurementEstimator meas2ndFLayer
PropagatorWithMaterial * prop2ndLayer
ForwardMeasurementEstimator meas1stFLayer
const LayerMeasurements * theLayerMeasurements
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.