CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RPCCluster Class Reference

#include <RPCCluster.h>

Public Member Functions

void addTime (const float time)
 
void addY (const float y)
 
int bx () const
 
int clusterSize () const
 
int firstStrip () const
 
bool hasTime () const
 
bool hasY () const
 
bool isAdjacent (const RPCCluster &cl) const
 
int lastStrip () const
 
void merge (const RPCCluster &cl)
 
bool operator< (const RPCCluster &cl) const
 
bool operator== (const RPCCluster &cl) const
 
 RPCCluster ()
 
 RPCCluster (int fs, int ls, int bx)
 
float time () const
 
float timeRMS () const
 
float y () const
 
float yRMS () const
 
 ~RPCCluster ()
 

Private Attributes

int16_t bunchx
 
uint16_t fstrip
 
uint16_t lstrip
 
uint16_t nTime
 
uint16_t nY
 
float sumTime
 
float sumTime2
 
float sumY
 
float sumY2
 

Detailed Description

Definition at line 4 of file RPCCluster.h.

Constructor & Destructor Documentation

◆ RPCCluster() [1/2]

RPCCluster::RPCCluster ( )

Definition at line 8 of file RPCCluster.cc.

9  : fstrip(0), lstrip(0), bunchx(0), sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0) {}
uint16_t nY
Definition: RPCCluster.h:40
uint16_t nTime
Definition: RPCCluster.h:37
int16_t bunchx
Definition: RPCCluster.h:34
float sumTime2
Definition: RPCCluster.h:36
uint16_t lstrip
Definition: RPCCluster.h:33
float sumY2
Definition: RPCCluster.h:39
float sumTime
Definition: RPCCluster.h:36
float sumY
Definition: RPCCluster.h:39
uint16_t fstrip
Definition: RPCCluster.h:32

◆ RPCCluster() [2/2]

RPCCluster::RPCCluster ( int  fs,
int  ls,
int  bx 
)

Definition at line 11 of file RPCCluster.cc.

12  : fstrip(fs), lstrip(ls), bunchx(bx), sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0) {}
uint16_t nY
Definition: RPCCluster.h:40
uint16_t nTime
Definition: RPCCluster.h:37
int16_t bunchx
Definition: RPCCluster.h:34
float sumTime2
Definition: RPCCluster.h:36
uint16_t lstrip
Definition: RPCCluster.h:33
float sumY2
Definition: RPCCluster.h:39
float sumTime
Definition: RPCCluster.h:36
def ls(path, rec=False)
Definition: eostools.py:349
int bx() const
Definition: RPCCluster.cc:19
float sumY
Definition: RPCCluster.h:39
uint16_t fstrip
Definition: RPCCluster.h:32

◆ ~RPCCluster()

RPCCluster::~RPCCluster ( )

Definition at line 14 of file RPCCluster.cc.

14 {}

Member Function Documentation

◆ addTime()

void RPCCluster::addTime ( const float  time)

Definition at line 35 of file RPCCluster.cc.

References nTime, sumTime, sumTime2, and time().

35  {
36  ++nTime;
37  sumTime += time;
38  sumTime2 += time * time;
39 }
uint16_t nTime
Definition: RPCCluster.h:37
float sumTime2
Definition: RPCCluster.h:36
float sumTime
Definition: RPCCluster.h:36
float time() const
Definition: RPCCluster.cc:22

◆ addY()

void RPCCluster::addY ( const float  y)

Definition at line 41 of file RPCCluster.cc.

References nY, sumY, sumY2, and y().

41  {
42  ++nY;
43  sumY += y;
44  sumY2 += y * y;
45 }
uint16_t nY
Definition: RPCCluster.h:40
float sumY2
Definition: RPCCluster.h:39
float y() const
Definition: RPCCluster.cc:28
float sumY
Definition: RPCCluster.h:39

◆ bx()

int RPCCluster::bx ( ) const

Definition at line 19 of file RPCCluster.cc.

References bunchx.

Referenced by RPCMaskReClusterizer::doAction(), isAdjacent(), operator<(), and operator==().

