File indexing completed on 2025-12-17 09:20:48
0001 #include "WeightedTrackMap.h"
0002
0003 WeightedTrackMap::WeightedTrackMap (
0004 WeightedTrackMap const& other
0005 ) : PHObject(other), std::map<unsigned int, WeightedTrack*>(other) {
0006 for (auto const& [track_id, weighted_track] : other) {
0007 insert({track_id, dynamic_cast<WeightedTrack*>(weighted_track->CloneMe())});
0008 }
0009 }
0010
0011 WeightedTrackMap&
0012 WeightedTrackMap::operator= (
0013 WeightedTrackMap const& other
0014 ) {
0015 Reset();
0016 for (auto const& [track_id, weighted_track] : other) {
0017 insert({track_id, dynamic_cast<WeightedTrack*>(weighted_track->CloneMe())});
0018 }
0019 return *this;
0020 }
0021
0022 void
0023 WeightedTrackMap::Reset (
0024 ) {
0025 for (auto& [track_id, weighted_track] : *this) {
0026 delete weighted_track;
0027 }
0028 clear();
0029 }
0030
0031 void
0032 WeightedTrackMap::identify (
0033 std::ostream& out
0034 ) const {
0035 out
0036 << "WeightedTrackMap "
0037 << "size: " << size()
0038 << std::endl;
0039 }