Main Page
Namespaces
Classes
Package Documentation
RecoLocalMuon
RPCRecHit
src
RPCCluster.cc
Go to the documentation of this file.
1
#include "
RPCCluster.h
"
2
#include <iostream>
3
#include <fstream>
4
#include <cmath>
5
6
using namespace
std
;
7
8
RPCCluster::RPCCluster
():
9
fstrip(0), lstrip(0), bunchx(0),
10
sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0)
11
{
12
}
13
14
RPCCluster::RPCCluster
(
int
fs,
int
ls
,
int
bx
) :
15
fstrip
(fs),
lstrip
(ls),
bunchx
(bx),
16
sumTime
(0),
sumTime2
(0),
nTime
(0),
sumY
(0),
sumY2
(0),
nY
(0)
17
{
18
}
19
20
RPCCluster::~RPCCluster
() {}
21
22
int
RPCCluster::firstStrip
()
const
{
return
fstrip
; }
23
int
RPCCluster::lastStrip
()
const
{
return
lstrip
; }
24
int
RPCCluster::clusterSize
()
const
{
return
lstrip
-
fstrip
+1; }
25
int
RPCCluster::bx
()
const
{
return
bunchx
; }
26
27
bool
RPCCluster::hasTime
()
const
{
return
nTime
> 0; }
28
float
RPCCluster::time
()
const
{
return
hasTime
() ?
sumTime
/
nTime
: 0; }
29
float
RPCCluster::timeRMS
()
const
{
return
hasTime
() ?
sqrt
(
max
(0.
F
,
sumTime2
*
nTime
-
sumTime
*
sumTime
))/
nTime
: -1; }
30
31
bool
RPCCluster::hasY
()
const
{
return
nY
> 0; }
32
float
RPCCluster::y
()
const
{
return
hasY
() ?
sumY
/
nY
: 0; }
33
float
RPCCluster::yRMS
()
const
{
return
hasY
() ?
sqrt
(
max
(0.
F
,
sumY2
*
nY
-
sumY
*
sumY
))/
nY
: -1; }
34
35
bool
RPCCluster::isAdjacent
(
const
RPCCluster
&
cl
)
const
36
{
37
return
((cl.
firstStrip
() == this->
firstStrip
()-1) &&
38
(cl.
bx
() == this->
bx
()));
39
}
40
41
void
RPCCluster::addTime
(
const
float
time
)
42
{
43
++
nTime
;
44
sumTime
+=
time
;
45
sumTime2
+= time*
time
;
46
}
47
48
void
RPCCluster::addY
(
const
float
y
)
49
{
50
++
nY
;
51
sumY
+=
y
;
52
sumY2
+= y*
y
;
53
}
54
55
void
RPCCluster::merge
(
const
RPCCluster
&
cl
)
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
}
69
70
bool
RPCCluster::operator<
(
const
RPCCluster
&
cl
)
const
71
{
72
if
(cl.
bx
() == this->
bx
())
return
cl.
firstStrip
()<this->
firstStrip
();
73
74
return
cl.
bx
()<this->
bx
();
75
}
76
77
bool
RPCCluster::operator==
(
const
RPCCluster
&
cl
)
const
78
{
79
return
( (this->
clusterSize
() == cl.
clusterSize
()) &&
80
(this->
bx
() == cl.
bx
()) &&
81
(this->
firstStrip
() == cl.
firstStrip
()) );
82
}
RPCCluster::nY
uint16_t nY
Definition:
RPCCluster.h:40
RPCCluster::nTime
uint16_t nTime
Definition:
RPCCluster.h:37
RPCCluster::addY
void addY(const float y)
Definition:
RPCCluster.cc:48
RPCCluster::bunchx
int16_t bunchx
Definition:
RPCCluster.h:34
RPCCluster::operator==
bool operator==(const RPCCluster &cl) const
Definition:
RPCCluster.cc:77
RPCCluster::timeRMS
float timeRMS() const
Definition:
RPCCluster.cc:29
RPCCluster::merge
void merge(const RPCCluster &cl)
Definition:
RPCCluster.cc:55
std
Definition:
JetResolutionObject.h:76
RPCCluster::clusterSize
int clusterSize() const
Definition:
RPCCluster.cc:24
RPCCluster::sumTime2
float sumTime2
Definition:
RPCCluster.h:36
RPCCluster::hasTime
bool hasTime() const
Definition:
RPCCluster.cc:27
RPCCluster::lstrip
uint16_t lstrip
Definition:
RPCCluster.h:33
RPCCluster::sumY2
float sumY2
Definition:
RPCCluster.h:39
RPCCluster::yRMS
float yRMS() const
Definition:
RPCCluster.cc:33
RPCCluster.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
RPCCluster::~RPCCluster
~RPCCluster()
Definition:
RPCCluster.cc:20
RPCCluster::sumTime
float sumTime
Definition:
RPCCluster.h:36
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:19
RPCCluster::RPCCluster
RPCCluster()
Definition:
RPCCluster.cc:8
RPCCluster::operator<
bool operator<(const RPCCluster &cl) const
Definition:
RPCCluster.cc:70
eostools.ls
def ls(path, rec=False)
Definition:
eostools.py:348
RPCCluster::sumY
float sumY
Definition:
RPCCluster.h:39
RPCCluster::bx
int bx() const
Definition:
RPCCluster.cc:25
RPCCluster::hasY
bool hasY() const
Definition:
RPCCluster.cc:31
RPCCluster
Definition:
RPCCluster.h:4
RPCCluster::y
float y() const
Definition:
RPCCluster.cc:32
RPCCluster::addTime
void addTime(const float time)
Definition:
RPCCluster.cc:41
RPCCluster::lastStrip
int lastStrip() const
Definition:
RPCCluster.cc:23
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition:
blowfish.cc:281
RPCCluster::fstrip
uint16_t fstrip
Definition:
RPCCluster.h:32
RPCCluster::firstStrip
int firstStrip() const
Definition:
RPCCluster.cc:22
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition:
GetRecoTauVFromDQM_MC_cff.py:37
RPCCluster::time
float time() const
Definition:
RPCCluster.cc:28
RPCCluster::isAdjacent
bool isAdjacent(const RPCCluster &cl) const
Definition:
RPCCluster.cc:35
Generated for CMSSW Reference Manual by
1.8.11