9 std::vector<size_t>
idx(
v.size());
10 for (
size_t i = 0;
i !=
idx.size(); ++
i)
26 float tanTheta =
tan(2 * atan(
exp(-1 *
a->eta())));
27 float ax =
b->z() * tanTheta *
cos(
a->phi());
28 float ay =
b->z() * tanTheta *
sin(
a->phi());
29 return (ax -
b->x()) * (ax -
b->x()) + (ay -
b->y()) * (ay -
b->y());
35 std::vector<reco::HGCalMultiCluster> thePreClusters;
37 std::vector<int> vused(es.size(), 0);
38 unsigned int used = 0;
40 for (
unsigned int i = 0;
i < es.size(); ++
i) {
43 temp.push_back(thecls[es[
i]]);
44 vused[
i] = (thecls[es[
i]]->z() > 0) ? 1 : -1;
46 for (
unsigned int j =
i + 1;
j < es.size(); ++
j) {
48 float distanceCheck = 9999.;
50 distanceCheck = distAxisCluster2(thecls[es[
i]], thecls[es[
j]]);
52 distanceCheck = dist2(thecls[es[
i]], thecls[es[
j]]);
53 DetId detid = thecls[es[
j]]->hitsAndFractions()[0].first();
61 if (distanceCheck<radius2 &&
int(thecls[es[
j]]->
z() * vused[
i])> 0) {
62 temp.push_back(thecls[es[
j]]);
69 thePreClusters.push_back(
temp);
70 auto &back = thePreClusters.back();
71 back.setPosition(
clusterTools->getMultiClusterPosition(back));
72 back.setEnergy(
clusterTools->getMultiClusterEnergy(back));
77 return thePreClusters;
Sin< T >::type sin(const T &t)
std::unique_ptr< hgcal::ClusterTools > clusterTools
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
hgcal::RecHitTools rhtools_
Cos< T >::type cos(const T &t)
std::vector< size_t > sorted_indices(const std::vector< T > &v)
Tan< T >::type tan(const T &t)
std::vector< float > radii
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< reco::HGCalMultiCluster > makePreClusters(const reco::HGCalMultiCluster::ClusterCollection &) const