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 
18 class TotemRPCluster {
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
TotemRPCluster::str_beg_
uint16_t str_beg_
Definition: TotemRPCluster.h:38
TotemRPCluster::setStripEnd
void setStripEnd(unsigned short str_end)
Definition: TotemRPCluster.h:31
TotemRPCluster::numberOfStrips
int numberOfStrips() const
Definition: TotemRPCluster.h:33
TotemRPCluster::centerStripPosition
double centerStripPosition() const
Definition: TotemRPCluster.h:35
TotemRPCluster::setStripBegin
void setStripBegin(unsigned short str_beg)
Definition: TotemRPCluster.h:28
TotemRPCluster::stripEnd
uint16_t stripEnd() const
Definition: TotemRPCluster.h:30
operator<
bool operator<(const TotemRPCluster &l, const TotemRPCluster &r)
Definition: TotemRPCluster.h:38
TotemRPCluster
Cluster of TOTEM RP strip hits.
Definition: TotemRPCluster.h:17
TotemRPCluster::TotemRPCluster
TotemRPCluster(unsigned short str_beg=0, unsigned short str_end=0)
Definition: TotemRPCluster.h:25
TotemRPCluster::str_end_
uint16_t str_end_
Definition: TotemRPCluster.h:39
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
alignCSCRings.r
r
Definition: alignCSCRings.py:93
TotemRPCluster::stripBegin
uint16_t stripBegin() const
Definition: TotemRPCluster.h:27