99 spyReorderedDigisTag_(iConfig.getParameter<edm::InputTag>(
"SpyReorderedDigisTag")),
100 spyVirginRawDigisTag_(iConfig.getParameter<edm::InputTag>(
"SpyVirginRawDigisTag")),
101 byModule_(iConfig.getParameter<bool>(
"ByModule")),
109 produces<std::map<uint32_t,std::vector<uint32_t> > >(
"Medians");
110 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedestalsOrdered");
111 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"NoisesOrdered");
112 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrDigisOrdered");
113 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrDigisOrdered");
116 produces<edm::DetSetVector<SiStripRawDigi> >(
"ModulePedestals");
117 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"ModuleNoises");
118 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrModuleDigis");
119 produces<std::map<uint32_t,std::vector<uint32_t> > >(
"ModuleMedians");
120 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrModuleDigis");
121 produces<edm::DetSetVector<SiStripDigi> >(
"ZSModuleDigis");
158 unsigned int lNDigis = lInputDigis->
size();
162 std::vector<edm::DetSetVector<SiStripRawDigi>::detset > pedsData;
163 pedsData.reserve(lNDigis);
164 std::vector<edm::DetSetVector<SiStripProcessedRawDigi>::detset > noiseData;
165 noiseData.reserve(lNDigis);
166 std::vector<edm::DetSetVector<SiStripRawDigi>::detset > pedSubtrData;
167 pedSubtrData.reserve(lNDigis);
168 std::vector<edm::DetSetVector<SiStripRawDigi>::detset > cmSubtrData;
169 cmSubtrData.reserve(lNDigis);
171 std::vector< edm::DetSet<SiStripDigi> > zsData;
174 std::map<uint32_t,std::vector<uint32_t> > medsData;
178 for ( ; inputChannel!=lInputDigis->
end(); ++inputChannel){
179 uint32_t lDetId = inputChannel->detId();
186 unsigned int lNStrips = inputChannel->
size();
189 std::vector<SiStripRawDigi>& pedsDetSetData = pedsData.back().data;
190 pedsDetSetData.reserve(lNStrips);
191 std::vector<SiStripProcessedRawDigi>& noiseDetSetData = noiseData.back().data;
192 noiseDetSetData.reserve(lNStrips);
193 std::vector<SiStripRawDigi>& pedSubtrDetSetData = pedSubtrData.back().data;
194 pedSubtrDetSetData.reserve(lNStrips);
195 std::vector<SiStripRawDigi>& cmSubtrDetSetData = cmSubtrData.back().data;
196 cmSubtrDetSetData.reserve(lNStrips);
204 std::vector<uint32_t> medsDetSetData;
205 medsDetSetData.reserve(lNPairs*2);
210 uint16_t lFedChannel = 0;
214 lDetId = lConnection.
detId();
239 medsData[inputChannel->detId()] = medsDetSetData;
243 if (zsDetSetData.
size()) zsData.push_back( zsDetSetData );
255 std::auto_ptr<std::map<uint32_t,std::vector<uint32_t> > > lMedians(
new std::map<uint32_t,std::vector<uint32_t> >(medsData));
261 iEvent.
put(lMedians,
"Medians");
262 iEvent.
put(lPeds,
"PedestalsOrdered");
263 iEvent.
put(lNoises,
"NoisesOrdered");
264 iEvent.
put(lOutputPedSubtr,
"PedSubtrDigisOrdered");
265 iEvent.
put(lOutputCMSubtr,
"CMSubtrDigisOrdered");
268 iEvent.
put(lPeds,
"ModulePedestals");
269 iEvent.
put(lNoises,
"ModuleNoises");
270 iEvent.
put(lOutputPedSubtr,
"PedSubtrModuleDigis");
271 iEvent.
put(lMedians,
"ModuleMedians");
272 iEvent.
put(lOutputCMSubtr,
"CMSubtrModuleDigis");
273 iEvent.
put(lOutputZS,
"ZSModuleDigis");
void zeroSuppress(const std::vector< SiStripRawDigi > &cmSubtrDetSetData, edm::DetSet< SiStripDigi > &zsDetSetData, const std::auto_ptr< SiStripRawProcessingAlgorithms > &algorithms)
virtual char const * what() const
static void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
edm::InputTag spyReorderedDigisTag_
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)
edm::ESHandle< SiStripNoises > getNoiseHandle(const edm::EventSetup &eventSetup)
uint16_t apvPairNumber() const
std::auto_ptr< SiStripRawProcessingAlgorithms > algorithms_
object for zero-suppression
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::ESHandle< SiStripPedestals > getPedestalHandle(const edm::EventSetup &eventSetup)
const FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
const uint32_t & detId() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Class containning control, module, detector and connection information, at the level of a FED channel...
void initialiseModule(const uint32_t aDetId, const uint32_t aNPairs, const uint32_t aPair)
void subtractCM(const std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< SiStripRawDigi > &cmSubtrDetSetData)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
size_type size() const
Return the number of contained DetSets.
static const uint16_t STRIPS_PER_FEDCH
void initialise(const bool byModule)
Constants and enumerated types for FED/FEC systems.
static const char * messageLabel_
const SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
const uint16_t & nApvPairs() const
T const * product() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
edm::InputTag spyVirginRawDigisTag_
iterator begin()
Return an iterator to the first DetSet.
void retrievePedestals(const edm::ESHandle< SiStripPedestals > &aHandle)
collection_type::const_iterator const_iterator
FEDEmulatorModule(const edm::ParameterSet &)
sistrip::FEDEmulator fedEmulator_
sistrip::FEDEmulatorModule SiStripFEDEmulatorModule