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);
edm::EDGetTokenT< EBSrFlagCollection > srFlagsEBInToken_
edm::EDGetTokenT< EESrFlagCollection > srFlagsEEInToken_
#define DEFINE_FWK_MODULE(type)
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
~HLTRechitsToDigis() override
edm::EDGetTokenT< EEDigiCollection > digisEEInToken_
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
void produce(edm::Event &, edm::EventSetup const &) override
EcalReadoutTools::ESGetTokens const ecalReadoutToolsESGetTokens_
HLTRechitsToDigis(const edm::ParameterSet &)
static const HLTRechitsToDigis::ecalRegion stringToRegion(const std::string ®ion)
edm::EDGetTokenT< EcalRecHitCollection > recHitsToken_
const_iterator begin() const
const_iterator end() const
const_iterator end() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
iterator find(key_type k)
const_iterator find(id_type i) const
edm::EDGetTokenT< EBDigiCollection > digisEBInToken_