38 {
40
41
42 std::vector<eflowRecTrack*> tracksToConsider; tracksToConsider.clear();
43 unsigned int nTrack = tracksToRecover.size();
44 for (unsigned int iTrack=0; iTrack<nTrack; ++iTrack) {
45 eflowRecTrack *thisEflowRecTrack = static_cast<eflowRecTrack*>(tracksToRecover.at(iTrack));
47 std::unique_ptr<eflowCaloObject> calob = std::make_unique<eflowCaloObject>();
48 calob->addTrack(thisEflowRecTrack);
49 caloObjectContainer->
push_back(std::move(calob));
51 } else {
52 tracksToConsider.push_back(thisEflowRecTrack);
53 }
54 }
55
56
57 unsigned int nClusters = clustersToConsider.size();
58 for (unsigned int iCluster = 0; iCluster < nClusters; ++iCluster) {
59 eflowRecCluster* thisEFRecCluster = clustersToConsider.at(iCluster);
61 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
62 thisEflowCaloObject->addCluster(thisEFRecCluster);
63 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
65 }
66 }
67
68
69 if (!tracksToConsider.empty()){
70
71
72 do {
73
74 std::vector<eflowRecTrack*> trackForNextLoop; trackForNextLoop.clear();
75 std::vector<eflowRecCluster*> clusterForNextLoop; clusterForNextLoop.clear();
76
77
78 std::vector<eflowRecTrack*> trackList; trackList.clear();
79 std::vector<eflowRecCluster*> clusterList; clusterList.clear();
80
81
82 trackForNextLoop.push_back(tracksToConsider.at(0));
83 trackList.insert(trackList.end(), trackForNextLoop.begin(), trackForNextLoop.end());
84
86
87 do {
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());
94 } while (++time);
95
96
97 std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
98 thisEflowCaloObject->addTracks(trackList);
99
100 thisEflowCaloObject->addClusters(clusterList);
101 for(auto *itr_cluster : clusterList) {
102 thisEflowCaloObject->addTrackClusterLinks(itr_cluster->getTrackMatches());
103 }
104 caloObjectContainer->
push_back(std::move(thisEflowCaloObject));
105
106
108 if(tracksToConsider.empty()) {
110 break;
111 }
112
113 } while (++result);
114 }
115
116
118}
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)