CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
int16_t bunchx
Definition: GEMCluster.h:25
def ls
Definition: eostools.py:349
tuple cl
Definition: haddnano.py:49
void merge(const GEMCluster &cl)
Definition: GEMCluster.cc:25
bool operator<(const GEMCluster &cl) const
Definition: GEMCluster.cc:31
uint16_t lstrip
Definition: GEMCluster.h:24
int lastStrip() const
Definition: GEMCluster.cc:15
int bx() const
Definition: GEMCluster.cc:19
int firstStrip() const
Definition: GEMCluster.cc:13
uint16_t fstrip
Definition: GEMCluster.h:23
int clusterSize() const
Definition: GEMCluster.cc:17
bool isAdjacent(const GEMCluster &cl) const
Definition: GEMCluster.cc:21
bool operator==(const GEMCluster &cl) const
Definition: GEMCluster.cc:38