RecoLocalTracker
SiStripZeroSuppression
src
FastLinearCMNSubtractor.cc
Go to the documentation of this file.
1
#include "
RecoLocalTracker/SiStripZeroSuppression/interface/FastLinearCMNSubtractor.h
"
2
3
void
FastLinearCMNSubtractor::subtract
(uint32_t detId, uint16_t firstAPV, std::vector<int16_t>& digis) {
4
subtract_
(detId, firstAPV, digis);
5
}
6
void
FastLinearCMNSubtractor::subtract
(uint32_t detId, uint16_t firstAPV, std::vector<float>& digis) {
7
subtract_
(detId, firstAPV, digis);
8
}
9
10
template
<
typename
T>
11
inline
void
FastLinearCMNSubtractor::subtract_
(uint32_t detId, uint16_t firstAPV, std::vector<T>& digis) {
12
std::vector<T>
tmp
;
13
tmp
.reserve(128);
14
typename
std::vector<T>::iterator
strip
(digis.begin()),
end
(digis.end()), endAPV,
high
,
low
;
15
16
while
(
strip
<
end
) {
17
endAPV =
strip
+ 128;
18
tmp
.clear();
19
tmp
.insert(
tmp
.end(),
strip
, endAPV);
20
const
float
offset
=
median
(
tmp
);
21
22
low
=
strip
;
23
high
=
strip
+ 64;
24
tmp
.clear();
25
while
(
high
< endAPV)
26
tmp
.push_back(*
high
++ - *
low
++);
27
const
float
slope
=
median
(
tmp
) / 64.;
28
29
while
(
strip
< endAPV) {
30
*
strip
= static_cast<T>(*
strip
- (
offset
+
slope
* (65 - (endAPV -
strip
))));
31
strip
++;
32
}
33
}
34
}
35
36
// Details on http://abbaneo.web.cern.ch/abbaneo/cmode/cm.html
SiStripCommonModeNoiseSubtractor::median
float median(std::vector< T > &)
Definition:
SiStripCommonModeNoiseSubtractor.h:29
FastLinearCMNSubtractor::subtract_
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
Definition:
FastLinearCMNSubtractor.cc:11
digitizers_cfi.strip
strip
Definition:
digitizers_cfi.py:19
createJobs.tmp
tmp
align.sh
Definition:
createJobs.py:716
end
#define end
Definition:
vmac.h:39
FastLinearCMNSubtractor.h
LaserClient_cfi.high
high
Definition:
LaserClient_cfi.py:50
FastLinearCMNSubtractor::subtract
void subtract(uint32_t detId, uint16_t firstAPV, std::vector< int16_t > &digis) override
Definition:
FastLinearCMNSubtractor.cc:3
slope
static const double slope[3]
Definition:
CastorTimeSlew.cc:6
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:78
LaserClient_cfi.low
low
Definition:
LaserClient_cfi.py:52
Generated for CMSSW Reference Manual by
1.8.16