10 std::vector<size_t>
idx(v.
size());
11 for (
size_t i = 0;
i !=
idx.size(); ++
i)
idx[
i] =
i;
14 std::sort(
idx.begin(),
idx.end(),
15 [&
v](
size_t i1,
size_t i2) {
return (*v[i1]) > (*v[i2]);});
28 std::vector<reco::HGCalMultiCluster> thePreClusters;
30 std::vector<int> vused(es.size(),0);
31 unsigned int used = 0;
34 for(
unsigned int i = 0;
i < es.size(); ++
i) {
38 vused[
i]=(thecls[es[
i]]->z()>0)? 1 : -1;
40 for(
unsigned int j = i+1; j < es.size(); ++j) {
42 if( dist2(thecls[es[i]],thecls[es[j]]) < radius2 &&
int(thecls[es[i]]->
z()*vused[i])>0 ) {
50 thePreClusters.push_back(temp);
51 auto& back = thePreClusters.back();
52 back.setPosition(
clusterTools->getMultiClusterPosition(back));
53 back.setEnergy(
clusterTools->getMultiClusterEnergy(back));
60 return thePreClusters;
size_type size() const
Size of the RefVector.
std::vector< reco::HGCalMultiCluster > makePreClusters(const reco::HGCalMultiCluster::ClusterCollection &) const
std::unique_ptr< hgcal::ClusterTools > clusterTools
unsigned int size() const
void push_back(const edm::Ptr< reco::BasicCluster > &b)
std::vector< size_t > sorted_indices(const std::vector< T > &v)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)