133 std::unique_ptr<std::vector<reco::BasicCluster>>
clusters(
new std::vector<reco::BasicCluster>),
134 clusters_sharing(
new std::vector<reco::BasicCluster>);
135 auto density = std::make_unique<Density>();
137 algo->getEventSetup(es);
142 std::unordered_map<uint32_t, const HGCRecHit*> hitmap;
147 algo->populate(*hfnose_hits);
148 for (
auto const& it : *hfnose_hits)
149 hitmap[it.detid().rawId()] = &(it);
153 algo->populate(*ee_hits);
154 for (
auto const& it : *ee_hits)
155 hitmap[it.detid().rawId()] = &(it);
161 algo->populate(*fh_hits);
162 for (
auto const& it : *fh_hits)
163 hitmap[it.detid().rawId()] = &(it);
164 }
else if (bh_hits.
isValid()) {
165 algo->populate(*bh_hits);
170 algo->populate(*ee_hits);
171 for (
auto const& it : *ee_hits) {
172 hitmap[it.detid().rawId()] = &(it);
175 algo->populate(*fh_hits);
176 for (
auto const& it : *fh_hits) {
177 hitmap[it.detid().rawId()] = &(it);
180 algo->populate(*bh_hits);
185 algo->makeClusters();
188 *clusters_sharing =
algo->getClusters(
true);
191 auto clusterHandleSharing = evt.
put(
std::move(clusters_sharing),
"sharing");
199 std::vector<std::pair<float, float>> times;
200 times.
reserve(clusterHandle->size());
202 for (
unsigned i = 0;
i < clusterHandle->size(); ++
i) {
206 std::pair<float, float> timeCl(-99., -1.);
210 std::vector<float> timeClhits;
211 std::vector<float> timeErrorClhits;
215 if (
finder == hitmap.end())
224 timeClhits.push_back(rechit->
time());
225 timeErrorClhits.push_back(1. / (rhTimeE * rhTimeE));
230 times.push_back(timeCl);
232 std::unique_ptr<std::vector<float>> layerClustersMask(
new std::vector<float>);
233 layerClustersMask->resize(clusterHandle->size(), 1.0);
234 evt.
put(
std::move(layerClustersMask),
"InitialLayerClustersMask");
236 auto timeCl = std::make_unique<edm::ValueMap<std::pair<float, float>>>();
238 filler.insert(clusterHandle, times.begin(), times.end());
243 for (
unsigned i = 0;
i < clusterHandleSharing->size(); ++
i) {
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
reco::CaloCluster::AlgoId algoId
void push_back(Ptr< T > const &iPtr)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< HGCRecHitCollection > hits_hfnose_token
std::unique_ptr< HGCalClusteringAlgoBase > algo
edm::EDGetTokenT< HGCRecHitCollection > hits_bh_token
std::pair< float, float > fixSizeHighestDensity(std::vector< float > &time, std::vector< float > weight=std::vector< float >(), unsigned int minNhits=3, float deltaT=0.210, float timeWidthBy=0.5)
size_t size() const
size in number of hits (e.g. in crystals for ECAL)
edm::EDGetTokenT< HGCRecHitCollection > hits_ee_token
constexpr float time() const
void reserve(size_type n)
Reserve space for RefVector.
edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token