2 #include <unordered_map> 45 hgcalOnly_(ps.getParameter<
bool>(
"hgcalOnly")) {
46 produces<DetIdRecHitMap>(
"hgcalRecHitMap");
48 produces<DetIdRecHitMap>(
"barrelRecHitMap");
59 desc.add<
bool>(
"hgcalOnly",
true);
60 descriptions.
add(
"recHitMapProducer",
desc);
64 auto hitMapHGCal = std::make_unique<DetIdRecHitMap>();
69 for (
unsigned int i = 0;
i < ee_hits.size(); ++
i) {
70 hitMapHGCal->emplace(ee_hits[
i].detid(),
i);
72 auto size = ee_hits.size();
74 for (
unsigned int i = 0;
i < fh_hits.size(); ++
i) {
75 hitMapHGCal->emplace(fh_hits[
i].detid(),
i +
size);
77 size += fh_hits.size();
79 for (
unsigned int i = 0;
i < bh_hits.size(); ++
i) {
80 hitMapHGCal->emplace(bh_hits[
i].detid(),
i +
size);
86 auto hitMapBarrel = std::make_unique<DetIdRecHitMap>();
92 for (
unsigned int i = 0;
i < eb_hits.size(); ++
i) {
93 hitMapBarrel->emplace(eb_hits[
i].
detId(),
i);
95 size += eb_hits.size();
97 for (
unsigned int i = 0;
i < hb_hits.size(); ++
i) {
98 hitMapBarrel->emplace(hb_hits[
i].
detId(),
i +
size);
100 size += hb_hits.size();
102 for (
unsigned int i = 0;
i < ho_hits.size(); ++
i) {
103 hitMapBarrel->emplace(ho_hits[
i].
detId(),
i +
size);
std::unordered_map< DetId, const unsigned int > DetIdRecHitMap
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::PFRecHitCollection > hits_ho_token_
bool get(ProductID const &oid, Handle< PROD > &result) const
RecHitMapProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
const edm::EDGetTokenT< reco::PFRecHitCollection > hits_hb_token_
const edm::EDGetTokenT< reco::PFRecHitCollection > hits_eb_token_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
const edm::EDGetTokenT< HGCRecHitCollection > hits_bh_token_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< HGCRecHitCollection > hits_ee_token_