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 
13 #include <cstdint>
14 
19 {
20  public:
21  TotemRPCluster(unsigned short str_beg=0, unsigned short str_end=0) : str_beg_(str_beg), str_end_(str_end)
22  {
23  }
24 
25  inline uint16_t getStripBegin() const { return str_beg_; }
26  inline void setStripBegin(unsigned short str_beg) { str_beg_ = str_beg; }
27 
28  inline uint16_t getStripEnd() const { return str_end_; }
29  inline void setStripEnd(unsigned short str_end) { str_end_ = str_end; }
30 
31  inline int getNumberOfStrips() const { return str_end_ - str_beg_ + 1; }
32 
33  inline double getCenterStripPosition() const { return (str_beg_ + str_end_)/2.; }
34 
35  private:
36  uint16_t str_beg_;
37  uint16_t str_end_;
38 };
39 
40 //----------------------------------------------------------------------------------------------------
41 
42 inline bool operator<( const TotemRPCluster& l, const TotemRPCluster& r)
43 {
44  if (l.getStripBegin() < r.getStripBegin())
45  return true;
46  if (l.getStripBegin() > r.getStripBegin())
47  return false;
48 
49  if (l.getStripEnd() < r.getStripEnd())
50  return true;
51 
52  return false;
53 }
54 
55 #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)