src
L1Trigger
L1TMuonCPPF
src
CPPFCluster.cc
Go to the documentation of this file.
1
#include "
CPPFCluster.h
"
2
#include <iostream>
3
#include <fstream>
4
#include <cmath>
5
6
using namespace
std
;
7
8
CPPFCluster::CPPFCluster
()
9
: fstrip(0), lstrip(0), bunchx(0), sumTime(0), sumTime2(0), nTime(0), sumY(0), sumY2(0), nY(0) {}
10
11
CPPFCluster::CPPFCluster
(
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
CPPFCluster::~CPPFCluster
() {}
15
16
int
CPPFCluster::firstStrip
()
const
{
return
fstrip
; }
17
int
CPPFCluster::lastStrip
()
const
{
return
lstrip
; }
18
int
CPPFCluster::clusterSize
()
const
{
return
lstrip
-
fstrip
+ 1; }
19
int
CPPFCluster::bx
()
const
{
return
bunchx
; }
20
21
bool
CPPFCluster::hasTime
()
const
{
return
nTime
> 0; }
22
float
CPPFCluster::time
()
const
{
return
hasTime
() ?
sumTime
/
nTime
: 0; }
23
float
CPPFCluster::timeRMS
()
const
{
24
return
hasTime
() ?
sqrt
(
max
(0.
F
,
sumTime2
*
nTime
-
sumTime
*
sumTime
)) /
nTime
: -1;
25
}
26
27
bool
CPPFCluster::hasY
()
const
{
return
nY
> 0; }
28
float
CPPFCluster::y
()
const
{
return
hasY
() ?
sumY
/
nY
: 0; }
29
float
CPPFCluster::yRMS
()
const
{
return
hasY
() ?
sqrt
(
max
(0.
F
,
sumY2
*
nY
-
sumY
*
sumY
)) /
nY
: -1; }
30
31
bool
CPPFCluster::isAdjacent
(
const
CPPFCluster
&
cl
)
const
{
32
return
((
cl
.firstStrip() == this->
firstStrip
() - 1) && (cl.
bx
() == this->
bx
()));
33
}
34
35
void
CPPFCluster::addTime
(
const
float
time
) {
36
++
nTime
;
37
sumTime
+=
time
;
38
sumTime2
+= time *
time
;
39
}
40
41
void
CPPFCluster::addY
(
const
float
y
) {
42
++
nY
;
43
sumY
+=
y
;
44
sumY2
+=
y
*
y
;
45
}
46
47
void
CPPFCluster::merge
(
const
CPPFCluster
&
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
CPPFCluster::operator<
(
const
CPPFCluster
&
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
CPPFCluster::operator==
(
const
CPPFCluster
&
cl
)
const
{
70
return
((this->
clusterSize
() == cl.
clusterSize
()) && (this->
bx
() == cl.
bx
()) &&
71
(this->
firstStrip
() == cl.
firstStrip
()));
72
}
CPPFCluster::clusterSize
int clusterSize() const
Definition:
CPPFCluster.cc:18
CPPFCluster::lastStrip
int lastStrip() const
Definition:
CPPFCluster.cc:17
CPPFCluster
Definition:
CPPFCluster.h:4
CPPFCluster::sumY2
float sumY2
Definition:
CPPFCluster.h:39
CPPFCluster::nY
uint16_t nY
Definition:
CPPFCluster.h:40
CPPFCluster::y
float y() const
Definition:
CPPFCluster.cc:28
std
Definition:
JetResolutionObject.h:76
CPPFCluster::fstrip
uint16_t fstrip
Definition:
CPPFCluster.h:32
CPPFCluster::firstStrip
int firstStrip() const
Definition:
CPPFCluster.cc:16
haddnano.cl
cl
Definition:
haddnano.py:49
simKBmtfDigis_cfi.bx
bx
Definition:
simKBmtfDigis_cfi.py:55
CPPFCluster::sumTime2
float sumTime2
Definition:
CPPFCluster.h:36
CPPFCluster::nTime
uint16_t nTime
Definition:
CPPFCluster.h:37
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
CPPFCluster::sumTime
float sumTime
Definition:
CPPFCluster.h:36
CPPFCluster::~CPPFCluster
~CPPFCluster()
Definition:
CPPFCluster.cc:14
CPPFCluster::addTime
void addTime(const float time)
Definition:
CPPFCluster.cc:35
CPPFCluster::timeRMS
float timeRMS() const
Definition:
CPPFCluster.cc:23
CPPFCluster::bx
int bx() const
Definition:
CPPFCluster.cc:19
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
protons_cff.time
time
Definition:
protons_cff.py:25
CPPFCluster::time
float time() const
Definition:
CPPFCluster.cc:22
CPPFCluster::operator==
bool operator==(const CPPFCluster &cl) const
Definition:
CPPFCluster.cc:69
CPPFCluster::operator<
bool operator<(const CPPFCluster &cl) const
Definition:
CPPFCluster.cc:62
eostools.ls
def ls(path, rec=False)
Definition:
eostools.py:349
CPPFCluster::lstrip
uint16_t lstrip
Definition:
CPPFCluster.h:33
CPPFCluster::merge
void merge(const CPPFCluster &cl)
Definition:
CPPFCluster.cc:47
compareTotals.fs
fs
Definition:
compareTotals.py:52
detailsBasic3DVector::y
float float y
Definition:
extBasic3DVector.h:14
CPPFCluster.h
CPPFCluster::isAdjacent
bool isAdjacent(const CPPFCluster &cl) const
Definition:
CPPFCluster.cc:31
CPPFCluster::yRMS
float yRMS() const
Definition:
CPPFCluster.cc:29
CPPFCluster::CPPFCluster
CPPFCluster()
Definition:
CPPFCluster.cc:8
CPPFCluster::hasTime
bool hasTime() const
Definition:
CPPFCluster.cc:21
CPPFCluster::sumY
float sumY
Definition:
CPPFCluster.h:39
CPPFCluster::addY
void addY(const float y)
Definition:
CPPFCluster.cc:41
CPPFCluster::hasY
bool hasY() const
Definition:
CPPFCluster.cc:27
CPPFCluster::bunchx
int16_t bunchx
Definition:
CPPFCluster.h:34
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition:
blowfish.cc:163
Generated for CMSSW Reference Manual by
1.8.14