Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /****************************************************************************
0002  *
0003  * This is a part of CTPPS offline software.
0004  * Authors:
0005  *   Laurent Forthomme (laurent.forthomme@cern.ch)
0006  *   Nicola Minafra (nicola.minafra@cern.ch)
0007  *
0008  ****************************************************************************/
0009 
0010 #ifndef DataFormats_CTPPSReco_CTPPSTimingRecHit
0011 #define DataFormats_CTPPSReco_CTPPSTimingRecHit
0012 
0013 /// Reconstructed hit in timing detectors.
0014 class CTPPSTimingRecHit {
0015 public:
0016   CTPPSTimingRecHit() : x_(0.), xWidth_(0.), y_(0.), yWidth_(0.), z_(0.), zWidth_(0.), t_(0.) {}
0017   CTPPSTimingRecHit(float x, float xWidth, float y, float yWidth, float z, float zWidth, float t)
0018       : x_(x), xWidth_(xWidth), y_(y), yWidth_(yWidth), z_(z), zWidth_(zWidth), t_(t) {}
0019 
0020   inline void setX(float x) { x_ = x; }
0021   inline float x() const { return x_; }
0022 
0023   inline void setY(float y) { y_ = y; }
0024   inline float y() const { return y_; }
0025 
0026   inline void setZ(float z) { z_ = z; }
0027   inline float z() const { return z_; }
0028 
0029   inline void setXWidth(float xWidth) { xWidth_ = xWidth; }
0030   inline float xWidth() const { return xWidth_; }
0031 
0032   inline void setYWidth(float yWidth) { yWidth_ = yWidth; }
0033   inline float yWidth() const { return yWidth_; }
0034 
0035   inline void setZWidth(float zWidth) { zWidth_ = zWidth; }
0036   inline float zWidth() const { return zWidth_; }
0037 
0038   inline void setTime(float t) { t_ = t; }
0039   inline float time() const { return t_; }
0040 
0041 protected:
0042   float x_, xWidth_;
0043   float y_, yWidth_;
0044   float z_, zWidth_;
0045   float t_;
0046 };
0047 
0048 //----------------------------------------------------------------------------------------------------
0049 
0050 inline bool operator<(const CTPPSTimingRecHit &l, const CTPPSTimingRecHit &r) {
0051   // only sort by leading edge time
0052   return (l.time() < r.time());
0053 }
0054 
0055 #endif