CMS 3D CMS Logo

GEMCluster.cc
Go to the documentation of this file.
2 #include <iostream>
3 #include <fstream>
4 
5 using namespace std;
6 
7 GEMCluster::GEMCluster() : fstrip(0), lstrip(0), bunchx(0) {}
8 
9 GEMCluster::GEMCluster(int fs, int ls, int bx) : fstrip(fs), lstrip(ls), bunchx(bx) {}
10 
12 
13 int GEMCluster::firstStrip() const { return fstrip; }
14 
15 int GEMCluster::lastStrip() const { return lstrip; }
16 
17 int GEMCluster::clusterSize() const { return -(fstrip - lstrip) + 1; }
18 
19 int GEMCluster::bx() const { return bunchx; }
20 
21 bool GEMCluster::isAdjacent(const GEMCluster& cl) const {
22  return ((cl.firstStrip() == this->firstStrip() - 1) && (cl.bx() == this->bx()));
23 }
24 
26  if (this->isAdjacent(cl)) {
27  fstrip = cl.firstStrip();
28  }
29 }
30 
31 bool GEMCluster::operator<(const GEMCluster& cl) const {
32  if (cl.bx() == this->bx())
33  return cl.firstStrip() < this->firstStrip();
34  else
35  return cl.bx() < this->bx();
36 }
37 
38 bool GEMCluster::operator==(const GEMCluster& cl) const {
39  return ((this->clusterSize() == cl.clusterSize()) && (this->bx() == cl.bx()) &&
40  (this->firstStrip() == cl.firstStrip()));
41 }
int lastStrip() const
Definition: GEMCluster.cc:15
bool operator==(const GEMCluster &cl) const
Definition: GEMCluster.cc:38
int16_t bunchx
Definition: GEMCluster.h:25
int clusterSize() const
Definition: GEMCluster.cc:17
int bx() const
Definition: GEMCluster.cc:19
bool isAdjacent(const GEMCluster &cl) const
Definition: GEMCluster.cc:21
void merge(const GEMCluster &cl)
Definition: GEMCluster.cc:25
uint16_t lstrip
Definition: GEMCluster.h:24
int firstStrip() const
Definition: GEMCluster.cc:13
bool operator<(const GEMCluster &cl) const
Definition: GEMCluster.cc:31
uint16_t fstrip
Definition: GEMCluster.h:23