Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
SiStripCluster
src
SiStripCluster.cc
Go to the documentation of this file.
1
2
#include "
DataFormats/SiStripCluster/interface/SiStripCluster.h
"
3
4
SiStripCluster::SiStripCluster
(
const
SiStripDigiRange
& range) :
5
firstStrip_
(range.
first
->strip()),
6
error_x
(-99999.9)
7
{
8
9
amplitudes_
.reserve( range.second - range.first);
10
11
uint16_t lastStrip=0;
12
bool
firstInloop =
true
;
13
for
(
SiStripDigiIter
i
=range.first;
i
!=range.second;
i
++) {
14
16
if
(!firstInloop &&
i
->strip() != lastStrip + 1) {
17
for
(
int
j
=0;
j
<
i
->strip()-(lastStrip+1);
j
++) {
18
amplitudes_
.push_back( 0);
19
}
20
}
21
lastStrip =
i
->strip();
22
firstInloop =
false
;
23
24
amplitudes_
.push_back(
i
->adc());
25
}
26
}
27
28
29
float
SiStripCluster::barycenter
()
const
{
30
int
sumx = 0;
31
int
suma = 0;
32
size_t
asize =
amplitudes_
.size();
33
for
(
size_t
i
=0;
i
<asize;++
i
) {
34
sumx += (
firstStrip_
+
i
)*(
amplitudes_
[
i
]);
35
suma +=
amplitudes_
[
i
];
36
}
37
38
// strip centers are offcet by half pitch w.r.t. strip numbers,
39
// so one has to add 0.5 to get the correct barycenter position
40
return
sumx /
static_cast<
float
>
(suma) + 0.5
f
;
41
}
SiStripCluster::SiStripCluster
SiStripCluster()
Definition:
SiStripCluster.h:18
i
int i
Definition:
DBlmapReader.cc:9
SiStripCluster::SiStripDigiRange
std::pair< SiStripDigiIter, SiStripDigiIter > SiStripDigiRange
Definition:
SiStripCluster.h:12
SiStripCluster::error_x
float error_x
Definition:
SiStripCluster.h:73
j
int j
Definition:
DBlmapReader.cc:9
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
SiStripCluster::barycenter
float barycenter() const
Definition:
SiStripCluster.cc:29
first
bool first
Definition:
L1TdeRCT.cc:75
SiStripCluster::SiStripDigiIter
std::vector< SiStripDigi >::const_iterator SiStripDigiIter
Definition:
SiStripCluster.h:11
SiStripCluster.h
SiStripCluster::amplitudes_
std::vector< uint8_t > amplitudes_
Definition:
SiStripCluster.h:61
SiStripCluster::firstStrip_
uint16_t firstStrip_
Definition:
SiStripCluster.h:63
Generated for CMSSW Reference Manual by
1.8.5