85 : ecalReadoutToolsESGetTokens_{iConfig, consumesCollector()} {
87 region_ = stringToRegion(iConfig.getParameter<
std::string>(
"region"));
91 digisOut_ = iConfig.getParameter<
std::string>(
"digisOut");
97 srFlagsIn_ = iConfig.getParameter<
edm::InputTag>(
"srFlagsIn");
98 srFlagsOut_ = iConfig.getParameter<
std::string>(
"srFlagsOut");
103 digisEBInToken_ = consumes<EBDigiCollection>(digisIn_);
104 produces<EBDigiCollection>(digisOut_);
106 if (not srFlagsIn_.
label().empty()) {
107 srFlagsEBInToken_ = consumes<EBSrFlagCollection>(srFlagsIn_);
108 produces<EBSrFlagCollection>(srFlagsOut_);
112 digisEEInToken_ = consumes<EEDigiCollection>(digisIn_);
113 produces<EEDigiCollection>(digisOut_);
115 if (not srFlagsIn_.
label().empty()) {
116 srFlagsEEInToken_ = consumes<EESrFlagCollection>(srFlagsIn_);
117 produces<EESrFlagCollection>(srFlagsOut_);
124 recHitsToken_ = consumes<EcalRecHitCollection>(recHits_);
133 else if (
region ==
"endcap")
147 std::unique_ptr<EBDigiCollection> outputEBDigiCollection(
new EBDigiCollection);
148 std::unique_ptr<EEDigiCollection> outputEEDigiCollection(
new EEDigiCollection);
173 srFlagsEB = srFlagsEBHandle.
product();
179 for (ituneEB = recHitsHandle->
begin(); ituneEB != recHitsHandle->
end(); ituneEB++) {
183 if (digiLookUp == digisEB->
end())
185 outputEBDigiCollection->push_back(digiLookUp->id(), digiLookUp->begin());
193 if (outputEBSrFlagCollection->find(
ttId) != outputEBSrFlagCollection->end())
195 srFlagLookUp = srFlagsEB->
find(
ttId);
197 if (srFlagLookUp == srFlagsEB->
end())
199 outputEBSrFlagCollection->push_back(*srFlagLookUp);
217 srFlagsEE = srFlagsEEHandle.
product();
223 for (ituneEE = recHitsHandle->
begin(); ituneEE != recHitsHandle->
end(); ituneEE++) {
227 if (digiLookUp == digisEE->
end())
229 outputEEDigiCollection->push_back(digiLookUp->id(), digiLookUp->begin());
237 if (outputEESrFlagCollection->find(scId) != outputEESrFlagCollection->end())
239 srFlagLookUp = srFlagsEE->
find(scId);
241 if (srFlagLookUp == srFlagsEE->
end())
243 outputEESrFlagCollection->push_back(*srFlagLookUp);
266 ->setComment(
"Region of rechits to save Digis for. Allowed values: barrel or endcap.");
268 ->setComment(
"The collection of either barrel or endcap digis which correspond to the rechit collection");
269 desc.add<
std::string>(
"digisOut",
"pi0EBDigis")->setComment(
"Name for the collection of Digis saved by the module");
271 ->setComment(
"Collection of rechits to match Digis to");
273 ->setComment(
"The collection of either barrel or endcap srFlags which correspond to the rechit collection");
275 ->setComment(
"Name for the collection of SrFlags saved by the module");
276 descriptions.
add(
"hltFindMatchingECALDigisToRechits",
desc);
edm::EDGetTokenT< EBSrFlagCollection > srFlagsEBInToken_
edm::EDGetTokenT< EESrFlagCollection > srFlagsEEInToken_
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
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_
#define DEFINE_FWK_MODULE(type)
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_