24 for (
const auto&
inputTag : conf.
getParameter<std::vector<edm::InputTag> >(
"RawDigiProducersList") )
27 produces<edm::DetSetVector<SiStripDigi>>(
tagName);
29 produces<edm::DetSetVector<SiStripRawDigi>>(
tagName);
31 produces<edm::DetSetVector<SiStripProcessedRawDigi>>(
"APVCM"+
tagName);
33 produces<edm::DetSetVector<SiStripProcessedRawDigi>>(
"BADAPVBASELINE"+
tagName);
35 produces<edm::DetSetVector<SiStripDigi>>(
"BADAPVBASELINEPOINTS"+
tagName);
38 if (
tagName ==
"ProcessedRaw" ) {
41 }
else if (
tagName ==
"VirginRaw" ) {
43 }
else if (
tagName ==
"ScopeMode" ) {
49 }
else if (
tagName ==
"ZeroSuppressed" ) {
53 <<
"SiStripZeroZuppression can only process types \"VirginRaw\", \"ProcessedRaw\" and \"ZeroSuppressed\"";
58 throw cms::Exception(
"Invalid option") <<
"When producing data in the hybrid format, the APV restorer must be configured with APVInspectMode='HybridEmulation'";
77 if ( ! inDigis->empty() )
85 if ( ! inDigis->empty() ) {
115 for (
const auto& rawDigis : input ) {
118 int16_t nAPVflagged = 0;
120 nAPVflagged =
algorithms->suppressProcessedRawData(rawDigis, suppressedDigis);
122 nAPVflagged =
algorithms->suppressVirginRawData(rawDigis, suppressedDigis);
125 nAPVflagged =
algorithms->convertVirginRawToHybrid(rawDigis, suppressedDigis);
127 nAPVflagged =
algorithms->suppressVirginRawData(rawDigis, suppressedDigis);
143 for (
const auto& inDigis : input ) {
146 std::vector<int16_t> rawDigis;
147 const auto nAPVflagged =
algorithms->suppressHybridData(inDigis, suppressedDigis, rawDigis);
163 const std::vector<bool>& apvf =
algorithms->getAPVFlags();
165 for (
const auto rawDigi : rawDigis ) {
166 int16_t apvN = strip/128;
167 if (apvf[apvN]) outRawDigis.
push_back(rawDigi);
177 outRawDigis.
reserve(rawDigis.size());
178 const std::vector<bool>& apvf =
algorithms->getAPVFlags();
180 for (
const auto rawDigi : rawDigis ) {
181 int16_t apvN = strip/128;
191 const auto& vmedians =
algorithms->getAPVsCM();
193 if (nAPVflagged > 0){
201 const auto& baselinemap =
algorithms->getBaselineMap();
204 baselineDetSet.
reserve(vmedians.size()*128);
205 for (
const auto& vmed : vmedians ) {
206 const uint16_t apvN = vmed.first;
207 const float median = vmed.second;
208 auto itBaselineMap = baselinemap.find(apvN);
209 if ( baselinemap.end() == itBaselineMap ) {
218 if ( ! baselineDetSet.
empty() )
225 for (
const auto& itBaselinePointVect :
algorithms->getSmoothedPoints() ) {
226 const uint16_t apvN = itBaselinePointVect.first;
227 for (
const auto& itBaselinePointMap : itBaselinePointVect.second ) {
228 const uint16_t bpstrip = itBaselinePointMap.first + apvN*128;
229 const int16_t bp = itBaselinePointMap.second;
234 if ( ! baspointDetSet.
empty() )
240 std::vector<bool> apvf(6,
false);
242 const auto& apvFlagged =
algorithms->getAPVFlags();
248 for (
const auto& vmed : vmedians ) {
249 if ( vmed.first > apvNb ) {
250 for (
int i{0};
i < vmed.first-apvNb; ++
i ) {
256 if (
fixCM && apvf[vmed.first] ) {
264 if(!apvDetSet.
empty())
T getParameter(std::string const &) const
std::vector< std::pair< short, float >> medians_t
void storeBaselinePoints(uint32_t)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void push_back(const T &t)
std::vector< edm::DetSet< SiStripDigi > > output_base
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< std::tuple< std::string, zstoken_t > > hybridInputs
A signed Digi for the silicon strip detector, containing only adc information, and suitable for stori...
bool produceCalculatedBaseline
std::vector< edm::DetSet< SiStripDigi > > output_baseline_points
bool produceBaselinePoints
void processRaw(const edm::DetSetVector< SiStripRawDigi > &input, RawType inType)
static std::string const input
produceCalculatedBaseline
void storeExtraOutput(uint32_t, int16_t)
std::vector< edm::DetSet< SiStripProcessedRawDigi > > output_apvcm
std::unique_ptr< SiStripRawProcessingAlgorithms > algorithms
std::vector< edm::DetSet< SiStripProcessedRawDigi > > output_baseline
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
std::vector< std::tuple< std::string, RawType, rawtoken_t > > rawInputs
void storeBaseline(uint32_t, const medians_t &)
std::vector< edm::DetSet< SiStripRawDigi > > output_base_raw
void storeCMN(uint32_t, const medians_t &)
void processHybrid(const edm::DetSetVector< SiStripDigi > &input)
SiStripZeroSuppression(const edm::ParameterSet &)
edm::DetSet< SiStripRawDigi > formatRawDigis(const edm::DetSet< SiStripRawDigi > &rawDigis)
void putOutputs(edm::Event &evt, const std::string &tagName)
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...