Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:51:31

0001 #ifndef DataFormats_TrackerRecHit2D_VectorHit2D_h
0002 #define DataFormats_TrackerRecHit2D_VectorHit2D_h
0003 
0004 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0007 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0008 
0009 //Stores geometric information about VectorHits, their convariance matrix and chi2 of the compatability of the two hits
0010 
0011 class VectorHit2D {
0012 public:
0013   VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2() {}
0014   VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& chi2)
0015       : thePosition(pos),
0016         theDirection(dir),
0017         theCovMatrix(covMatrix),
0018         theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]),
0019         theChi2(chi2) {}
0020 
0021   const LocalPoint& localPosition() const { return thePosition; }
0022   const LocalVector& localDirection() const { return theDirection; }
0023   const LocalError& localDirectionError() const { return theLocalError; }
0024   const AlgebraicSymMatrix22& covMatrix() const { return theCovMatrix; }
0025   float chi2() const { return theChi2; }
0026   int dimension() const { return theDimension; }
0027 
0028 private:
0029   LocalPoint thePosition;
0030   LocalVector theDirection;
0031   AlgebraicSymMatrix22 theCovMatrix;
0032   LocalError theLocalError;
0033   float theChi2;
0034   static constexpr int theDimension = 2;
0035 };
0036 #endif