CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoMuon/GlobalTrackingTools/interface/StateSegmentMatcher.h

Go to the documentation of this file.
00001 #ifndef RecoMuon_GlobalTrackingTools_StateSegmentMatcher_h
00002 #define RecoMuon_GlobalTrackingTools_StateSegmentMatcher_h
00003 
00018 #include "DataFormats/DTRecHit/interface/DTRecSegment4D.h"
00019 #include "RecoMuon/GlobalTrackingTools/interface/ChamberSegmentUtility.h"
00020 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00021 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00022 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00023 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00024 
00025 
00026 class Tsos4D {
00027  public:
00028 
00029   Tsos4D(TrajectoryStateOnSurface* );
00030 
00031   // Returns the 4d vector
00032   AlgebraicVector4 paramVector() const;
00033 
00034   // Returns the 4x4 covariance matrix
00035   AlgebraicSymMatrix44 errorMatrix() const;
00036 
00037  private:
00038   AlgebraicVector4 tsos_4d;
00039   AlgebraicSymMatrix44 tsosErr_44;
00040 
00041 };
00042 
00043 
00044 
00045 class Tsos2DPhi {
00046  public:
00047   // Constructor of the class
00048   Tsos2DPhi(TrajectoryStateOnSurface* );
00049 
00050   // Returns the 2d vector
00051   AlgebraicVector2 paramVector() const;
00052 
00053   // Returns the 2x2 covariance matrix
00054   AlgebraicSymMatrix22 errorMatrix() const;
00055 
00056  private:
00057   AlgebraicVector2 tsos_2d_phi;
00058   AlgebraicSymMatrix22 tsosErr_22_phi;
00059 };
00060 
00061 
00062 
00063 class Tsos2DZed {
00064  public:
00065 
00066   Tsos2DZed(TrajectoryStateOnSurface* );
00067 
00068   // Returns the 2d vector
00069   AlgebraicVector2 paramVector() const;
00070 
00071   // Returns the 2x2 covariance matrix
00072   AlgebraicSymMatrix22 errorMatrix() const;
00073 
00074  private:
00075   AlgebraicVector2 tsos_2d_zed;
00076   AlgebraicSymMatrix22 tsosErr_22_zed;
00077 };
00078 
00079 
00080 
00081 class StateSegmentMatcher {
00082 
00083  public:
00084   
00085   // Perform the matching between a track state and a CSC segment
00086   StateSegmentMatcher(TrajectoryStateOnSurface*, CSCSegment*, LocalError*);
00087 
00088   // Perform the matching between a track state and a DT segment
00089   StateSegmentMatcher(TrajectoryStateOnSurface*, DTRecSegment4D*, LocalError*);
00090 
00091   // Returns the estimator value 
00092   double value();
00093 
00094  private:
00095   
00096   AlgebraicVector4 v1, v2;
00097   AlgebraicSymMatrix44 m1, m2, ape;
00098   AlgebraicVector2 v1_2d, v2_2d;
00099   AlgebraicSymMatrix22 m1_2d, m2_2d, ape_2d;
00100   bool match2D;
00101   double estValue;
00102 
00103   void setAPE4d(LocalError &apeLoc) {
00104     ape[0][0] = 0; //sigma (dx/dz) 
00105     ape[1][1] = 0; //sigma (dy/dz)
00106     ape[2][2] = apeLoc.xx(); //sigma (x)  
00107     ape[3][3] = apeLoc.yy(); //sigma (y)
00108     ape[0][2] = 0; //cov(dx/dz,x) 
00109     ape[1][3] = 0; //cov(dy/dz,y)
00110   };
00111 
00112   void setAPE2d(LocalError &apeLoc) {
00113     ape_2d[0][0] = 0; //sigma (dx/dz)
00114     ape_2d[1][1] = apeLoc.xx(); //sigma (x)
00115     ape_2d[0][1] = 0; //cov(dx/dz,x) 
00116   };
00117 };
00118 
00119 
00120 #endif
00121 
00122