19 { return bunchx; }
int16_t bunchx
Definition: RPCCluster.h:34

◆ clusterSize()

int RPCCluster::clusterSize ( ) const

Definition at line 18 of file RPCCluster.cc.

References fstrip, and lstrip.

Referenced by operator==().

18 { return lstrip - fstrip + 1; }
uint16_t lstrip
Definition: RPCCluster.h:33
uint16_t fstrip
Definition: RPCCluster.h:32

◆ firstStrip()

int RPCCluster::firstStrip ( ) const

Definition at line 16 of file RPCCluster.cc.

References fstrip.

Referenced by RPCRecHitStandardAlgo::compute(), RPCMaskReClusterizer::doAction(), isAdjacent(), operator<(), and operator==().

16 { return fstrip; }
uint16_t fstrip
Definition: RPCCluster.h:32

◆ hasTime()

bool RPCCluster::hasTime ( ) const

Definition at line 21 of file RPCCluster.cc.

References nTime.

Referenced by RPCRecHitStandardAlgo::compute(), time(), and timeRMS().

21 { return nTime > 0; }
uint16_t nTime
Definition: RPCCluster.h:37

◆ hasY()

bool RPCCluster::hasY ( ) const

Definition at line 27 of file RPCCluster.cc.

References nY.

Referenced by RPCRecHitStandardAlgo::compute(), y(), and yRMS().

27 { return nY > 0; }
uint16_t nY
Definition: RPCCluster.h:40

◆ isAdjacent()

bool RPCCluster::isAdjacent ( const RPCCluster cl) const

Definition at line 31 of file RPCCluster.cc.

References bx(), haddnano::cl, and firstStrip().

Referenced by RPCClusterizer::doAction(), and merge().

31  {
32  return ((cl.firstStrip() == this->firstStrip() - 1) && (cl.bx() == this->bx()));
33 }
int firstStrip() const
Definition: RPCCluster.cc:16
int bx() const
Definition: RPCCluster.cc:19

◆ lastStrip()

int RPCCluster::lastStrip ( ) const

Definition at line 17 of file RPCCluster.cc.

References lstrip.

Referenced by RPCRecHitStandardAlgo::compute(), and RPCMaskReClusterizer::doAction().

17 { return lstrip; }
uint16_t lstrip
Definition: RPCCluster.h:33

◆ merge()

void RPCCluster::merge ( const RPCCluster cl)

Definition at line 47 of file RPCCluster.cc.

References haddnano::cl, fstrip, isAdjacent(), nTime, nY, sumTime, sumTime2, sumY, and sumY2.

Referenced by RPCClusterizer::doAction().

47  {
48  if (!this->isAdjacent(cl))
49  return;
50 
51  fstrip = cl.firstStrip();
52 
53  nTime += cl.nTime;
54  sumTime += cl.sumTime;
55  sumTime2 += cl.sumTime2;
56 
57  nY += cl.nY;
58  sumY += cl.sumY;
59  sumY2 += cl.sumY2;
60 }
uint16_t nY
Definition: RPCCluster.h:40
uint16_t nTime
Definition: RPCCluster.h:37
float sumTime2
Definition: RPCCluster.h:36
float sumY2
Definition: RPCCluster.h:39
float sumTime
Definition: RPCCluster.h:36
float sumY
Definition: RPCCluster.h:39
bool isAdjacent(const RPCCluster &cl) const
Definition: RPCCluster.cc:31
uint16_t fstrip
Definition: RPCCluster.h:32

◆ operator<()

bool RPCCluster::operator< ( const RPCCluster cl) const

Definition at line 62 of file RPCCluster.cc.

References bx(), haddnano::cl, and firstStrip().

62  {
63  if (cl.bx() == this->bx())
64  return cl.firstStrip() < this->firstStrip();
65 
66  return cl.bx() < this->bx();
67 }
int firstStrip() const
Definition: RPCCluster.cc:16
int bx() const
Definition: RPCCluster.cc:19

