Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-14 02:34:12

0001 #ifndef PixelRecoUtilities_H
0002 #define PixelRecoUtilities_H
0003 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0004 #include "MagneticField/Engine/interface/MagneticField.h"
0005 
0006 /** \namespace PixelRecoUtilities
0007  *  Small utility funcions used during seed generation 
0008  */
0009 
0010 namespace PixelRecoUtilities {
0011   /** gives bending radius in magnetic field, 
0012    *  pT in GeV, magnetic field taken at (0,0,0) 
0013    */
0014   template <typename T>
0015   T bendingRadius(T pt, const MagneticField& field) {
0016     return pt * field.inverseBzAtOriginInGeV();
0017   }
0018 
0019   /** gives transverse curvature (=1/radius of curvature) in magnetic field, 
0020    *  pT in GeV, magnetic field taken at (0,0,0) 
0021    */
0022   template <typename T>
0023   T curvature(T InversePt, const MagneticField& field) {
0024     return InversePt / field.inverseBzAtOriginInGeV();
0025   }
0026 
0027   /** inverse pt from curvature **/
0028   template <typename T>
0029   T inversePt(T curvature, const MagneticField& field) {
0030     return curvature * field.inverseBzAtOriginInGeV();
0031   }
0032 
0033   /** distance between stright line propagation and helix
0034    *  r_stright_line = radius+longitudinalBendingCorrection(radius,pt)
0035    */
0036   inline double longitudinalBendingCorrection(double radius, double pt, const MagneticField& field) {
0037     double invCurv = bendingRadius(pt, field);
0038     if (invCurv == 0.)
0039       return 0.;
0040     return radius / 6. * radius * radius / (2. * invCurv * 2. * invCurv);
0041   }
0042 
0043 }  // namespace PixelRecoUtilities
0044 
0045 #endif