23 std::vector<eflowRecTrack*> tracksToRecover;
24 std::vector<eflowRecCluster*> clustersToConsider;
25 for (
unsigned int iTrack=0; iTrack<eflowTrackContainer->
size(); ++iTrack) {
27 tracksToRecover.push_back(thisEflowRecTrack);
29 for (
unsigned int iCluster = 0; iCluster < eflowClusterContainer->
size(); ++iCluster) {
31 clustersToConsider.push_back(thisEFRecCluster);
39 unsigned int result(0);
42 std::vector<eflowRecTrack*> tracksToConsider; tracksToConsider.clear();
43 unsigned int nTrack = tracksToRecover.size();
44 for (
unsigned int iTrack=0; iTrack<nTrack; ++iTrack) {
47 std::unique_ptr<eflowCaloObject> calob = std::make_unique<eflowCaloObject>();
48 calob->addTrack(thisEflowRecTrack);
49 caloObjectContainer->
push_back(std::move(calob));
52 tracksToConsider.push_back(thisEflowRecTrack);
57 unsigned int nClusters = clustersToConsider.size();
58 for (
unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
61 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
62 thisEflowCaloObject->addCluster(thisEFRecCluster);
63 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
69 if (!tracksToConsider.empty()){
74 std::vector<eflowRecTrack*> trackForNextLoop; trackForNextLoop.clear();
75 std::vector<eflowRecCluster*> clusterForNextLoop; clusterForNextLoop.clear();
78 std::vector<eflowRecTrack*> trackList; trackList.clear();
79 std::vector<eflowRecCluster*> clusterList; clusterList.clear();
82 trackForNextLoop.push_back(tracksToConsider.at(0));
83 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
88 clusterForNextLoop =
uniqCluster(trackForNextLoop, clusterList);
89 if(clusterForNextLoop.empty())
break;
90 clusterList.insert(clusterList.end(), clusterForNextLoop.begin(), clusterForNextLoop.end());
91 trackForNextLoop =
uniqTrack(clusterForNextLoop, trackList);
92 if (trackForNextLoop.empty())
break;
93 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
97 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
98 thisEflowCaloObject->addTracks(trackList);
100 thisEflowCaloObject->addClusters(clusterList);
101 for(
auto *itr_cluster : clusterList) {
102 thisEflowCaloObject->addTrackClusterLinks(itr_cluster->getTrackMatches());
104 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
108 if(tracksToConsider.empty()) {
121 std::vector<eflowRecCluster*> result; result.clear();
122 std::vector<int> allClusterId; allClusterId.clear();
123 for(
auto *itr_track : trackForNextLoop) {
124 std::vector<eflowTrackClusterLink*> allLinks = itr_track->getClusterMatches();
125 for(
auto *allLink : allLinks) {
126 int id = allLink->getCluster()->getClusterId();
127 bool notInList(
true);
128 for (
auto *itr_cluster : clusterList) {
129 if (
id == itr_cluster->getClusterId()) {
134 if ((
find(allClusterId.begin(), allClusterId.end(),
id) == allClusterId.end()) && notInList) {
135 allClusterId.push_back(
id);
136 result.push_back(allLink->getCluster());
146 std::vector<eflowRecTrack*> result; result.clear();
147 std::vector<int> allTrackId; allTrackId.clear();
148 for(
auto *itr_cluster : clusterForNextLoop) {
149 std::vector<eflowTrackClusterLink*> allLinks = itr_cluster->getTrackMatches();
150 for(
auto *allLink : allLinks) {
151 int id = allLink->getTrack()->getTrackId();
152 bool notInList(
true);
153 for (
auto *itr_track : trackList) {
154 if (
id == itr_track->getTrackId()) {
159 if ((
find(allTrackId.begin(), allTrackId.end(),
id) == allTrackId.end()) && notInList) {
160 allTrackId.push_back(
id);
161 result.push_back(allLink->getTrack());