Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_RPCRecHit_H
0002 #define DataFormats_RPCRecHit_H
0003 
0004 /** \class RPCRecHit
0005  *
0006  *  RecHit for RPC 
0007  *
0008  *  \author M. Maggi -- INFN Bari 
0009  */
0010 
0011 #include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h"
0012 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0013 
0014 class RPCRecHit : public RecHit2DLocalPos {
0015 public:
0016   RPCRecHit(const RPCDetId& rpcId, int bx);
0017 
0018   /// Default constructor
0019   RPCRecHit();
0020 
0021   /// Constructor from a local position, rpcId 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   RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos);
0026 
0027   /// Constructor from a local position and error, rpcId and bx.
0028   RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err);
0029 
0030   /// Constructor from a local position and error, rpcId, bx, frist strip of cluster and cluster size.
0031   RPCRecHit(const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err);
0032 
0033   /// Destructor
0034   ~RPCRecHit() 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   RPCRecHit* 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   /// Set the time and its error
0065   void setTimeAndError(float time, float err) {
0066     theTime = time;
0067     theTimeError = err;
0068   }
0069 
0070   /// Return the rpcId
0071   RPCDetId rpcId() const { return theRPCId; }
0072 
0073   int BunchX() const { return theBx; }
0074 
0075   int firstClusterStrip() const { return theFirstStrip; }
0076 
0077   int clusterSize() const { return theClusterSize; }
0078 
0079   float time() const { return theTime; }
0080 
0081   float timeError() const { return theTimeError; }
0082 
0083   /// Comparison operator, based on the rpcId and the digi time
0084   bool operator==(const RPCRecHit& hit) const;
0085 
0086 private:
0087   RPCDetId theRPCId;
0088   int theBx;
0089   int theFirstStrip;
0090   int theClusterSize;
0091   // Position and error in the Local Ref. Frame of the RPCLayer
0092   LocalPoint theLocalPosition;
0093   LocalError theLocalError;
0094   float theTime, theTimeError;
0095 };
0096 #endif
0097 
0098 /// The ostream operator
0099 std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit);