Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTRecHit_DTRecHit1D_H
0002 #define DTRecHit_DTRecHit1D_H
0003 
0004 /** \class DTRecHit1D
0005  *
0006  *  1D RecHit for Muon Barrel DT 
0007  *  The main feature of muon Barrel RecHits is that they are created in pair,
0008  *  due to left/right ambiguity (the pair is described by \class
0009  *  DTRecHit1DPair). The coordiante measured is always the x (in Det frame)
0010  *
0011  *
0012  *  \author S. Lacaprara, G. Cerminara
0013  */
0014 
0015 //#include "DataFormats/GeometrySurface/interface/LocalError.h"
0016 
0017 #include "DataFormats/TrackingRecHit/interface/RecHit1D.h"
0018 
0019 #include "DataFormats/DTRecHit/interface/DTEnums.h"
0020 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0021 
0022 class DTLayer;
0023 class GeomDet;
0024 
0025 class DTRecHit1D : public RecHit1D {
0026 public:
0027   /// Constructor from wireId and digi time only.
0028   DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime);
0029 
0030   /// Default constructor
0031   DTRecHit1D();
0032 
0033   /// Constructor from a local position, wireId and digi time.
0034   /// The 3-dimensional local error is defined as
0035   /// resolution (the cell resolution) for the coordinate being measured
0036   /// and 0 for the two other coordinates
0037   DTRecHit1D(const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos);
0038 
0039   /// Constructor from a local position and error, wireId and digi time.
0040   DTRecHit1D(
0041       const DTWireId& wireId, DTEnums::DTCellSide lr, float digiTime, const LocalPoint& pos, const LocalError& err);
0042 
0043   /// Destructor
0044   ~DTRecHit1D() override;
0045 
0046   /// Return the 3-dimensional local position
0047   LocalPoint localPosition() const override { return theLocalPosition; }
0048 
0049   /// Return the 3-dimensional error on the local position
0050   LocalError localPositionError() const override { return theLocalError; }
0051 
0052   DTRecHit1D* clone() const override;
0053 
0054   /// No components rechits: it returns a null vector
0055   std::vector<const TrackingRecHit*> recHits() const override;
0056 
0057   /// No components rechits: it returns a null vector
0058   std::vector<TrackingRecHit*> recHits() override;
0059 
0060   /// The side of the cell
0061   DTEnums::DTCellSide lrSide() const { return theLRSide; }
0062 
0063   /// Set local position
0064   void setPosition(LocalPoint pos) { theLocalPosition = pos; }
0065 
0066   /// Set local position error
0067   void setError(LocalError err) { theLocalError = err; }
0068 
0069   /// Set the local position and its error
0070   void setPositionAndError(LocalPoint pos, LocalError err) {
0071     theLocalPosition = pos;
0072     theLocalError = err;
0073   }
0074 
0075   /// Return the wireId
0076   DTWireId wireId() const { return theWireId; }
0077 
0078   /// Return the time (ns) of the digi used to build the rechit
0079   float digiTime() const { return theDigiTime; }
0080 
0081   /// Comparison operator, based on the wireId and the digi time
0082   bool operator==(const DTRecHit1D& hit) const;
0083 
0084 private:
0085   // The wire id
0086   DTWireId theWireId;
0087 
0088   // Left/Right side code
0089   DTEnums::DTCellSide theLRSide;
0090 
0091   // The digi time used to reconstruct the hit
0092   float theDigiTime;
0093 
0094   // Position and error in the Local Ref. Frame of the DTLayer
0095   LocalPoint theLocalPosition;
0096   LocalError theLocalError;
0097 };
0098 #endif
0099 
0100 /// The ostream operator
0101 std::ostream& operator<<(std::ostream& os, const DTRecHit1D& hit);