Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTSLRECCLUSTER_H
0002 #define DTSLRECCLUSTER_H
0003 
0004 /** \class DTSLRecCluster
0005  *
0006  * Description:
0007  *  
0008  *  detailed description
0009  *
0010  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0011  *
0012  * Modification:
0013  *
0014  */
0015 
0016 /* Base Class Headers */
0017 #include "DataFormats/TrackingRecHit/interface/RecHit1D.h"
0018 
0019 /* Collaborating Class Declarations */
0020 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0021 #include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
0022 
0023 /* C++ Headers */
0024 #include <iosfwd>
0025 
0026 /* ====================================================================== */
0027 
0028 /* Class DTSLRecCluster Interface */
0029 
0030 class DTSLRecCluster : public RecHit1D {
0031 public:
0032   /* Constructor */
0033   DTSLRecCluster() {}
0034 
0035   /// c'tor from hits
0036   DTSLRecCluster(const DTSuperLayerId id, const std::vector<DTRecHit1DPair>& pair);
0037 
0038   /// complete constructor
0039   DTSLRecCluster(const DTSuperLayerId id, const LocalPoint&, const LocalError&, const std::vector<DTRecHit1DPair>& pair);
0040 
0041   /* Destructor */
0042   ~DTSLRecCluster() override {}
0043 
0044   /* Operations */
0045   /// The clone method needed by the clone policy
0046   DTSLRecCluster* clone() const override { return new DTSLRecCluster(*this); }
0047 
0048   /// The id of the superlayer on which reside the segment
0049   DTSuperLayerId superLayerId() const { return theSlid; }
0050 
0051   /// the vector of parameters (dx/dz,x)
0052   AlgebraicVector parameters() const override { return param(localPosition()); }
0053 
0054   // The parameter error matrix
0055   AlgebraicSymMatrix parametersError() const override { return parError(localPositionError()); }
0056 
0057   /** return the projection matrix, which must project a parameter vector,
0058      * whose components are (q/p, dx/dz, dy/dz, x, y), into the vector returned
0059      * by parameters() */
0060   AlgebraicMatrix projectionMatrix() const override { return theProjectionMatrix; }
0061 
0062   /// return 2. The dimension of the matrix
0063   int dimension() const override { return 2; }
0064   LocalPoint localPosition() const override { return thePos; }
0065   LocalError localPositionError() const override { return thePosError; }
0066 
0067   /// return the hits
0068   std::vector<const TrackingRecHit*> recHits() const override;
0069 
0070   std::vector<TrackingRecHit*> recHits() override;
0071 
0072   /// Access to specific components
0073   std::vector<DTRecHit1DPair> specificRecHits() const { return thePairs; }
0074 
0075   int nHits() const { return thePairs.size(); }
0076 
0077 private:
0078   DTSuperLayerId theSlid;
0079 
0080   LocalPoint thePos;
0081   LocalError thePosError;
0082 
0083   std::vector<DTRecHit1DPair> thePairs;
0084 
0085 private:
0086   static const AlgebraicMatrix theProjectionMatrix;
0087 
0088   AlgebraicVector param(const LocalPoint& lp) const {
0089     AlgebraicVector result(1);
0090     result[1] = lp.x();
0091     return result;
0092   }
0093 
0094   AlgebraicSymMatrix parError(const LocalError& le) const {
0095     AlgebraicSymMatrix m(1);
0096     m[0][0] = le.xx();
0097     return m;
0098   }
0099 
0100 protected:
0101 };
0102 std::ostream& operator<<(std::ostream& os, const DTSLRecCluster& seg);
0103 #endif  // DTSLRECCLUSTER_H