15 std::unique_ptr<SiStripPedestalsSubtractor>
ped,
16 std::unique_ptr<SiStripCommonModeNoiseSubtractor> cmn,
17 std::unique_ptr<SiStripFedZeroSuppression> zs,
18 std::unique_ptr<SiStripAPVRestorer>
res,
62 uint16_t nAPVFlagged = 0;
63 auto currentDigi = hybridDigis.
begin();
64 const auto endDigi = hybridDigis.
end();
65 auto currentAPV = firstAPV;
68 while (currentDigi != endDigi) {
70 const auto nextAPVBoundary =
SiStripDigi((currentAPV + 1) * 128, 0);
73 if (nextAPVBoundary.strip() > maxNStrips) {
75 <<
"In DetId " << suppressedDigis.
id <<
" encountered APV boundary with strip number " 76 << nextAPVBoundary.strip() <<
", which exceeds the maximum allowed value for this module (" << maxNStrips
77 <<
"). Exiting loop.";
81 const auto nextAPVDigi =
std::lower_bound(currentDigi, endDigi, nextAPVBoundary);
82 const auto nDigisInAPV =
std::distance(currentDigi, nextAPVDigi);
85 if (nDigisInAPV > 64) {
90 for (
auto it = currentDigi;
it != nextAPVDigi; ++
it) {
91 workDigis[
it->strip() - 128 * currentAPV] =
it->adc() * 2 - 1024;
99 const auto apvFlagged =
restorer->inspectAndRestore(
100 hybridDigis.
id, currentAPV, workDigisPedSubtracted, workDigis,
subtractorCMN->getAPVsCM());
101 nAPVFlagged += apvFlagged;
106 suppressor->suppress(workDigis, currentAPV, suppressedDigis);
109 for (uint16_t
i = 0;
i < 128; ++
i) {
110 const auto digi = workDigisPedSubtracted[
i];
124 currentDigi = nextAPVDigi;
164 rawdigis.reserve(rawDigis.
size());
189 int16_t nAPVFlagged = 0;
191 procRawDigisPedSubtracted.assign(procRawDigis.begin(), procRawDigis.end());
195 restorer->inspectAndRestore(
id, firstAPV, procRawDigisPedSubtracted, procRawDigis,
subtractorCMN->getAPVsCM());
213 rawdigis.reserve(rawDigis.
size());
241 for (
auto& digi : procRawDigis) {
247 for (
auto& digi : procRawDigis) {
251 procRawDigisPedSubtracted.assign(procRawDigis.begin(), procRawDigis.end());
257 for (
auto& digi : procRawDigis) {
262 const std::size_t nAPVs = procRawDigis.size() / 128;
263 for (uint16_t iAPV = firstAPV; iAPV < nAPVs + firstAPV; ++iAPV) {
266 for (uint16_t
i = 0;
i < 128; ++
i) {
267 const int16_t digi = procRawDigisPedSubtracted[128 * (iAPV - firstAPV) +
i];
271 const auto firstDigiIt = std::begin(procRawDigis) + 128 * (iAPV - firstAPV);
272 std::vector<int16_t> singleAPVdigi(firstDigiIt, firstDigiIt + 128);
295 rawdigis.reserve(rawDigis.
size());
uint16_t suppressVirginRawData(uint32_t detId, uint16_t firstAPV, digivector_t &procRawDigis, edm::DetSet< SiStripDigi > &output)
void push_back(const T &t)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const std::unique_ptr< SiStripPedestalsSubtractor > subtractorPed
uint16_t suppressProcessedRawData(uint32_t detId, uint16_t firstAPV, digivector_t &procRawDigis, edm::DetSet< SiStripDigi > &output)
SiStripAPVRestorer::digivector_t digivector_t
uint16_t convertVirginRawToHybrid(uint32_t detId, uint16_t firstAPV, digivector_t &inDigis, edm::DetSet< SiStripDigi > &rawDigis)
SiStripRawProcessingAlgorithms(edm::ConsumesCollector iC, std::unique_ptr< SiStripPedestalsSubtractor > ped, std::unique_ptr< SiStripCommonModeNoiseSubtractor > cmn, std::unique_ptr< SiStripFedZeroSuppression > zs, std::unique_ptr< SiStripAPVRestorer > res, bool doAPVRest, bool useCMMap)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Log< level::Error, false > LogError
const std::unique_ptr< SiStripAPVRestorer > restorer
const uint16_t & strip() const
const uint16_t & adc() const
const std::unique_ptr< SiStripCommonModeNoiseSubtractor > subtractorCMN
uint16_t suppressHybridData(const uint16_t maxStrip, const edm::DetSet< SiStripDigi > &inDigis, edm::DetSet< SiStripDigi > &suppressedDigis, uint16_t firstAPV=0)
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
const std::unique_ptr< SiStripFedZeroSuppression > suppressor
const std::vector< bool > & getAPVFlags() const
const TrackerGeometry * trGeo
void initialize(const edm::EventSetup &)
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...