File indexing completed on 2026-08-31 08:21:22
0001 #include "Tpc_PolyClusterContainerv1.h"
0002 #include "Tpc_PolyCluster.h"
0003
0004 Tpc_PolyClusterContainerv1::Tpc_PolyClusterContainerv1()
0005 {
0006 Reset();
0007 }
0008
0009 Tpc_PolyClusterContainerv1::~Tpc_PolyClusterContainerv1()
0010 {
0011 Reset();
0012 }
0013
0014 void Tpc_PolyClusterContainerv1::identify(std::ostream& os) const
0015 {
0016 os << "Tpc_PolyClusterContainerv1 with " << m_clusters.size() << " clusters" << std::endl;
0017 }
0018
0019 void Tpc_PolyClusterContainerv1::Reset()
0020 {
0021 for (auto& m_cluster : m_clusters)
0022 {
0023 delete m_cluster;
0024 }
0025 m_clusters.clear();
0026 }
0027
0028 int Tpc_PolyClusterContainerv1::isValid() const
0029 {
0030 return m_clusters.empty() ? 0 : 1;
0031 }
0032
0033 PHObject* Tpc_PolyClusterContainerv1::CloneMe() const
0034 {
0035 Tpc_PolyClusterContainerv1* copy = new Tpc_PolyClusterContainerv1();
0036 for (auto* m_cluster : m_clusters)
0037 {
0038 if (m_cluster)
0039 {
0040 copy->m_clusters.push_back(static_cast<Tpc_PolyCluster*>(m_cluster->CloneMe()));
0041 }
0042 }
0043 return copy;
0044 }