24 for (
const auto&
inputTag : conf.
getParameter<std::vector<edm::InputTag>>(
"RawDigiProducersList")) {
26 produces<edm::DetSetVector<SiStripDigi>>(
tagName);
28 produces<edm::DetSetVector<SiStripRawDigi>>(
tagName);
30 produces<edm::DetSetVector<SiStripProcessedRawDigi>>(
"APVCM" +
tagName);
32 produces<edm::DetSetVector<SiStripProcessedRawDigi>>(
"BADAPVBASELINE" +
tagName);
34 produces<edm::DetSetVector<SiStripDigi>>(
"BADAPVBASELINEPOINTS" +
tagName);
37 if (
tagName ==
"ProcessedRaw") {
40 throw cms::Exception(
"Processed Raw Cannot be converted in hybrid Format");
41 }
else if (
tagName ==
"VirginRaw") {
43 }
else if (
tagName ==
"ScopeMode") {
46 throw cms::Exception(
"Scope Mode cannot be converted in hybrid Format");
50 }
else if (
tagName ==
"ZeroSuppressed") {
55 <<
"SiStripZeroZuppression can only process types \"VirginRaw\", \"ProcessedRaw\" and \"ZeroSuppressed\"";
62 throw cms::Exception(
"Invalid option") <<
"When producing data in the hybrid format, the APV restorer must be "
63 "configured with APVInspectMode='HybridEmulation'";
66 edm::LogInfo(
"SiStripZeroSuppression") <<
"Raw digis will not be saved for hybrid inputs";
88 e.getByToken(std::get<rawtoken_t>(
input), inDigis);
89 if (!inDigis->empty())
96 e.getByToken(std::get<zstoken_t>(
input), inDigis);
97 if (!inDigis->empty()) {
124 for (
const auto& rawDigis :
input) {
127 int16_t nAPVflagged = 0;
129 nAPVflagged =
algorithms->suppressProcessedRawData(rawDigis, suppressedDigis);
131 nAPVflagged =
algorithms->suppressVirginRawData(rawDigis, suppressedDigis);
134 nAPVflagged =
algorithms->convertVirginRawToHybrid(rawDigis, suppressedDigis);
136 nAPVflagged =
algorithms->suppressVirginRawData(rawDigis, suppressedDigis);
151 for (
const auto& inDigis :
input) {
154 uint16_t nAPVflagged = 0;
155 nAPVflagged =
algorithms->suppressHybridData(inDigis, suppressedDigis);
158 if (!suppressedDigis.
empty())
166 const std::vector<bool>& apvf =
algorithms->getAPVFlags();
168 for (
const auto rawDigi : rawDigis) {
169 int16_t apvN =
strip / 128;
180 const std::vector<int16_t>& rawDigis) {
182 outRawDigis.
reserve(rawDigis.size());
183 const std::vector<bool>& apvf =
algorithms->getAPVFlags();
185 for (
const auto rawDigi : rawDigis) {
186 int16_t apvN =
strip / 128;
197 const auto& vmedians =
algorithms->getAPVsCM();
200 if (nAPVflagged > 0) {
209 const auto& baselinemap =
algorithms->getBaselineMap();
212 baselineDetSet.
reserve(vmedians.size() * 128);
213 for (
const auto& vmed : vmedians) {
214 const uint16_t apvN = vmed.first;
215 const float median = vmed.second;
216 auto itBaselineMap = baselinemap.find(apvN);
217 if (baselinemap.end() == itBaselineMap) {
226 if (!baselineDetSet.
empty())
232 for (
const auto& itBaselinePointVect :
algorithms->getSmoothedPoints()) {
233 const uint16_t apvN = itBaselinePointVect.first;
234 for (
const auto& itBaselinePointMap : itBaselinePointVect.second) {
235 const uint16_t bpstrip = itBaselinePointMap.first + apvN * 128;
236 const int16_t bp = itBaselinePointMap.second;
241 if (!baspointDetSet.
empty())
246 std::vector<bool> apvf(6,
false);
248 const auto& apvFlagged =
algorithms->getAPVFlags();
254 for (
const auto& vmed : vmedians) {
255 if (vmed.first > apvNb) {
256 for (
int i{0};
i < vmed.first - apvNb; ++
i) {
262 if (
fixCM && apvf[vmed.first]) {
270 if (!apvDetSet.
empty())