Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
RecoLocalMuon
RPCRecHit
plugins
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), sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0) {}
10
11
RPCCluster::RPCCluster
(
int
fs,
int
ls
,
int
bx
)
12
: fstrip(fs), lstrip(ls), bunchx(bx), sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0) {}
13
14
RPCCluster::~RPCCluster
() {}
15
16
int
RPCCluster::firstStrip
()
const
{
return
fstrip
; }
17
int
RPCCluster::lastStrip
()
const
{
return
lstrip
; }
18
int
RPCCluster::clusterSize
()
const
{
return
lstrip
-
fstrip
+ 1; }
19
int
RPCCluster::bx
()
const
{
return
bunchx
; }
20
21
bool
RPCCluster::hasTime
()
const
{
return
nTime
> 0; }
22
float
RPCCluster::time
()
const
{
return
hasTime
() ?
sumTime
/
nTime
: 0; }
23
float
RPCCluster::timeRMS
()
const
{
24
return
hasTime
() ?
sqrt
(
max
(0.
F
,
sumTime2
*
nTime
-
sumTime
*
sumTime
)) /
nTime
: -1;
25
}
26
27
bool
RPCCluster::hasY
()
const
{
return
nY
> 0; }
28
float
RPCCluster::y
()
const
{
return
hasY
() ?
sumY
/
nY
: 0; }
29
float
RPCCluster::yRMS
()
const
{
return
hasY
() ?
sqrt
(
max
(0.
F
,
sumY2
*
nY
-
sumY
*
sumY
)) /
nY
: -1; }
30
31
bool
RPCCluster::isAdjacent
(
const
RPCCluster
&
cl
)
const
{
32
return
((cl.
firstStrip
() == this->
firstStrip
() - 1) && (cl.
bx
() == this->
bx
()));
33
}
34
35
void
RPCCluster::addTime
(
const
float
time) {
36
++
nTime
;
37
sumTime
+=
time
;
38
sumTime2
+= time *
time
;
39
}
40
41
void
RPCCluster::addY
(
const
float
y
) {
42
++
nY
;
43
sumY
+=
y
;
44
sumY2
+= y *
y
;
45
}
46
47
void
RPCCluster::merge
(
const
RPCCluster
&
cl
) {
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
}
61
62
bool
RPCCluster::operator<
(
const
RPCCluster
&
cl
)
const
{
63
if
(cl.
bx
() == this->
bx
())
64
return
cl.
firstStrip
() < this->
firstStrip
();
65
66
return
cl.
bx
() < this->
bx
();
67
}
68
69
bool
RPCCluster::operator==
(
const
RPCCluster
&
cl
)
const
{
70
return
((this->
clusterSize
() == cl.
clusterSize
()) && (this->
bx
() == cl.
bx
()) &&
71
(this->
firstStrip
() == cl.
firstStrip
()));
72
}
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:41
RPCCluster::bunchx
int16_t bunchx
Definition:
RPCCluster.h:34
RPCCluster::operator==
bool operator==(const RPCCluster &cl) const
Definition:
RPCCluster.cc:69
RPCCluster::timeRMS
float timeRMS() const
Definition:
RPCCluster.cc:23
eostools.ls
def ls
Definition:
eostools.py:349
RPCCluster::merge
void merge(const RPCCluster &cl)
Definition:
RPCCluster.cc:47
RPCCluster::clusterSize
int clusterSize() const
Definition:
RPCCluster.cc:18
RPCCluster::sumTime2
float sumTime2
Definition:
RPCCluster.h:36
RPCCluster::hasTime
bool hasTime() const
Definition:
RPCCluster.cc:21
RPCCluster::lstrip
uint16_t lstrip
Definition:
RPCCluster.h:33
haddnano.cl
tuple cl
Definition:
haddnano.py:49
RPCCluster::sumY2
float sumY2
Definition:
RPCCluster.h:39
RPCCluster::yRMS
float yRMS() const
Definition:
RPCCluster.cc:29
RPCCluster.h
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
RPCCluster::~RPCCluster
~RPCCluster()
Definition:
RPCCluster.cc:14
RPCCluster::sumTime
float sumTime
Definition:
RPCCluster.h:36
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:169
RPCCluster::RPCCluster
RPCCluster()
Definition:
RPCCluster.cc:8
RPCCluster::operator<
bool operator<(const RPCCluster &cl) const
Definition:
RPCCluster.cc:62
detailsBasic3DVector::y
float float y
Definition:
extBasic3DVector.h:14
RPCCluster::sumY
float sumY
Definition:
RPCCluster.h:39
RPCCluster::bx
int bx() const
Definition:
RPCCluster.cc:19
RPCCluster::hasY
bool hasY() const
Definition:
RPCCluster.cc:27
RPCCluster
Definition:
RPCCluster.h:4
makePileupJSON.bx
tuple bx
Definition:
makePileupJSON.py:40
RPCCluster::y
float y() const
Definition:
RPCCluster.cc:28
RPCCluster::addTime
void addTime(const float time)
Definition:
RPCCluster.cc:35
RPCCluster::lastStrip
int lastStrip() const
Definition:
RPCCluster.cc:17
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition:
blowfish.cc:163
RPCCluster::fstrip
uint16_t fstrip
Definition:
RPCCluster.h:32
RPCCluster::firstStrip
int firstStrip() const
Definition:
RPCCluster.cc:16
RPCCluster::time
float time() const
Definition:
RPCCluster.cc:22
RPCCluster::isAdjacent
bool isAdjacent(const RPCCluster &cl) const
Definition:
RPCCluster.cc:31
Generated for CMSSW Reference Manual by
1.8.5