Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEMRecHit_ME0Segment_h
0002 #define GEMRecHit_ME0Segment_h
0003 
0004 /** \class ME0Segment derived by the CSC segment
0005  *  Describes a reconstructed track segment in the 6 layers of the ME0 system.
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  *  $Date: 2014/02/04 12:41:32 $
0010  *  \author Marcello Maggi
0011  */
0012 
0013 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0014 #include "DataFormats/GEMRecHit/interface/ME0RecHitCollection.h"
0015 
0016 #include <iosfwd>
0017 
0018 class ME0DetId;
0019 
0020 class ME0Segment final : public RecSegment {
0021 public:
0022   /// Default constructor
0023   ME0Segment() : theChi2(0.), theTimeValue(0.), theTimeUncrt(0.), theDeltaPhi(0.) {}
0024 
0025   /// Constructor
0026   ME0Segment(const std::vector<const ME0RecHit*>& proto_segment,
0027              const LocalPoint& origin,
0028              const LocalVector& direction,
0029              const AlgebraicSymMatrix& errors,
0030              float chi2);
0031 
0032   ME0Segment(const std::vector<const ME0RecHit*>& proto_segment,
0033              const LocalPoint& origin,
0034              const LocalVector& direction,
0035              const AlgebraicSymMatrix& errors,
0036              float chi2,
0037              float time,
0038              float timeErr,
0039              float deltaPhi);
0040 
0041   /// Destructor
0042   ~ME0Segment() override;
0043 
0044   //--- Base class interface
0045   ME0Segment* clone() const override { return new ME0Segment(*this); }
0046 
0047   LocalPoint localPosition() const override { return theOrigin; }
0048   LocalError localPositionError() const override;
0049 
0050   LocalVector localDirection() const override { return theLocalDirection; }
0051   LocalError localDirectionError() const override;
0052 
0053   /// Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
0054   AlgebraicVector parameters() const override;
0055 
0056   /// Covariance matrix of parameters()
0057   AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
0058 
0059   /// The projection matrix relates the trajectory state parameters to the segment parameters().
0060   AlgebraicMatrix projectionMatrix() const override;
0061 
0062   std::vector<const TrackingRecHit*> recHits() const override;
0063 
0064   std::vector<TrackingRecHit*> recHits() override;
0065 
0066   double chi2() const override { return theChi2; };
0067 
0068   int dimension() const override { return 4; }
0069 
0070   int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
0071 
0072   //--- Extension of the interface
0073 
0074   const std::vector<ME0RecHit>& specificRecHits() const { return theME0RecHits; }
0075 
0076   int nRecHits() const { return theME0RecHits.size(); }
0077 
0078   ME0DetId me0DetId() const { return geographicalId(); }
0079 
0080   float time() const { return theTimeValue; }
0081   float timeErr() const { return theTimeUncrt; }
0082 
0083   float deltaPhi() const { return theDeltaPhi; }
0084 
0085   void print() const;
0086 
0087 private:
0088   std::vector<ME0RecHit> theME0RecHits;
0089   LocalPoint theOrigin;             // in chamber frame - the GeomDet local coordinate system
0090   LocalVector theLocalDirection;    // in chamber frame - the GeomDet local coordinate system
0091   AlgebraicSymMatrix theCovMatrix;  // the covariance matrix
0092   float theChi2;                    // the Chi squared of the segment fit
0093   float theTimeValue;               // the best time estimate of the segment
0094   float theTimeUncrt;               // the uncertainty on the time estimation
0095   float theDeltaPhi;                // Difference in segment phi position: outer layer - inner lay
0096 };
0097 
0098 std::ostream& operator<<(std::ostream& os, const ME0Segment& seg);
0099 
0100 #endif