@@ -74,7 +74,7 @@ void GPUTPCClusterFinder::DumpSuppressedPeaks(std::ostream& out)
7474
7575void GPUTPCClusterFinder::DumpSuppressedPeaksCompacted (std::ostream& out)
7676{
77- out << " Clusterer - Noise Suppression Peaks Compacted - Slice " << mISlice << " : " << mPmemory ->nClusters <<" \n " ;
77+ out << " Clusterer - Noise Suppression Peaks Compacted - Slice " << mISlice << " : " << mPmemory ->nClusters << " \n " ;
7878 for (size_t i = 0 ; i < mPmemory ->nClusters ; i++) {
7979 out << i << " : " << mPfilteredPeaks [i].charge << " , " << mPfilteredPeaks [i].time << " , " << (int )mPfilteredPeaks [i].pad << " , " << (int )mPfilteredPeaks [i].row << " \n " ;
8080 }
@@ -91,11 +91,31 @@ void GPUTPCClusterFinder::DumpCountedPeaks(std::ostream& out)
9191void GPUTPCClusterFinder::DumpClusters (std::ostream& out)
9292{
9393 out << " Clusterer - Clusters - Slice " << mISlice << " \n " ;
94+
9495 for (int i = 0 ; i < GPUCA_ROW_COUNT; i++) {
95- out << " Row: " << i << " : " << mPclusterInRow [i] << " \n " ;
96- for (unsigned int j = 0 ; j < mPclusterInRow [i]; j++) {
97- const auto & cl = mPclusterByRow [i * mNMaxClusterPerRow + j];
98- out << cl.timeFlagsPacked << " , " << cl.padPacked << " , " << (int )cl.sigmaTimePacked << " , " << (int )cl.sigmaPadPacked << " , " << cl.qmax << " , " << cl.qtot << " \n " ;
96+ size_t N = mPclusterInRow [i];
97+ out << " Row: " << i << " : " << N << " \n " ;
98+ std::vector<deprecated::ClusterNative> sortedCluster (N);
99+ deprecated::ClusterNative* row = &mPclusterByRow [i * mNMaxClusterPerRow ];
100+ std::copy (row, &row[N], sortedCluster.begin ());
101+
102+ std::sort (sortedCluster.begin (), sortedCluster.end (), [](const auto & c1, const auto & c2) {
103+ float t1 = deprecated::cnGetTime (&c1);
104+ float t2 = deprecated::cnGetTime (&c2);
105+ float p1 = deprecated::cnGetPad (&c1);
106+ float p2 = deprecated::cnGetPad (&c2);
107+
108+ if (t1 < t2) {
109+ return true ;
110+ } else if (t1 == t2) {
111+ return p1 < p2;
112+ } else {
113+ return false ;
114+ }
115+ });
116+
117+ for (const auto & cl : sortedCluster) {
118+ out << std::hex << cl.timeFlagsPacked << std::dec << " , " << cl.padPacked << " , " << (int )cl.sigmaTimePacked << " , " << (int )cl.sigmaPadPacked << " , " << cl.qmax << " , " << cl.qtot << " \n " ;
99119 }
100120 }
101121}
0 commit comments