22 for (
auto&& [key, clus_vector] :
m_clusmap)
24 for (
auto&& cluster : clus_vector)
33 std::map<TrkrDefs::hitsetkey, Vector> empty;
34 m_clusmap.swap(empty);
47 os <<
"-----TrkrClusterContainerv4-----" << std::endl;
48 os <<
"Number of clusters: " <<
size() << std::endl;
53 os <<
"layer: " << layer <<
" hitsetkey: " <<
hitsetkey << std::endl;
55 for (
const auto& cluster : clus_vector)
59 cluster->identify(os);
64 os <<
"------------------------------" << std::endl;
78 auto& clus_vector = iter->second;
84 if (
index < clus_vector.size())
87 delete clus_vector[
index];
88 clus_vector[
index] =
nullptr;
106 if (
index < clus_vector.size())
113 if (!clus_vector[
index])
115 clus_vector[
index] = newclus;
119 std::cout <<
"TrkrClusterContainerv4::AddClusterSpecifyKey: duplicate key: " << key <<
" exiting now" << std::endl;
123 else if (
index == clus_vector.size())
126 clus_vector.push_back(newclus);
131 clus_vector.resize(
index + 1,
nullptr);
132 clus_vector[
index] = newclus;
139 std::cout <<
"deprecated function in TrkrClusterContainerv4, user getClusters(TrkrDefs:hitsetkey)"
141 return std::make_pair(dummy_map.begin(), dummy_map.begin());
155 const auto iter =
m_clusmap.find(hitsetkey);
159 const auto&
clusters = iter->second;
184 const auto map_iter =
m_clusmap.find(hitsetkey);
188 const auto& clus_vector = map_iter->second;
194 if (
index < clus_vector.size())
196 return clus_vector[
index];
216 [](
const std::pair<TrkrDefs::hitsetkey, Vector>& pair)
217 {
return pair.first; });
236 begin,
end, std::back_inserter(out),
237 [](
const std::pair<TrkrDefs::hitsetkey, Vector>& pair)
238 {
return pair.first; });
257 begin,
end, std::back_inserter(out),
258 [](
const std::pair<TrkrDefs::hitsetkey, Vector>& pair)
259 {
return pair.first; });
266 unsigned int size = 0;
269 size += std::count_if(clus_vector.begin(), clus_vector.end(), [](
TrkrCluster* cluster)
270 {
return cluster; });