41 {
43
44
45 std::vector<eflowRecTrack*> tracksToConsider; tracksToConsider.clear();
46 unsigned int nTrack = tracksToRecover.size();
47 for (unsigned int iTrack=0; iTrack<nTrack; ++iTrack) {
48 eflowRecTrack *thisEflowRecTrack = static_cast<eflowRecTrack*>(tracksToRecover.at(iTrack));
50 std::unique_ptr<eflowCaloObject> calob = std::make_unique<eflowCaloObject>();
51 calob->addTrack(thisEflowRecTrack);
52 caloObjectContainer->
push_back(std::move(calob));
54 } else {
55 tracksToConsider.push_back(thisEflowRecTrack);
56 }
57 }
58
59
60 unsigned int nClusters = clustersToConsider.size();
61 for (unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
62 eflowRecCluster* thisEFRecCluster = clustersToConsider.at(iCluster);
64 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
65 thisEflowCaloObject->addCluster(thisEFRecCluster);
66 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
68 }
69 }
70
71
72 if (!tracksToConsider.empty()){
73
74
75 do {
76
77 std::vector<eflowRecTrack*> trackForNextLoop; trackForNextLoop.clear();
78 std::vector<eflowRecCluster*> clusterForNextLoop; clusterForNextLoop.clear();
79
80
81 std::vector<eflowRecTrack*> trackList; trackList.clear();
82 std::vector<eflowRecCluster*> clusterList; clusterList.clear();
83
84
85 trackForNextLoop.push_back(tracksToConsider.at(0));
86 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
87
89
90 do {
91 clusterForNextLoop =
uniqCluster(trackForNextLoop, clusterList);
92 if(clusterForNextLoop.empty()) break;
93 clusterList.insert(clusterList.end(), clusterForNextLoop.begin(), clusterForNextLoop.end());
94 trackForNextLoop =
uniqTrack(clusterForNextLoop, trackList);
95 if (trackForNextLoop.empty()) break;
96 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
97 } while (++time);
98
99
100 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
101 thisEflowCaloObject->addTracks(trackList);
102
103 thisEflowCaloObject->addClusters(clusterList);
104 for(auto *itr_cluster : clusterList) {
105 thisEflowCaloObject->addTrackClusterLinks(itr_cluster->getTrackMatches());
106 }
107 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
108
109
111 if(tracksToConsider.empty()) {
113 break;
114 }
115
116 } while (++result);
117 }
118
119
121}
value_type push_back(value_type pElem)
Add an element to the end of the collection.
static void updateTracksToConsider(std::vector< eflowRecTrack * > &total, const std::vector< eflowRecTrack * > &part)
static std::vector< eflowRecCluster * > uniqCluster(const std::vector< eflowRecTrack * > &trackForNextLoop, const std::vector< eflowRecCluster * > &clusterList)
static std::vector< eflowRecTrack * > uniqTrack(const std::vector< eflowRecCluster * > &clusterForNextLoop, const std::vector< eflowRecTrack * > &trackList)
const std::vector< eflowTrackClusterLink * > & getTrackMatches() const
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
time(flags, cells_name, *args, **kw)