Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimTracker_TrackAssociation_TrackingParticleIP
0002 #define SimTracker_TrackAssociation_TrackingParticleIP
0003 
0004 // This file is in this package only because ParametersDefinerForTP is
0005 
0006 #include <cmath>
0007 
0008 namespace TrackingParticleIP {
0009   // As in TrackBase::dxy(Point) and dz(Point)
0010   template <typename T_Vertex, typename T_Momentum, typename T_Point>
0011   inline auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point) {
0012     return -(vertex.x() - point.x()) * std::sin(momentum.phi()) + (vertex.y() - point.y()) * std::cos(momentum.phi());
0013   }
0014 
0015   template <typename T_Vertex, typename T_Momentum, typename T_Point>
0016   inline auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point) {
0017     return vertex.z() - point.z() -
0018            ((vertex.x() - point.x()) * momentum.x() + (vertex.y() - point.y()) * momentum.y()) * momentum.z() /
0019                momentum.perp2();
0020   }
0021 }  // namespace TrackingParticleIP
0022 
0023 #endif