106 produces<std::map<uint32_t, std::vector<uint32_t> > >(
"Medians");
107 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedestalsOrdered");
108 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"NoisesOrdered");
109 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrDigisOrdered");
110 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrDigisOrdered");
112 produces<edm::DetSetVector<SiStripRawDigi> >(
"ModulePedestals");
113 produces<edm::DetSetVector<SiStripProcessedRawDigi> >(
"ModuleNoises");
114 produces<edm::DetSetVector<SiStripRawDigi> >(
"PedSubtrModuleDigis");
115 produces<std::map<uint32_t, std::vector<uint32_t> > >(
"ModuleMedians");
116 produces<edm::DetSetVector<SiStripRawDigi> >(
"CMSubtrModuleDigis");
117 produces<edm::DetSetVector<SiStripDigi> >(
"ZSModuleDigis");
149 unsigned int lNDigis = lInputDigis->
size();
153 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> pedsData;
154 pedsData.reserve(lNDigis);
155 std::vector<edm::DetSetVector<SiStripProcessedRawDigi>::detset> noiseData;
156 noiseData.reserve(lNDigis);
157 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> pedSubtrData;
158 pedSubtrData.reserve(lNDigis);
159 std::vector<edm::DetSetVector<SiStripRawDigi>::detset> cmSubtrData;
160 cmSubtrData.reserve(lNDigis);
162 std::vector<edm::DetSet<SiStripDigi> > zsData;
165 std::map<uint32_t, std::vector<uint32_t> > medsData;
169 for (; inputChannel != lInputDigis->
end(); ++inputChannel) {
170 uint32_t lDetId = inputChannel->detId();
177 unsigned int lNStrips = inputChannel->
size();
180 std::vector<SiStripRawDigi>& pedsDetSetData = pedsData.back().data;
181 pedsDetSetData.reserve(lNStrips);
182 std::vector<SiStripProcessedRawDigi>& noiseDetSetData = noiseData.back().data;
183 noiseDetSetData.reserve(lNStrips);
184 std::vector<SiStripRawDigi>& pedSubtrDetSetData = pedSubtrData.back().data;
185 pedSubtrDetSetData.reserve(lNStrips);
186 std::vector<SiStripRawDigi>& cmSubtrDetSetData = cmSubtrData.back().data;
187 cmSubtrDetSetData.reserve(lNStrips);
195 std::vector<uint32_t> medsDetSetData;
196 medsDetSetData.reserve(lNPairs * 2);
201 uint16_t lFedChannel = 0;
205 lDetId = lConnection.
detId();
221 inputChannel, pedsDetSetData, noiseDetSetData, pedSubtrDetSetData, medsDetSetData,
true);
226 medsData[inputChannel->detId()] = medsDetSetData;
230 if (!zsDetSetData.
empty())
231 zsData.push_back(zsDetSetData);
236 std::unique_ptr<edm::DetSetVector<SiStripProcessedRawDigi> > lNoises(
239 std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > lOutputPedSubtr(
242 std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > lOutputCMSubtr(
245 std::unique_ptr<std::map<uint32_t, std::vector<uint32_t> > > lMedians(
246 new std::map<uint32_t, std::vector<uint32_t> >(medsData));
255 iEvent.
put(
std::move(lOutputPedSubtr),
"PedSubtrDigisOrdered");
256 iEvent.
put(
std::move(lOutputCMSubtr),
"CMSubtrDigisOrdered");
260 iEvent.
put(
std::move(lOutputPedSubtr),
"PedSubtrModuleDigis");
262 iEvent.
put(
std::move(lOutputCMSubtr),
"CMSubtrModuleDigis");
static void fedIndex(uint32_t aFedIndex, uint16_t &aFedId, uint16_t &aFedChannel)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
def create(alignables, pedeDump, additionalData, outputFile, config)
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)
edm::ESHandle< SiStripNoises > getNoiseHandle(const edm::EventSetup &eventSetup)
uint16_t apvPairNumber() const
void produce(edm::Event &, const edm::EventSetup &) override
edm::ESHandle< SiStripPedestals > getPedestalHandle(const edm::EventSetup &eventSetup)
char const * what() const override
void retrieveNoises(const edm::ESHandle< SiStripNoises > &aHandle)
#define DEFINE_FWK_MODULE(type)
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)
void subtractCM(const std::vector< SiStripRawDigi > &pedSubtrDetSetData, std::vector< SiStripRawDigi > &cmSubtrDetSetData)
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)
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 SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
const uint16_t & nApvPairs() 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
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyVirginRawDigisToken_