Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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