@@ -807,51 +807,53 @@ GPUDisplay::vboList GPUDisplay::DrawClusters(int iSlice, int select, unsigned in
807807{
808808 size_t startCount = mVertexBufferStart [iSlice].size ();
809809 size_t startCountInner = mVertexBuffer [iSlice].size ();
810- const int firstCluster = (mCollisionClusters .size () > 1 && iCol > 0 ) ? mCollisionClusters [iCol - 1 ][iSlice] : 0 ;
811- const int lastCluster = (mCollisionClusters .size () > 1 && iCol + 1 < mCollisionClusters .size ()) ? mCollisionClusters [iCol][iSlice] : (mParam ->par .earlyTpcTransform ? mIOPtrs ->nClusterData [iSlice] : mIOPtrs ->clustersNative ? mIOPtrs ->clustersNative ->nClustersSector [iSlice] : 0 );
812- for (int cidInSlice = firstCluster; cidInSlice < lastCluster; cidInSlice++) {
813- const int cid = GET_CID (iSlice, cidInSlice);
814- if (mCfgH .hideUnmatchedClusters && mQA && mQA ->SuppressHit (cid)) {
815- continue ;
816- }
817- bool draw = mGlobalPos [cid].w == select;
818-
819- if (mCfgH .markAdjacentClusters ) {
820- const int attach = mIOPtrs ->mergedTrackHitAttachment [cid];
821- if (attach) {
822- if (mCfgH .markAdjacentClusters >= 32 ) {
823- if (mQA && mQA ->clusterRemovable (attach, mCfgH .markAdjacentClusters == 33 )) {
810+ if (mCollisionClusters .size () > 0 || iCol == 0 ) {
811+ const int firstCluster = (mCollisionClusters .size () > 1 && iCol > 0 ) ? mCollisionClusters [iCol - 1 ][iSlice] : 0 ;
812+ const int lastCluster = (mCollisionClusters .size () > 1 && iCol + 1 < mCollisionClusters .size ()) ? mCollisionClusters [iCol][iSlice] : (mParam ->par .earlyTpcTransform ? mIOPtrs ->nClusterData [iSlice] : mIOPtrs ->clustersNative ? mIOPtrs ->clustersNative ->nClustersSector [iSlice] : 0 );
813+ for (int cidInSlice = firstCluster; cidInSlice < lastCluster; cidInSlice++) {
814+ const int cid = GET_CID (iSlice, cidInSlice);
815+ if (mCfgH .hideUnmatchedClusters && mQA && mQA ->SuppressHit (cid)) {
816+ continue ;
817+ }
818+ bool draw = mGlobalPos [cid].w == select;
819+
820+ if (mCfgH .markAdjacentClusters ) {
821+ const int attach = mIOPtrs ->mergedTrackHitAttachment [cid];
822+ if (attach) {
823+ if (mCfgH .markAdjacentClusters >= 32 ) {
824+ if (mQA && mQA ->clusterRemovable (attach, mCfgH .markAdjacentClusters == 33 )) {
825+ draw = select == tMARKED;
826+ }
827+ } else if ((mCfgH .markAdjacentClusters & 2 ) && (attach & gputpcgmmergertypes::attachTube)) {
824828 draw = select == tMARKED;
825- }
826- } else if ((mCfgH .markAdjacentClusters & 2 ) && (attach & gputpcgmmergertypes::attachTube)) {
827- draw = select == tMARKED;
828- } else if ((mCfgH .markAdjacentClusters & 1 ) && (attach & (gputpcgmmergertypes::attachGood | gputpcgmmergertypes::attachTube)) == 0 ) {
829- draw = select == tMARKED;
830- } else if ((mCfgH .markAdjacentClusters & 4 ) && (attach & gputpcgmmergertypes::attachGoodLeg) == 0 ) {
831- draw = select == tMARKED;
832- } else if ((mCfgH .markAdjacentClusters & 16 ) && (attach & gputpcgmmergertypes::attachHighIncl)) {
833- draw = select == tMARKED;
834- } else if (mCfgH .markAdjacentClusters & 8 ) {
835- if (fabsf (mIOPtrs ->mergedTracks [attach & gputpcgmmergertypes::attachTrackMask].GetParam ().GetQPt ()) > 20 .f ) {
829+ } else if ((mCfgH .markAdjacentClusters & 1 ) && (attach & (gputpcgmmergertypes::attachGood | gputpcgmmergertypes::attachTube)) == 0 ) {
830+ draw = select == tMARKED;
831+ } else if ((mCfgH .markAdjacentClusters & 4 ) && (attach & gputpcgmmergertypes::attachGoodLeg) == 0 ) {
832+ draw = select == tMARKED;
833+ } else if ((mCfgH .markAdjacentClusters & 16 ) && (attach & gputpcgmmergertypes::attachHighIncl)) {
836834 draw = select == tMARKED;
835+ } else if (mCfgH .markAdjacentClusters & 8 ) {
836+ if (fabsf (mIOPtrs ->mergedTracks [attach & gputpcgmmergertypes::attachTrackMask].GetParam ().GetQPt ()) > 20 .f ) {
837+ draw = select == tMARKED;
838+ }
837839 }
838840 }
841+ } else if (mCfgH .markClusters ) {
842+ short flags;
843+ if (mParam ->par .earlyTpcTransform ) {
844+ flags = mIOPtrs ->clusterData [iSlice][cidInSlice].flags ;
845+ } else {
846+ flags = mIOPtrs ->clustersNative ->clustersLinear [cid].getFlags ();
847+ }
848+ const bool match = flags & mCfgH .markClusters ;
849+ draw = (select == tMARKED) ? (match) : (draw && !match);
850+ } else if (mCfgH .markFakeClusters ) {
851+ const bool fake = (mQA ->HitAttachStatus (cid));
852+ draw = (select == tMARKED) ? (fake) : (draw && !fake);
839853 }
840- } else if (mCfgH .markClusters ) {
841- short flags;
842- if (mParam ->par .earlyTpcTransform ) {
843- flags = mIOPtrs ->clusterData [iSlice][cidInSlice].flags ;
844- } else {
845- flags = mIOPtrs ->clustersNative ->clustersLinear [cid].getFlags ();
854+ if (draw) {
855+ mVertexBuffer [iSlice].emplace_back (mGlobalPos [cid].x , mGlobalPos [cid].y , mCfgH .projectXY ? 0 : mGlobalPos [cid].z );
846856 }
847- const bool match = flags & mCfgH .markClusters ;
848- draw = (select == tMARKED) ? (match) : (draw && !match);
849- } else if (mCfgH .markFakeClusters ) {
850- const bool fake = (mQA ->HitAttachStatus (cid));
851- draw = (select == tMARKED) ? (fake) : (draw && !fake);
852- }
853- if (draw) {
854- mVertexBuffer [iSlice].emplace_back (mGlobalPos [cid].x , mGlobalPos [cid].y , mCfgH .projectXY ? 0 : mGlobalPos [cid].z );
855857 }
856858 }
857859 insertVertexList (iSlice, startCountInner, mVertexBuffer [iSlice].size ());
0 commit comments