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. ),
21  t_( 0. ), tot_( 0. ),
22  ts_index_( 0 ), hptdc_err_( 0 ), mh_( false )
23  {}
24  CTPPSDiamondRecHit( float x, float x_width, float y, float y_width, float t, float tot, int oot_idx, const HPTDCErrorFlags& hptdc_err, const bool mh ) :
25  x_( x ), x_width_( x_width ), y_( y ), y_width_( y_width ),
26  t_( t ), tot_( tot ),
27  ts_index_( oot_idx ), hptdc_err_( hptdc_err ), mh_( mh )
28  {}
29 
30  inline void setX( const float& x ) { x_ = x; }
31  inline float getX() const { return x_; }
32 
33  inline void setY( const float& y ) { y_ = y; }
34  inline float getY() const { return y_; }
35 
36  inline void setXWidth( const float& xwidth ) { x_width_ = xwidth; }
37  inline float getXWidth() const { return x_width_; }
38 
39  inline void setYWidth( const float& ywidth ) { y_width_ = ywidth; }
40  inline float getYWidth() const { return y_width_; }
41 
42  inline void setT( const float& t ) { t_ = t; }
43  inline float getT() const { return t_; }
44 
45  inline void setToT( const float& tot ) { tot_ = tot; }
46  inline float getToT() const { return tot_; }
47 
48  inline void setOOTIndex( const int& i ) { ts_index_ = i; }
49  inline int getOOTIndex() const { return ts_index_; }
50 
51  inline void setMultipleHits( const bool mh ) { mh_ = mh; }
52  inline bool getMultipleHits() const { return mh_; }
53 
54  inline void setHPTDCErrorFlags( const HPTDCErrorFlags& err ) { hptdc_err_ = err; }
55  inline HPTDCErrorFlags getHPTDCErrorFlags() const { return hptdc_err_; }
56 
57  private:
58  float x_, x_width_;
59  float y_, y_width_;
60  float t_, tot_;
62  int ts_index_;
64  bool mh_;
65 };
66 
67 //----------------------------------------------------------------------------------------------------
68 
69 inline bool operator<( const CTPPSDiamondRecHit& l, const CTPPSDiamondRecHit& r )
70 {
71  // only sort by leading edge time
72  return ( l.getT() < r.getT() );
73 }
74 
75 #endif
HPTDCErrorFlags getHPTDCErrorFlags() const
float getXWidth() const
Reconstructed hit in diamond detectors.
HPTDCErrorFlags hptdc_err_
void setYWidth(const float &ywidth)
int getOOTIndex() const
float getYWidth() const
CTPPSDiamondRecHit(float x, float x_width, float y, float y_width, float t, float tot, int oot_idx, const HPTDCErrorFlags &hptdc_err, const bool mh)
void setX(const float &x)
int ts_index_
Time slice index.
bool getMultipleHits() const
void setToT(const float &tot)
void setY(const float &y)
void setXWidth(const float &xwidth)
void setOOTIndex(const int &i)
float getToT() const
void setHPTDCErrorFlags(const HPTDCErrorFlags &err)
bool operator<(const CTPPSDiamondRecHit &l, const CTPPSDiamondRecHit &r)
void setMultipleHits(const bool mh)
void setT(const float &t)