Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:29

0001 #ifndef GEMRecHit_GEMSegment_h
0002 #define GEMRecHit_GEMSegment_h
0003 
0004 /** \class GEMSegment derived by the CSC segment
0005  *  Describes a reconstructed track segment in the 2+ layers of a GEM chamber.
0006  *  This is 4-dimensional since it has an origin (x,y) and a direction (x,y)
0007  *  in the local coordinate system of the chamber.
0008  *
0009  *  \author Piet Verwilligen
0010  */
0011 
0012 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0013 #include "DataFormats/GEMRecHit/interface/GEMRecHitCollection.h"
0014 
0015 #include <iosfwd>
0016 
0017 class GEMDetId;
0018 
0019 class GEMSegment final : public RecSegment {
0020 public:
0021   /// Default constructor
0022   GEMSegment() : theChi2(0.) {}
0023 
0024   /// Constructor
0025   GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0026              const LocalPoint& origin,
0027              const LocalVector& direction,
0028              const AlgebraicSymMatrix& errors,
0029              double chi2);
0030 
0031   GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0032              const LocalPoint& origin,
0033              const LocalVector& direction,
0034              const AlgebraicSymMatrix& errors,
0035              double chi2,
0036              float bx);
0037 
0038   GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0039              const LocalPoint& origin,
0040              const LocalVector& direction,
0041              const AlgebraicSymMatrix& errors,
0042              double chi2,
0043              float bx,
0044              float deltaPhi);
0045 
0046   /// Destructor
0047   ~GEMSegment() override;
0048 
0049   //--- Base class interface
0050   GEMSegment* clone() const override { return new GEMSegment(*this); }
0051 
0052   LocalPoint localPosition() const override { return theOrigin; }
0053   LocalError localPositionError() const override;
0054 
0055   LocalVector localDirection() const override { return theLocalDirection; }
0056   LocalError localDirectionError() const override;
0057 
0058   /// Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
0059   AlgebraicVector parameters() const override;
0060 
0061   /// Covariance matrix of parameters()
0062   AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
0063 
0064   /// The projection matrix relates the trajectory state parameters to the segment parameters().
0065   AlgebraicMatrix projectionMatrix() const override;
0066 
0067   std::vector<const TrackingRecHit*> recHits() const override;
0068 
0069   std::vector<TrackingRecHit*> recHits() override;
0070 
0071   double chi2() const override { return theChi2; };
0072 
0073   int dimension() const override { return 4; }
0074 
0075   int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
0076 
0077   //--- Extension of the interface
0078 
0079   const std::vector<GEMRecHit>& specificRecHits() const { return theGEMRecHits; }
0080 
0081   int nRecHits() const { return theGEMRecHits.size(); }
0082 
0083   GEMDetId gemDetId() const { return geographicalId(); }
0084 
0085   float bunchX() const { return theBX; }
0086 
0087   float deltaPhi() const { return theDeltaPhi; }
0088 
0089   void print() const;
0090 
0091 private:
0092   std::vector<GEMRecHit> theGEMRecHits;
0093   LocalPoint theOrigin;             // in chamber frame - the GeomDet local coordinate system
0094   LocalVector theLocalDirection;    // in chamber frame - the GeomDet local coordinate system
0095   AlgebraicSymMatrix theCovMatrix;  // the covariance matrix
0096   double theChi2;                   // the Chi squared of the segment fit
0097   float theBX;                      // the bunch crossing
0098   float theDeltaPhi;                // Difference in segment phi position: outer layer - inner lay
0099 };
0100 
0101 std::ostream& operator<<(std::ostream& os, const GEMSegment& seg);
0102 
0103 #endif