106 : spyReorderedDigisTag_(iConfig.getParameter<edm::
InputTag>(
"SpyReorderedDigisTag")),
107 spyVirginRawDigisTag_(iConfig.getParameter<edm::
InputTag>(
"SpyVirginRawDigisTag")),
108 byModule_(iConfig.getParameter<bool>(
"ByModule")),
110 consumesCollector())),
124 produces<std::map<uint32_t, std::vector<uint32_t> > >(
"Medians");
125 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedestalsOrdered");
126 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"NoisesOrdered");
127 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrDigisOrdered");
128 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrDigisOrdered");
130 produces<edm::DetSetVector<SiStripRawDigi> >(
"ModulePedestals");
131 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"ModuleNoises");
132 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrModuleDigis");
133 produces<std::map<uint32_t, std::vector<uint32_t> > >(
"ModuleMedians");
134 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrModuleDigis");
135 produces<edm::DetSetVector<SiStripDigi> >(
"ZSModuleDigis");
172 unsigned int lNDigis = lInputDigis->
size();
176 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> pedsData;
177 pedsData.reserve(lNDigis);
178 std::vector<edm::DetSetVector<SiStripProcessedRawDigi>::detset> noiseData;
179 noiseData.reserve(lNDigis);
180 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> pedSubtrData;
181 pedSubtrData.reserve(lNDigis);
182 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> cmSubtrData;
183 cmSubtrData.reserve(lNDigis);
185 std::vector<edm::DetSet<SiStripDigi> > zsData;
188 std::map<uint32_t, std::vector<uint32_t> > medsData;
192 for (; inputChannel != lInputDigis->
end(); ++inputChannel) {
193 uint32_t lDetId = inputChannel->detId();
200 unsigned int lNStrips = inputChannel->
size();
203 std::vector<SiStripRawDigi>& pedsDetSetData = pedsData.back().data;
204 pedsDetSetData.reserve(lNStrips);
205 std::vector<SiStripProcessedRawDigi>& noiseDetSetData = noiseData.back().data;
206 noiseDetSetData.reserve(lNStrips);
207 std::vector<SiStripRawDigi>& pedSubtrDetSetData = pedSubtrData.back().data;
208 pedSubtrDetSetData.reserve(lNStrips);
209 std::vector<SiStripRawDigi>& cmSubtrDetSetData = cmSubtrData.back().data;
210 cmSubtrDetSetData.reserve(lNStrips);
218 std::vector<uint32_t> medsDetSetData;
219 medsDetSetData.reserve(lNPairs * 2);
224 uint16_t lFedChannel = 0;
228 lDetId = lConnection.
detId();
244 inputChannel, pedsDetSetData, noiseDetSetData, pedSubtrDetSetData, medsDetSetData,
true);
249 medsData[inputChannel->detId()] = medsDetSetData;
253 if (!zsDetSetData.
empty())
254 zsData.push_back(zsDetSetData);
259 std::unique_ptr<edm::DetSetVector<SiStripProcessedRawDigi> > lNoises(
262 std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > lOutputPedSubtr(
265 std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > lOutputCMSubtr(
268 std::unique_ptr<std::map<uint32_t, std::vector<uint32_t> > > lMedians(
269 new std::map<uint32_t, std::vector<uint32_t> >(medsData));
278 iEvent.
put(
std::move(lOutputPedSubtr),
"PedSubtrDigisOrdered");
279 iEvent.
put(
std::move(lOutputCMSubtr),
"CMSubtrDigisOrdered");
283 iEvent.
put(
std::move(lOutputPedSubtr),
"PedSubtrModuleDigis");
285 iEvent.
put(
std::move(lOutputCMSubtr),
"CMSubtrModuleDigis");
edm::ESWatcher< SiStripNoisesRcd > noisesWatcher_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const SiStripNoises * noises_
void updatePedestals(const SiStripPedestalsRcd &rcd)
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
edm::InputTag spyReorderedDigisTag_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void subtractPedestals(const edm::DetSetVector< SiStripRawDigi >::const_iterator &inputChannel, std::vector< SiStripRawDigi > &pedsDetSetData, std::vector< SiStripProcessedRawDigi > &noiseDetSetData, std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< uint32_t > &medsDetSetData, const bool fillApvsForCM)
#define DEFINE_FWK_MODULE(type)
uint16_t apvPairNumber() const
void produce(edm::Event &, const edm::EventSetup &) override
const SiStripFedCabling * fedCabling_
void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
Log< level::Error, false > LogError
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noisesToken_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyReorderedDigisToken_
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
~FEDEmulatorModule() override
void initialiseModule(const uint32_t aDetId, const uint32_t aNPairs, const uint32_t aPair)
char const * what() const noexceptoverride
void updateFedCabling(const SiStripFedCablingRcd &rcd)
void subtractCM(const std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< SiStripRawDigi > &cmSubtrDetSetData)
void updateNoises(const SiStripNoisesRcd &rcd)
iterator end()
Return the off-the-end iterator.
size_type size() const
Return the number of contained DetSets.
edm::ESWatcher< SiStripPedestalsRcd > pedestalsWatcher_
Log< level::Info, false > LogInfo
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
static const uint16_t STRIPS_PER_FEDCH
void initialise(const bool byModule)
T const * product() const
std::unique_ptr< SiStripRawProcessingAlgorithms > algorithms_
object for zero-suppression
void zeroSuppress(const std::vector< SiStripRawDigi > &cmSubtrDetSetData, edm::DetSet< SiStripDigi > &zsDetSetData, const std::unique_ptr< SiStripRawProcessingAlgorithms > &algorithms)
Constants and enumerated types for FED/FEC systems.
static const char * messageLabel_
const uint16_t & nApvPairs() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
bool check(const edm::EventSetup &iSetup)
edm::InputTag spyVirginRawDigisTag_
iterator begin()
Return an iterator to the first DetSet.
void retrievePedestals(const edm::ESHandle< SiStripPedestals > &aHandle)
Log< level::Warning, false > LogWarning
collection_type::const_iterator const_iterator
FEDEmulatorModule(const edm::ParameterSet &)
sistrip::FEDEmulator fedEmulator_
sistrip::FEDEmulatorModule SiStripFEDEmulatorModule
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalsToken_
edm::ESWatcher< SiStripFedCablingRcd > cablingWatcher_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyVirginRawDigisToken_
const SiStripPedestals * pedestals_