1 #ifndef __RecoLocalCalo_HGCRecProducers_HGCalLayerClusterProducer_H__
2 #define __RecoLocalCalo_HGCRecProducers_HGCalLayerClusterProducer_H__
51 std::unique_ptr<HGCalClusteringAlgoBase>
algo;
67 timeOffset(ps.getParameter<double>(
"timeOffset")),
97 produces<std::vector<float>>(
"InitialLayerClustersMask");
98 produces<std::vector<reco::BasicCluster>>();
99 produces<std::vector<reco::BasicCluster>>(
"sharing");
103 produces<edm::ValueMap<std::pair<float, float>>>(
timeClname);
114 ->setComment(
"all (does not include HFNose); other options: EE, FH, HFNose; other value defaults to BH");
115 desc.
add<
bool>(
"doSharing",
false);
121 desc.
add<
double>(
"timeOffset", 0.0);
122 desc.
add<
unsigned int>(
"nHitsTime", 3);
123 descriptions.
add(
"hgcalLayerClusters", desc);
132 std::unique_ptr<std::vector<reco::BasicCluster>>
clusters(
new std::vector<reco::BasicCluster>),
133 clusters_sharing(
new std::vector<reco::BasicCluster>);
134 auto density = std::make_unique<Density>();
136 algo->getEventSetup(es);
141 std::unordered_map<uint32_t, const HGCRecHit*> hitmap;
146 algo->populate(*hfnose_hits);
147 for (
auto const& it : *hfnose_hits)
148 hitmap[it.detid().rawId()] = &(it);
152 algo->populate(*ee_hits);
153 for (
auto const& it : *ee_hits)
154 hitmap[it.detid().rawId()] = &(it);
160 algo->populate(*fh_hits);
161 for (
auto const& it : *fh_hits)
162 hitmap[it.detid().rawId()] = &(it);
163 }
else if (bh_hits.
isValid()) {
164 algo->populate(*bh_hits);
169 algo->populate(*ee_hits);
170 for (
auto const& it : *ee_hits) {
171 hitmap[it.detid().rawId()] = &(it);
174 algo->populate(*fh_hits);
175 for (
auto const& it : *fh_hits) {
176 hitmap[it.detid().rawId()] = &(it);
179 algo->populate(*bh_hits);
184 algo->makeClusters();
187 *clusters_sharing =
algo->getClusters(
true);
190 auto clusterHandleSharing = evt.
put(
std::move(clusters_sharing),
"sharing");
198 std::vector<std::pair<float, float>> times;
199 times.
reserve(clusterHandle->size());
201 for (
unsigned i = 0;
i < clusterHandle->size(); ++
i) {
205 std::pair<float, float> timeCl(-99., -1.);
209 std::vector<float> timeClhits;
210 std::vector<float> timeErrorClhits;
214 if (
finder == hitmap.end())
224 timeErrorClhits.push_back(1. / (rhTimeE * rhTimeE));
229 times.push_back(timeCl);
231 std::unique_ptr<std::vector<float>> layerClustersMask(
new std::vector<float>);
232 layerClustersMask->resize(clusterHandle->size(), 1.0);
233 evt.
put(
std::move(layerClustersMask),
"InitialLayerClustersMask");
235 auto timeCl = std::make_unique<edm::ValueMap<std::pair<float, float>>>();
237 filler.insert(clusterHandle, times.begin(), times.end());
242 for (
unsigned i = 0;
i < clusterHandleSharing->size(); ++
i) {