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::RPCCluster ( )

Definition at line 8 of file RPCCluster.cc.

8  :
9  fstrip(0), lstrip(0), bunchx(0),
10  sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0)
11 {
12 }
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::RPCCluster ( int  fs,
int  ls,
int  bx 
)

Definition at line 14 of file RPCCluster.cc.

14  :
15  fstrip(fs), lstrip(ls), bunchx(bx),
16  sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0)
17 {
18 }
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
float sumY
Definition: RPCCluster.h:39
int bx() const
Definition: RPCCluster.cc:25
uint16_t fstrip
Definition: RPCCluster.h:32
RPCCluster::~RPCCluster ( )

Definition at line 20 of file RPCCluster.cc.

20 {}

Member Function Documentation

void RPCCluster::addTime ( const float  time)

Definition at line 41 of file RPCCluster.cc.

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

42 {
43  ++nTime;
44  sumTime += time;
45  sumTime2 += time*time;
46 }
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:28
void RPCCluster::addY ( const float  y)

Definition at line 48 of file RPCCluster.cc.

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

49 {
50  ++nY;
51  sumY += y;
52  sumY2 += y*y;
53 }
uint16_t nY
Definition: RPCCluster.h:40
float sumY2
Definition: RPCCluster.h:39
float sumY
Definition: RPCCluster.h:39
float y() const
Definition: RPCCluster.cc:32
int RPCCluster::bx ( ) const

Definition at line 25 of file RPCCluster.cc.

References bunchx.

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

25 { return bunchx; }
int16_t bunchx
Definition: RPCCluster.h:34
int RPCCluster::clusterSize ( ) const

Definition at line 24 of file RPCCluster.cc.

References fstrip, and lstrip.

Referenced by operator==().

24 { return lstrip-fstrip+1; }
uint16_t lstrip
Definition: RPCCluster.h:33
uint16_t fstrip
Definition: RPCCluster.h:32
int RPCCluster::firstStrip ( ) const

Definition at line 22 of file RPCCluster.cc.

References fstrip.

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

22 { return fstrip; }
uint16_t fstrip
Definition: RPCCluster.h:32
bool RPCCluster::hasTime ( ) const

Definition at line 27 of file RPCCluster.cc.

References nTime.

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

27 { return nTime > 0; }
uint16_t nTime
Definition: RPCCluster.h:37
bool RPCCluster::hasY ( ) const

Definition at line 31 of file RPCCluster.cc.

References nY.

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

31 { return nY > 0; }
uint16_t nY
Definition: RPCCluster.h:40
bool RPCCluster::isAdjacent ( const RPCCluster cl) const

Definition at line 35 of file RPCCluster.cc.

References bx(), and firstStrip().

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

36 {
37  return ((cl.firstStrip() == this->firstStrip()-1) &&
38  (cl.bx() == this->bx()));
39 }
int bx() const
Definition: RPCCluster.cc:25
int firstStrip() const
Definition: RPCCluster.cc:22
int RPCCluster::lastStrip ( ) const

Definition at line 23 of file RPCCluster.cc.

References lstrip.

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

23 { return lstrip; }
uint16_t lstrip
Definition: RPCCluster.h:33
void RPCCluster::merge ( const RPCCluster cl)

Definition at line 55 of file RPCCluster.cc.

References firstStrip(), fstrip, isAdjacent(), nTime, nY, sumTime, sumTime2, sumY, and sumY2.

Referenced by RPCClusterizer::doAction().

56 {
57  if ( !this->isAdjacent(cl) ) return;
58 
59  fstrip = cl.firstStrip();
60 
61  nTime += cl.nTime;
62  sumTime += cl.sumTime;
63  sumTime2 += cl.sumTime2;
64 
65  nY += cl.nY;
66  sumY += cl.sumY;
67  sumY2 += cl.sumY2;
68 }
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
uint16_t fstrip
Definition: RPCCluster.h:32
int firstStrip() const
Definition: RPCCluster.cc:22
bool isAdjacent(const RPCCluster &cl) const
Definition: RPCCluster.cc:35
bool RPCCluster::operator< ( const RPCCluster cl) const

Definition at line 70 of file RPCCluster.cc.

References bx(), and firstStrip().

71 {
72  if(cl.bx() == this->bx()) return cl.firstStrip()<this->firstStrip();
73 
74  return cl.bx()<this->bx();
75 }
int bx() const
Definition: RPCCluster.cc:25
int firstStrip() const
Definition: RPCCluster.cc:22
bool RPCCluster::operator== ( const RPCCluster cl) const

Definition at line 77 of file RPCCluster.cc.

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

78 {
79  return ( (this->clusterSize() == cl.clusterSize()) &&
80  (this->bx() == cl.bx()) &&
81  (this->firstStrip() == cl.firstStrip()) );
82 }
int clusterSize() const
Definition: RPCCluster.cc:24
int bx() const
Definition: RPCCluster.cc:25
int firstStrip() const
Definition: RPCCluster.cc:22
float RPCCluster::time ( ) const

Definition at line 28 of file RPCCluster.cc.

References hasTime(), nTime, and sumTime.

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

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

Definition at line 29 of file RPCCluster.cc.

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

Referenced by RPCRecHitStandardAlgo::compute().

29 { return hasTime() ? sqrt(max(0.F, sumTime2*nTime - sumTime*sumTime))/nTime : -1; }
uint16_t nTime
Definition: RPCCluster.h:37
float sumTime2
Definition: RPCCluster.h:36
bool hasTime() const
Definition: RPCCluster.cc:27
T sqrt(T t)
Definition: SSEVec.h:18
float sumTime
Definition: RPCCluster.h:36
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
float RPCCluster::y ( ) const
float RPCCluster::yRMS ( ) const

Definition at line 33 of file RPCCluster.cc.

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

33 { 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:18
float sumY
Definition: RPCCluster.h:39
bool hasY() const
Definition: RPCCluster.cc:31
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281

Member Data Documentation

int16_t RPCCluster::bunchx
private

Definition at line 34 of file RPCCluster.h.

Referenced by bx().

uint16_t RPCCluster::fstrip
private

Definition at line 32 of file RPCCluster.h.

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

uint16_t RPCCluster::lstrip
private

Definition at line 33 of file RPCCluster.h.

Referenced by clusterSize(), and lastStrip().

uint16_t RPCCluster::nTime
private

Definition at line 37 of file RPCCluster.h.

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

uint16_t RPCCluster::nY
private

Definition at line 40 of file RPCCluster.h.

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

float RPCCluster::sumTime
private

Definition at line 36 of file RPCCluster.h.

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

float RPCCluster::sumTime2
private

Definition at line 36 of file RPCCluster.h.

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

float RPCCluster::sumY
private

Definition at line 39 of file RPCCluster.h.

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

float RPCCluster::sumY2
private

Definition at line 39 of file RPCCluster.h.

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