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