Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PathToPlane2Order_H
0002 #define PathToPlane2Order_H
0003 
0004 #include "FWCore/Utilities/interface/Visibility.h"
0005 #include "DataFormats/GeometryVector/interface/Basic3DVector.h"
0006 #include "TrackingTools/GeomPropagators/interface/HelixPlaneCrossing.h"
0007 #include "CartesianState.h"
0008 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0009 #include "DataFormats/GeometrySurface/interface/Plane.h"
0010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0011 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0012 
0013 /** Computes the path length to reach a plane in general magnetic field.
0014  *  The problem (starting state and plane) is transformed to a frame where the
0015  *  starting field is along Z, and the AnalyticalHelixPlaneCrossing is used
0016  *  to compute the path length.
0017  */
0018 
0019 class RKLocalFieldProvider;
0020 
0021 class dso_internal PathToPlane2Order {
0022 public:
0023   typedef Plane::Scalar Scalar;
0024   typedef Basic3DVector<Scalar> Vector3D;
0025   typedef GloballyPositioned<Scalar> Frame;
0026 
0027   PathToPlane2Order(const RKLocalFieldProvider& fld, const Frame* fieldFrame)
0028       : theField(fld), theFieldFrame(fieldFrame) {}
0029 
0030   /// the position and momentum are local in the FieldFrame;
0031   /// the plane is in the global frame
0032   std::pair<bool, double> operator()(const Plane& plane,
0033                                      const Vector3D& position,
0034                                      const Vector3D& momentum,
0035                                      double charge,
0036                                      const PropagationDirection propDir = alongMomentum);
0037 
0038   std::pair<bool, double> operator()(const Plane& plane,
0039                                      const GlobalPoint& position,
0040                                      const GlobalVector& momentum,
0041                                      double charge,
0042                                      const PropagationDirection propDir = alongMomentum) {
0043     return operator()(plane,
0044                       theFieldFrame->toLocal(position).basicVector(),
0045                       theFieldFrame->toLocal(momentum).basicVector(),
0046                       charge,
0047                       propDir);
0048   }
0049 
0050 private:
0051   const RKLocalFieldProvider& theField;
0052   const Frame* theFieldFrame;
0053 };
0054 
0055 #endif