10 std::vector<Gep::Cluster> clusters;
13 std::vector<unsigned int> seenSeedCells;
14 for (
auto const& cell_itr : *caloCellsMap) {
17 if (!
isSeedCell(cell_itr.second, seenSeedCells))
continue;
20 const std::vector<Gep::GepCaloCell> & cluster_cells =
clusterFromCells(cell_itr.second, caloCellsMap, seenSeedCells);
25 std::sort(clusters.begin(), clusters.end(),[](
const auto &c1,
const auto &c2) {return c1.et() > c2.et();});
63 const pGepCellMap& caloCellsMap, std::vector<unsigned int> &seenSeedCells)
const {
65 std::vector<Gep::GepCaloCell> v_clusterCells;
67 std::vector<Gep::GepCaloCell> cellsNextLayer, cellsThisLayer;
68 std::vector<unsigned int> seenCells;
71 v_clusterCells.push_back(seed);
72 cellsNextLayer.push_back(seed);
73 seenCells.push_back(seed.id);
74 seenSeedCells.push_back(seed.id);
78 while (!cellsNextLayer.empty() && i_shell <=
m_max_shells) {
80 cellsThisLayer.swap(cellsNextLayer);
81 cellsNextLayer.clear();
85 for (
unsigned int i_cell = 0; i_cell < cellsThisLayer.size(); ++i_cell) {
88 for (
unsigned int i_neighbour = 0; i_neighbour < (cellsThisLayer[i_cell]).neighbours.size(); ++i_neighbour) {
91 auto const& nghbr_itr = caloCellsMap->find((cellsThisLayer[i_cell]).neighbours[i_neighbour]);
92 if (nghbr_itr == caloCellsMap->end())
continue;
108 seenCells.push_back(neighbour.
id);
109 cellsNextLayer.push_back(neighbour);
110 v_clusterCells.push_back(neighbour);
116 cellsThisLayer.clear();
119 return v_clusterCells;
126 std::vector<unsigned int> v_cellIDs;
128 TLorentzVector tlv_cluster;
129 for (
unsigned int i_cell = 0; i_cell < cells.size(); ++i_cell) {
131 cell.SetPtEtaPhiE(cells[i_cell].
et, cells[i_cell].
eta, cells[i_cell].
phi, cells[i_cell].
et*std::cosh(cells[i_cell].
eta));
135 v_cellIDs.push_back(cells[i_cell].
id);
138 cluster.
ncells = cells.size();
139 cluster.
time = cells[0].time;
140 cluster.
cell_id = std::move(v_cellIDs);
141 cluster.
setEtEtaPhi(tlv_cluster.Et(), tlv_cluster.Eta(), tlv_cluster.Phi());