CMS 3D CMS Logo

TotemRPCluster.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Hubert Niewiadomski
6 * Jan Kašpar (jan.kaspar@gmail.com)
7 *
8 ****************************************************************************/
9 
10 #ifndef DataFormats_CTPPSReco_TotemRPCluster
11 #define DataFormats_CTPPSReco_TotemRPCluster
12 
17 {
18  public:
19  TotemRPCluster(unsigned short str_beg=0, unsigned short str_end=0) : str_beg_(str_beg), str_end_(str_end)
20  {
21  }
22 
23  inline uint16_t getStripBegin() const { return str_beg_; }
24  inline void setStripBegin(unsigned short str_beg) { str_beg_ = str_beg; }
25 
26  inline uint16_t getStripEnd() const { return str_end_; }
27  inline void setStripEnd(unsigned short str_end) { str_end_ = str_end; }
28 
29  inline int getNumberOfStrips() const { return str_end_ - str_beg_ + 1; }
30 
31  inline double getCenterStripPosition() const { return (str_beg_ + str_end_)/2.; }
32 
33  private:
34  uint16_t str_beg_;
35  uint16_t str_end_;
36 };
37 
38 //----------------------------------------------------------------------------------------------------
39 
40 inline bool operator<( const TotemRPCluster& l, const TotemRPCluster& r)
41 {
42  if (l.getStripBegin() < r.getStripBegin())
43  return true;
44  if (l.getStripBegin() > r.getStripBegin())
45  return false;
46 
47  if (l.getStripEnd() < r.getStripEnd())
48  return true;
49 
50  return false;
51 }
52 
53 #endif
int getNumberOfStrips() const
double getCenterStripPosition() const
uint16_t getStripBegin() const
Cluster of TOTEM RP strip hits.
void setStripBegin(unsigned short str_beg)
uint16_t getStripEnd() const
uint16_t str_end_
uint16_t str_beg_
void setStripEnd(unsigned short str_end)
TotemRPCluster(unsigned short str_beg=0, unsigned short str_end=0)
bool operator<(const TotemRPCluster &l, const TotemRPCluster &r)