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 public:
20  TotemRPCluster(unsigned short str_beg = 0, unsigned short str_end = 0) : str_beg_(str_beg), str_end_(str_end) {}
21 
22  inline uint16_t stripBegin() const { return str_beg_; }
23  inline void setStripBegin(unsigned short str_beg) { str_beg_ = str_beg; }
24 
25  inline uint16_t stripEnd() const { return str_end_; }
26  inline void setStripEnd(unsigned short str_end) { str_end_ = str_end; }
27 
28  inline int numberOfStrips() const { return str_end_ - str_beg_ + 1; }
29 
30  inline double centerStripPosition() const { return (str_beg_ + str_end_) / 2.; }
31 
32 private:
33  uint16_t str_beg_;
34  uint16_t str_end_;
35 };
36 
37 //----------------------------------------------------------------------------------------------------
38 
39 inline bool operator<(const TotemRPCluster& l, const TotemRPCluster& r) {
40  if (l.stripBegin() < r.stripBegin())
41  return true;
42  if (l.stripBegin() > r.stripBegin())
43  return false;
44 
45  if (l.stripEnd() < r.stripEnd())
46  return true;
47 
48  return false;
49 }
50 
51 #endif
Cluster of TOTEM RP strip hits.
void setStripBegin(unsigned short str_beg)
double centerStripPosition() const
uint16_t str_end_
uint16_t stripEnd() const
uint16_t str_beg_
void setStripEnd(unsigned short str_end)
uint16_t stripBegin() const
TotemRPCluster(unsigned short str_beg=0, unsigned short str_end=0)
int numberOfStrips() const
bool operator<(const TotemRPCluster &l, const TotemRPCluster &r)