Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:32

0001 #include <cmath>
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "TrackingTools/KalmanUpdators/interface/EtaPhiMeasurementEstimator.h"
0004 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0005 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0006 
0007 #include "DataFormats/Math/interface/deltaPhi.h"
0008 
0009 std::pair<bool, double> EtaPhiMeasurementEstimator::estimate(const TrajectoryStateOnSurface& tsos,
0010                                                              const TrackingRecHit& aRecHit) const {
0011   // As the center of the plane is in the region, no need to waste time to test the hit as well
0012   return std::make_pair(true, 1.0);
0013 
0014   /* HERE AS THE SECOND LINE WAS BUGGY... (AND MAY BE NEEDED IF WE MODIFY THE ESTIMATE WRT PLANE TO ACCOUNT FOR DET SPAN
0015 
0016   auto dEta = std::abs(tsos.globalPosition().eta() - aRecHit.globalPosition().eta());
0017   auto dPhi = std::abs(deltaPhi(tsos.globalPosition().barePhi(), aRecHit.globalPosition().barePhi()));
0018 
0019   LogDebug("EtaPhiMeasurementEstimator")<< " The state to compare with is \n"<< tsos
0020                     << " The hit position is:\n" << aRecHit.globalPosition()
0021                     << " deta: "<< dEta<< " dPhi: "<<dPhi;
0022 
0023   if ( (dEta < thedEta) & (dPhi <thedPhi) )
0024     return std::make_pair(true, 1.0);
0025   else
0026     return std::make_pair(false, 0.0);
0027 
0028   */
0029 }
0030 
0031 bool EtaPhiMeasurementEstimator::estimate(const TrajectoryStateOnSurface& tsos, const Plane& plane) const {
0032   auto dEta = std::abs(tsos.globalPosition().eta() - plane.eta());
0033   auto dPhi = std::abs(deltaPhi(tsos.globalPosition().barePhi(), plane.phi()));
0034 
0035   LogDebug("EtaPhiMeasurementEstimator") << "The state to compare with is \n"
0036                                          << tsos << "\n"
0037                                          << "The plane position center is: " << plane.position() << "\n"
0038                                          << "the deta = " << thedEta << " --- the dPhi = " << thedPhi << "\n"
0039                                          << "deta = " << fabs(dEta) << " --- dPhi = " << fabs(dPhi);
0040 
0041   // does not take into account bounds... (not sure it was intentional)
0042   return (dEta < thedEta) & (dPhi < thedPhi);
0043 }
0044 
0045 MeasurementEstimator::Local2DVector EtaPhiMeasurementEstimator::maximalLocalDisplacement(
0046     const TrajectoryStateOnSurface& tsos, const Plane& plane) const {
0047   return Local2DVector(30., 30.);
0048 }