122 int32_t nTracklets = *NTracklets();
123 if (nTracklets < 0) {
126 out <<
"\nTracklets: (Sector" << mISector <<
") (" << nTracklets <<
")" << std::endl;
127 std::vector<int32_t> Ids(nTracklets);
128 std::iota(Ids.begin(), Ids.end(), 0);
130 std::sort(Ids.begin(), Ids.end(), [
this](
const int32_t&
a,
const int32_t&
b) {
131 if (this->Tracklets()[a].FirstRow() != this->Tracklets()[b].FirstRow()) {
132 return this->Tracklets()[a].FirstRow() > this->Tracklets()[b].FirstRow();
134 if (this->Tracklets()[
a].LastRow() != this->Tracklets()[
b].LastRow()) {
135 return this->Tracklets()[
a].LastRow() > this->Tracklets()[
b].LastRow();
137 if (this->Tracklets()[
a].
Param().Y() != this->Tracklets()[
b].
Param().Y()) {
138 return this->Tracklets()[
a].Param().Y() > this->Tracklets()[
b].Param().Y();
140 return this->Tracklets()[
a].Param().Z() > this->Tracklets()[
b].Param().Z();
143 for (int32_t jj = 0; jj < nTracklets; jj++) {
144 const int32_t
j = Ids[jj];
145 const auto& tracklet = Tracklets()[
j];
146 out <<
"Tracklet " << std::setw(4) << jj <<
" (Rows: " << Tracklets()[
j].FirstRow() <<
" - " << tracklet.LastRow() <<
", Weight " << Tracklets()[
j].HitWeight() <<
") ";
148 GPUError(
"Error: Tracklet %d First %d Last %d",
j, tracklet.FirstRow(), tracklet.LastRow());
149 out <<
" (Error: Tracklet " <<
j <<
" First " << tracklet.FirstRow() <<
" Last " << tracklet.LastRow() <<
") ";
152 out <<
i <<
"-" << mTrackletRowHits[tracklet.FirstHit() + (
i - tracklet.FirstRow())] <<
", ";
154 }
else if (tracklet.LastRow() >= tracklet.FirstRow()) {
155 for (int32_t
i = tracklet.FirstRow();
i <= tracklet.LastRow();
i++) {
156 out <<
i <<
"-" << mTrackletRowHits[tracklet.FirstHit() + (
i - tracklet.FirstRow())] <<
", ";