Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:12

0001 #ifndef DataFormats_GEMRecHit_H
0002 #define DataFormats_GEMRecHit_H
0003 
0004 /** \class GEMRecHit
0005  *
0006  *  RecHit for GEM 
0007  *
0008  *  \author M. Maggi -- INFN Bari 
0009  */
0010 
0011 #include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h"
0012 #include "DataFormats/MuonDetId/interface/GEMDetId.h"
0013 
0014 class GEMRecHit : public RecHit2DLocalPos {
0015 public:
0016   GEMRecHit(const GEMDetId& gemId, int bx);
0017 
0018   /// Default constructor
0019   GEMRecHit();
0020 
0021   /// Constructor from a local position, gemId and digi time.
0022   /// The 3-dimensional local error is defined as
0023   /// resolution (the cell resolution) for the coordinate being measured
0024   /// and 0 for the two other coordinates
0025   GEMRecHit(const GEMDetId& gemId, int bx, const LocalPoint& pos);
0026 
0027   /// Constructor from a local position and error, gemId and bx.
0028   GEMRecHit(const GEMDetId& gemId, int bx, const LocalPoint& pos, const LocalError& err);
0029 
0030   /// Constructor from a local position and error, gemId, bx, frist strip of cluster and cluster size.
0031   GEMRecHit(const GEMDetId& gemId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err);
0032 
0033   /// Destructor
0034   ~GEMRecHit() override;
0035 
0036   /// Return the 3-dimensional local position
0037   LocalPoint localPosition() const override { return theLocalPosition; }
0038 
0039   /// Return the 3-dimensional error on the local position
0040   LocalError localPositionError() const override { return theLocalError; }
0041 
0042   GEMRecHit* clone() const override;
0043 
0044   /// Access to component RecHits.
0045   /// No components rechits: it returns a null vector
0046   std::vector<const TrackingRecHit*> recHits() const override;
0047 
0048   /// Non-const access to component RecHits.
0049   /// No components rechits: it returns a null vector
0050   std::vector<TrackingRecHit*> recHits() override;
0051 
0052   /// Set local position
0053   void setPosition(LocalPoint pos) { theLocalPosition = pos; }
0054 
0055   /// Set local position error
0056   void setError(LocalError err) { theLocalError = err; }
0057 
0058   /// Set the local position and its error
0059   void setPositionAndError(LocalPoint pos, LocalError err) {
0060     theLocalPosition = pos;
0061     theLocalError = err;
0062   }
0063 
0064   /// Return the gemId
0065   GEMDetId gemId() const { return theGEMId; }
0066 
0067   int BunchX() const { return theBx; }
0068 
0069   int firstClusterStrip() const { return theFirstStrip; }
0070 
0071   int clusterSize() const { return theClusterSize; }
0072 
0073   /// Comparison operator, based on the gemId and the digi time
0074   bool operator==(const GEMRecHit& hit) const;
0075 
0076 private:
0077   GEMDetId theGEMId;
0078   int theBx;
0079   int theFirstStrip;
0080   int theClusterSize;
0081   // Position and error in the Local Ref. Frame of the GEMLayer
0082   LocalPoint theLocalPosition;
0083   LocalError theLocalError;
0084 };
0085 #endif
0086 
0087 /// The ostream operator
0088 std::ostream& operator<<(std::ostream& os, const GEMRecHit& hit);