74 std::map<Int_t, CbmEvent*> eventMap;
81 vector<CbmStsTrack> vRTracks_new;
85 vector<SortTracks> Tracks;
87 vector<vector<int>> timeClusters;
88 unsigned int nUsedTracks = 0;
91 for (
unsigned int iTrack = 0; iTrack < nTracks; iTrack++) {
99 structure.
Track = *track;
100 structure.
index = iTrack;
103 if (timeEr > 0 && timeEr == timeEr && time == time) Tracks.push_back(structure);
111 vector<vector<UInt_t>> clusters;
114 while (nUsedTracks < Tracks.size()) {
116 vector<UInt_t> cluster;
119 for (
unsigned int iTrack = 0; iTrack < Tracks.size(); iTrack++)
120 if (!Tracks[iTrack].used) {
121 cluster.push_back(Tracks[iTrack].index);
122 Tracks[iTrack].used =
true;
128 for (
unsigned int iTrack = 0; iTrack < Tracks.size(); iTrack++) {
129 if (Tracks[iTrack].used)
continue;
131 float time1 = Tracks[iTrack].Track.GetStartTime();
132 float timeC1 = Tracks[iTrack].Track.GetStartTimeError();
134 for (
unsigned int iClusterTrack = 0; iClusterTrack < cluster.size(); iClusterTrack++) {
140 float dt = fabs(time1 - time2);
141 float error =
sqrt(timeC1 + timeC2);
143 if ((dt < 4 * error) && (dt < 8.5)) {
144 cluster.push_back(Tracks[iTrack].index);
145 Tracks[iTrack].used =
true;
153 float time_min = 100000000000;
156 for (
unsigned int iClusterTrack = 0; iClusterTrack < cluster.size(); iClusterTrack++) {
161 if (time_max < stsTrack->GetStartTime()) time_max = stsTrack->
GetStartTime();
164 if (cluster.size() > 1) clusters.push_back(cluster);
168 for (
unsigned int iEvent = 0; iEvent < clusters.size(); iEvent++) {
170 Int_t nEvents =
fEvents->GetEntriesFast();
175 event =
new ((*fEvents)[nEvents])
CbmEvent(iEvent);