86 : ecalReadoutToolsESGetTokens_{iConfig, consumesCollector()} {
88 region_ = stringToRegion(iConfig.getParameter<
std::string>(
"region"));
92 digisOut_ = iConfig.getParameter<
std::string>(
"digisOut");
98 srFlagsIn_ = iConfig.getParameter<
edm::InputTag>(
"srFlagsIn");
99 srFlagsOut_ = iConfig.getParameter<
std::string>(
"srFlagsOut");
104 digisEBInToken_ = consumes<EBDigiCollection>(digisIn_);
105 produces<EBDigiCollection>(digisOut_);
107 if (not srFlagsIn_.
label().empty()) {
108 srFlagsEBInToken_ = consumes<EBSrFlagCollection>(srFlagsIn_);
109 produces<EBSrFlagCollection>(srFlagsOut_);
113 digisEEInToken_ = consumes<EEDigiCollection>(digisIn_);
114 produces<EEDigiCollection>(digisOut_);
116 if (not srFlagsIn_.
label().empty()) {
117 srFlagsEEInToken_ = consumes<EESrFlagCollection>(srFlagsIn_);
118 produces<EESrFlagCollection>(srFlagsOut_);
125 recHitsToken_ = consumes<EcalRecHitCollection>(recHits_);
139 else if (
region ==
"endcap")
153 std::unique_ptr<EBDigiCollection> outputEBDigiCollection(
new EBDigiCollection);
154 std::unique_ptr<EEDigiCollection> outputEEDigiCollection(
new EEDigiCollection);
179 srFlagsEB = srFlagsEBHandle.
product();
185 for (ituneEB = recHitsHandle->
begin(); ituneEB != recHitsHandle->
end(); ituneEB++) {
189 if (digiLookUp == digisEB->
end())
191 outputEBDigiCollection->push_back(digiLookUp->id(), digiLookUp->begin());
199 if (outputEBSrFlagCollection->find(
ttId) != outputEBSrFlagCollection->end())
201 srFlagLookUp = srFlagsEB->
find(
ttId);
203 if (srFlagLookUp == srFlagsEB->
end())
205 outputEBSrFlagCollection->push_back(*srFlagLookUp);
223 srFlagsEE = srFlagsEEHandle.
product();
229 for (ituneEE = recHitsHandle->
begin(); ituneEE != recHitsHandle->
end(); ituneEE++) {
233 if (digiLookUp == digisEE->
end())
235 outputEEDigiCollection->push_back(digiLookUp->id(), digiLookUp->begin());
243 if (outputEESrFlagCollection->find(scId) != outputEESrFlagCollection->end())
245 srFlagLookUp = srFlagsEE->
find(scId);
247 if (srFlagLookUp == srFlagsEE->
end())
249 outputEESrFlagCollection->push_back(*srFlagLookUp);
304 ->setComment(
"Region of rechits to save Digis for. Allowed values: barrel or endcap.");
306 ->setComment(
"The collection of either barrel or endcap digis which correspond to the rechit collection");
307 desc.add<
std::string>(
"digisOut",
"pi0EBDigis")->setComment(
"Name for the collection of Digis saved by the module");
309 ->setComment(
"Collection of rechits to match Digis to");
311 ->setComment(
"The collection of either barrel or endcap srFlags which correspond to the rechit collection");
313 ->setComment(
"Name for the collection of SrFlags saved by the module");
314 descriptions.
add(
"hltFindMatchingECALDigisToRechits",
desc);