26 std::vector<eflowRecTrack*> tracksToRecover;
27 std::vector<eflowRecCluster*> clustersToConsider;
28 for (
unsigned int iTrack=0; iTrack<eflowTrackContainer->
size(); ++iTrack) {
30 tracksToRecover.push_back(thisEflowRecTrack);
32 for (
unsigned int iCluster = 0; iCluster < eflowClusterContainer->
size(); ++iCluster) {
34 clustersToConsider.push_back(thisEFRecCluster);
45 std::vector<eflowRecTrack*> tracksToConsider; tracksToConsider.clear();
46 unsigned int nTrack = tracksToRecover.size();
47 for (
unsigned int iTrack=0; iTrack<nTrack; ++iTrack) {
50 std::unique_ptr<eflowCaloObject> calob = std::make_unique<eflowCaloObject>();
52 caloObjectContainer->
push_back(std::move(calob));
55 tracksToConsider.push_back(thisEflowRecTrack);
60 unsigned int nClusters = clustersToConsider.size();
61 for (
unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
64 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
65 thisEflowCaloObject->
addCluster(thisEFRecCluster);
66 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
72 if (!tracksToConsider.empty()){
77 std::vector<eflowRecTrack*> trackForNextLoop; trackForNextLoop.clear();
78 std::vector<eflowRecCluster*> clusterForNextLoop; clusterForNextLoop.clear();
81 std::vector<eflowRecTrack*> trackList; trackList.clear();
82 std::vector<eflowRecCluster*> clusterList; clusterList.clear();
85 trackForNextLoop.push_back(tracksToConsider.at(0));
86 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
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());
100 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
101 thisEflowCaloObject->
addTracks(trackList);
104 for(
auto *itr_cluster : clusterList) {
107 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
111 if(tracksToConsider.empty()) {
125 std::vector<int> allClusterId; allClusterId.clear();
126 for(
auto *itr_track : trackForNextLoop) {
127 std::vector<eflowTrackClusterLink*> allLinks = itr_track->getClusterMatches();
128 for(
auto *allLink : allLinks) {
129 int id = allLink->getCluster()->getClusterId();
130 bool notInList(
true);
131 for (
auto *itr_cluster : clusterList) {
132 if (
id == itr_cluster->getClusterId()) {
137 if ((
find(allClusterId.begin(), allClusterId.end(),
id) == allClusterId.end()) && notInList) {
138 allClusterId.push_back(
id);
139 result.push_back(allLink->getCluster());
150 std::vector<int> allTrackId; allTrackId.clear();
151 for(
auto *itr_cluster : clusterForNextLoop) {
152 std::vector<eflowTrackClusterLink*> allLinks = itr_cluster->getTrackMatches();
153 for(
auto *allLink : allLinks) {
154 int id = allLink->getTrack()->getTrackId();
155 bool notInList(
true);
156 for (
auto *itr_track : trackList) {
157 if (
id == itr_track->getTrackId()) {
162 if ((
find(allTrackId.begin(), allTrackId.end(),
id) == allTrackId.end()) && notInList) {
163 allTrackId.push_back(
id);
164 result.push_back(allLink->getTrack());
174 unsigned int nPart =
part.size();
175 for(
unsigned int i=0;
i<nPart; ++
i) {
177 while (itr != total.end()) {
178 if ((*itr)->getTrackId() ==
part.at(
i)->getTrackId()) { total.erase(itr);
break; }