src
DataFormats
SiStripCluster
src
SiStripApproximateCluster.cc
Go to the documentation of this file.
1
#include "
DataFormats/SiStripCluster/interface/SiStripApproximateCluster.h
"
2
#include "
DataFormats/SiStripCluster/interface/SiStripCluster.h
"
3
#include <algorithm>
4
#include <cmath>
5
6
SiStripApproximateCluster::SiStripApproximateCluster
(
const
SiStripCluster
& cluster,
unsigned
int
maxNSat
) {
7
barycenter_
= std::round(cluster.
barycenter
() * 10);
8
width_
= cluster.
size
();
9
avgCharge_
= cluster.
charge
() / cluster.
size
();
10
isSaturated_
=
false
;
11
12
//mimicing the algorithm used in StripSubClusterShapeTrajectoryFilter...
13
//Looks for 3 adjacent saturated strips (ADC>=254)
14
const
auto
& ampls = cluster.
amplitudes
();
15
unsigned
int
thisSat = (ampls[0] >= 254), maxSat = thisSat;
16
for
(
unsigned
int
i
= 1,
n
= ampls.size();
i
<
n
; ++
i
) {
17
if
(ampls[
i
] >= 254) {
18
thisSat++;
19
}
else
if
(thisSat > 0) {
20
maxSat = std::max<int>(maxSat, thisSat);
21
thisSat = 0;
22
}
23
}
24
if
(thisSat > 0) {
25
maxSat = std::max<int>(maxSat, thisSat);
26
}
27
if
(maxSat >=
maxNSat
) {
28
isSaturated_
=
true
;
29
}
30
}
SiStripCluster::charge
int charge() const
Definition:
SiStripCluster.cc:40
mps_fire.i
i
Definition:
mps_fire.py:429
SiStripApproximateCluster::isSaturated_
bool isSaturated_
Definition:
SiStripApproximateCluster.h:32
SiStripApproximateCluster::width_
cms_uint8_t width_
Definition:
SiStripApproximateCluster.h:30
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
SiStripApproximateCluster::barycenter_
cms_uint16_t barycenter_
Definition:
SiStripApproximateCluster.h:29
SiStripApproximateCluster::avgCharge_
cms_uint8_t avgCharge_
Definition:
SiStripApproximateCluster.h:31
HLT_2023v12_cff.maxNSat
maxNSat
Definition:
HLT_2023v12_cff.py:754
SiStripCluster::amplitudes
SiStripCluster const & amplitudes() const
Definition:
SiStripCluster.h:67
SiStripApproximateCluster.h
SiStripCluster::size
auto size() const
Definition:
SiStripCluster.h:60
SiStripCluster
Definition:
SiStripCluster.h:12
SiStripApproximateCluster::SiStripApproximateCluster
SiStripApproximateCluster()
Definition:
SiStripApproximateCluster.h:9
SiStripCluster.h
SiStripCluster::barycenter
float barycenter() const
Definition:
SiStripCluster.cc:46
Generated for CMSSW Reference Manual by
1.8.14