◆ operator==()

bool RPCCluster::operator== ( const RPCCluster cl) const

Definition at line 69 of file RPCCluster.cc.

References bx(), clusterSize(), and firstStrip().

69  {
70  return ((this->clusterSize() == cl.clusterSize()) && (this->bx() == cl.bx()) &&
71  (this->firstStrip() == cl.firstStrip()));
72 }
int clusterSize() const
Definition: RPCCluster.cc:18
int firstStrip() const
Definition: RPCCluster.cc:16
int bx() const
Definition: RPCCluster.cc:19

◆ time()

float RPCCluster::time ( ) const

Definition at line 22 of file RPCCluster.cc.

References hasTime(), nTime, and sumTime.

Referenced by addTime(), and RPCRecHitStandardAlgo::compute().

22 { return hasTime() ? sumTime / nTime : 0; }
uint16_t nTime
Definition: RPCCluster.h:37
bool hasTime() const
Definition: RPCCluster.cc:21
float sumTime
Definition: RPCCluster.h:36

◆ timeRMS()

float RPCCluster::timeRMS ( ) const

Definition at line 23 of file RPCCluster.cc.

References F(), hasTime(), SiStripPI::max, nTime, mathSSE::sqrt(), sumTime, and sumTime2.

Referenced by RPCRecHitStandardAlgo::compute().

23  {
24  return hasTime() ? sqrt(max(0.F, sumTime2 * nTime - sumTime * sumTime)) / nTime : -1;
25 }
uint16_t nTime
Definition: RPCCluster.h:37
bool hasTime() const
Definition: RPCCluster.cc:21
float sumTime2
Definition: RPCCluster.h:36
T sqrt(T t)
Definition: SSEVec.h:19
float sumTime
Definition: RPCCluster.h:36
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163

◆ y()

float RPCCluster::y ( ) const

◆ yRMS()

float RPCCluster::yRMS ( ) const

Definition at line 29 of file RPCCluster.cc.

References F(), hasY(), SiStripPI::max, nY, mathSSE::sqrt(), sumY, and sumY2.

29 { return hasY() ? sqrt(max(0.F, sumY2 * nY - sumY * sumY)) / nY : -1; }
uint16_t nY
Definition: RPCCluster.h:40
float sumY2
Definition: RPCCluster.h:39
T sqrt(T t)
Definition: SSEVec.h:19
bool hasY() const
Definition: RPCCluster.cc:27
float sumY
Definition: RPCCluster.h:39
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163

Member Data Documentation

◆ bunchx

int16_t RPCCluster::bunchx
private

Definition at line 34 of file RPCCluster.h.

Referenced by bx().

◆ fstrip

uint16_t RPCCluster::fstrip
private

Definition at line 32 of file RPCCluster.h.

Referenced by clusterSize(), firstStrip(), and merge().

◆ lstrip

uint16_t RPCCluster::lstrip
private

Definition at line 33 of file RPCCluster.h.

Referenced by clusterSize(), and lastStrip().

◆ nTime

uint16_t RPCCluster::nTime
private

Definition at line 37 of file RPCCluster.h.

Referenced by addTime(), hasTime(), merge(), time(), and timeRMS().

◆ nY

uint16_t RPCCluster::nY
private

Definition at line 40 of file RPCCluster.h.

Referenced by addY(), hasY(), merge(), y(), and yRMS().

◆ sumTime

float RPCCluster::sumTime
private

Definition at line 36 of file RPCCluster.h.

Referenced by addTime(), merge(), time(), and timeRMS().

◆ sumTime2

float RPCCluster::sumTime2
private

Definition at line 36 of file RPCCluster.h.

Referenced by addTime(), merge(), and timeRMS().

◆ sumY

float RPCCluster::sumY
private

Definition at line 39 of file RPCCluster.h.

Referenced by addY(), merge(), y(), and yRMS().

◆ sumY2

float RPCCluster::sumY2
private

Definition at line 39 of file RPCCluster.h.

Referenced by addY(), merge(), and yRMS().