CMS 3D CMS Logo

CTPPSDiamondRecHit.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of CTPPS offline software.
4 * Authors:
5 * Laurent Forthomme (laurent.forthomme@cern.ch)
6 * Nicola Minafra (nicola.minafra@cern.ch)
7 *
8 ****************************************************************************/
9 
10 #ifndef DataFormats_CTPPSReco_CTPPSDiamondRecHit
11 #define DataFormats_CTPPSReco_CTPPSDiamondRecHit
12 
14 
17 {
18  public:
20  x_( 0. ), x_width_( 0. ), y_( 0. ), y_width_( 0. ), z_( 0. ), z_width_( 0. ),
21  t_( 0. ), tot_( 0. ), t_precision_( 0. ),
22  ts_index_( 0 ), hptdc_err_( 0 ), mh_( false )
23  {}
24  CTPPSDiamondRecHit( float x, float x_width, float y, float y_width, float z, float z_width, float t, float tot, float t_precision, int oot_idx, const HPTDCErrorFlags& hptdc_err, const bool mh ) :
25  x_( x ), x_width_( x_width ), y_( y ), y_width_( y_width ), z_( z ), z_width_( z_width ),
26  t_( t ), tot_( tot ), t_precision_( t_precision ),
27  ts_index_( oot_idx ), hptdc_err_( hptdc_err ), mh_( mh )
28  {}
29 
31 
32  inline void setX( const float& x ) { x_ = x; }
33  inline float getX() const { return x_; }
34 
35  inline void setY( const float& y ) { y_ = y; }
36  inline float getY() const { return y_; }
37 
38  inline void setZ( const float& z ) { z_ = z; }
39  inline float getZ() const { return z_; }
40 
41  inline void setXWidth( const float& xwidth ) { x_width_ = xwidth; }
42  inline float getXWidth() const { return x_width_; }
43 
44  inline void setYWidth( const float& ywidth ) { y_width_ = ywidth; }
45  inline float getYWidth() const { return y_width_; }
46 
47  inline void setZWidth( const float& zwidth ) { z_width_ = zwidth; }
48  inline float getZWidth() const { return z_width_; }
49 
50  inline void setT( const float& t ) { t_ = t; }
51  inline float getT() const { return t_; }
52 
53  inline void setToT( const float& tot ) { tot_ = tot; }
54  inline float getToT() const { return tot_; }
55 
56  inline void setTPrecision( const float& t_precision ) { t_precision_ = t_precision; }
57  inline float getTPrecision() const { return t_precision_; }
58 
59  inline void setOOTIndex( const int& i ) { ts_index_ = i; }
60  inline int getOOTIndex() const { return ts_index_; }
61 
62  inline void setMultipleHits( const bool mh ) { mh_ = mh; }
63  inline bool getMultipleHits() const { return mh_; }
64 
65  inline void setHPTDCErrorFlags( const HPTDCErrorFlags& err ) { hptdc_err_ = err; }
66  inline HPTDCErrorFlags getHPTDCErrorFlags() const { return hptdc_err_; }
67 
68  private:
69  float x_, x_width_;
70  float y_, y_width_;
71  float z_, z_width_;
72  float t_, tot_, t_precision_;
74  int ts_index_;
76  bool mh_;
77 };
78 
79 //----------------------------------------------------------------------------------------------------
80 
81 inline bool operator<( const CTPPSDiamondRecHit& l, const CTPPSDiamondRecHit& r )
82 {
83  // only sort by leading edge time
84  return ( l.getT() < r.getT() );
85 }
86 
87 #endif
88 
HPTDCErrorFlags getHPTDCErrorFlags() const
float getXWidth() const
Reconstructed hit in diamond detectors.
HPTDCErrorFlags hptdc_err_
void setYWidth(const float &ywidth)
int getOOTIndex() const
CTPPSDiamondRecHit(float x, float x_width, float y, float y_width, float z, float z_width, float t, float tot, float t_precision, int oot_idx, const HPTDCErrorFlags &hptdc_err, const bool mh)
float getYWidth() const
#define constexpr
void setZWidth(const float &zwidth)
void setX(const float &x)
float getZWidth() const
int ts_index_
Time slice index.
bool getMultipleHits() const
void setTPrecision(const float &t_precision)
void setToT(const float &tot)
static constexpr int TIMESLICE_WITHOUT_LEADING
void setY(const float &y)
void setZ(const float &z)
void setXWidth(const float &xwidth)
void setOOTIndex(const int &i)
float getToT() const
float getTPrecision() const
void setHPTDCErrorFlags(const HPTDCErrorFlags &err)
bool operator<(const CTPPSDiamondRecHit &l, const CTPPSDiamondRecHit &r)
void setMultipleHits(const bool mh)
void setT(const float &t)