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) {}

◆ 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) {}

◆ ~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.

35  {
36  ++nTime;
37  sumTime += time;
38  sumTime2 += time * time;
39 }

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

◆ addY()

void RPCCluster::addY ( const float  y)

Definition at line 41 of file RPCCluster.cc.

41  {
42  ++nY;
43  sumY += y;
44  sumY2 += y * y;
45 }

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

◆ bx()

int RPCCluster::bx ( ) const

Definition at line 19 of file RPCCluster.cc.

19 { return bunchx; }

References bunchx.

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

◆ clusterSize()

int RPCCluster::clusterSize ( ) const

Definition at line 18 of file RPCCluster.cc.

18 { return lstrip - fstrip + 1; }

References fstrip, and lstrip.

Referenced by operator==().

◆ firstStrip()

int RPCCluster::firstStrip ( ) const

Definition at line 16 of file RPCCluster.cc.

16 { return fstrip; }

References fstrip.

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

◆ hasTime()

bool RPCCluster::hasTime ( ) const

Definition at line 21 of file RPCCluster.cc.

21 { return nTime > 0; }

References nTime.

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

◆ hasY()

bool RPCCluster::hasY ( ) const

Definition at line 27 of file RPCCluster.cc.

27 { return nY > 0; }

References nY.

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

◆ isAdjacent()

bool RPCCluster::isAdjacent ( const RPCCluster cl) const

Definition at line 31 of file RPCCluster.cc.

31  {
32  return ((cl.firstStrip() == this->firstStrip() - 1) && (cl.bx() == this->bx()));
33 }

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

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

◆ lastStrip()

int RPCCluster::lastStrip ( ) const

Definition at line 17 of file RPCCluster.cc.

17 { return lstrip; }

References lstrip.

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

◆ merge()

void RPCCluster::merge ( const RPCCluster cl)

Definition at line 47 of file RPCCluster.cc.

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 }

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

Referenced by RPCClusterizer::doAction().

◆ operator<()

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

Definition at line 62 of file RPCCluster.cc.

62  {
63  if (cl.bx() == this->bx())
64  return cl.firstStrip() < this->firstStrip();
65 
66  return cl.bx() < this->bx();
67 }

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

◆ operator==()

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

Definition at line 69 of file RPCCluster.cc.

69  {
70  return ((this->clusterSize() == cl.clusterSize()) && (this->bx() == cl.bx()) &&
71  (this->firstStrip() == cl.firstStrip()));
72 }

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

◆ time()

float RPCCluster::time ( ) const

Definition at line 22 of file RPCCluster.cc.

22 { return hasTime() ? sumTime / nTime : 0; }

References hasTime(), nTime, and sumTime.

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

◆ timeRMS()

float RPCCluster::timeRMS ( ) const

Definition at line 23 of file RPCCluster.cc.

23  {
24  return hasTime() ? sqrt(max(0.F, sumTime2 * nTime - sumTime * sumTime)) / nTime : -1;
25 }

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

Referenced by RPCRecHitStandardAlgo::compute().

◆ y()

float RPCCluster::y ( ) const

◆ yRMS()

float RPCCluster::yRMS ( ) const

Definition at line 29 of file RPCCluster.cc.

29 { return hasY() ? sqrt(max(0.F, sumY2 * nY - sumY * sumY)) / nY : -1; }

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

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().

RPCCluster::firstStrip
int firstStrip() const
Definition: RPCCluster.cc:16
RPCCluster::y
float y() const
Definition: RPCCluster.cc:28
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
RPCCluster::hasY
bool hasY() const
Definition: RPCCluster.cc:27
RPCCluster::sumTime
float sumTime
Definition: RPCCluster.h:36
RPCCluster::sumY
float sumY
Definition: RPCCluster.h:39
RPCCluster::isAdjacent
bool isAdjacent(const RPCCluster &cl) const
Definition: RPCCluster.cc:31
RPCCluster::time
float time() const
Definition: RPCCluster.cc:22
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
RPCCluster::bx
int bx() const
Definition: RPCCluster.cc:19
RPCCluster::fstrip
uint16_t fstrip
Definition: RPCCluster.h:32
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
RPCCluster::bunchx
int16_t bunchx
Definition: RPCCluster.h:34
RPCCluster::hasTime
bool hasTime() const
Definition: RPCCluster.cc:21
RPCCluster::nY
uint16_t nY
Definition: RPCCluster.h:40
RPCCluster::nTime
uint16_t nTime
Definition: RPCCluster.h:37
RPCCluster::lstrip
uint16_t lstrip
Definition: RPCCluster.h:33
RPCCluster::sumY2
float sumY2
Definition: RPCCluster.h:39
RPCCluster::sumTime2
float sumTime2
Definition: RPCCluster.h:36
RPCCluster::clusterSize
int clusterSize() const
Definition: RPCCluster.cc:18