]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/AliHLTTPCCANeighboursCleaner.cxx
Qmax for merged clusters fixed
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCANeighboursCleaner.cxx
CommitLineData
00d07bcd 1// @(#) $Id: AliHLTTPCCANeighboursCleaner.cxx 27042 2008-07-02 12:06:02Z richterm $
ce565086 2// **************************************************************************
fbb9b71b 3// This file is property of and copyright by the ALICE HLT Project *
00d07bcd 4// ALICE Experiment at CERN, All rights reserved. *
5// *
6// Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7// Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8// for The ALICE HLT Project. *
9// *
10// Permission to use, copy, modify and distribute this software and its *
11// documentation strictly for non-commercial purposes is hereby granted *
12// without fee, provided that the above copyright notice appears in all *
13// copies and that both the copyright notice and this permission notice *
14// appear in the supporting documentation. The authors make no claims *
15// about the suitability of this software for any purpose. It is *
16// provided "as is" without express or implied warranty. *
ce565086 17// *
00d07bcd 18//***************************************************************************
19
ce565086 20
00d07bcd 21#include "AliHLTTPCCANeighboursCleaner.h"
22#include "AliHLTTPCCAMath.h"
23#include "AliHLTTPCCATracker.h"
24
f0bada7f 25GPUdi() void AliHLTTPCCANeighboursCleaner::Thread
fbb9b71b 26( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
00d07bcd 27 AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
28{
29 // *
ce565086 30 // * kill link to the neighbour if the neighbour is not pointed to the cluster
00d07bcd 31 // *
32
fbb9b71b 33 if ( iSync == 0 ) {
34 if ( iThread == 0 ) {
35 s.fNRows = tracker.Param().NRows();
36 s.fIRow = iBlock + 2;
37 if ( s.fIRow <= s.fNRows - 3 ) {
38 s.fIRowUp = s.fIRow + 2;
39 s.fIRowDn = s.fIRow - 2;
fbb9b71b 40 s.fNHits = tracker.Row( s.fIRow ).NHits();
00d07bcd 41 }
fbb9b71b 42 }
43 } else if ( iSync == 1 ) {
44 if ( s.fIRow <= s.fNRows - 3 ) {
f0bada7f 45#ifdef HLTCA_GPUCODE
46 int Up = s.fIRowUp;
47 int Dn = s.fIRowDn;
48 const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
49 const AliHLTTPCCARow &rowUp = tracker.Row( Up );
50 const AliHLTTPCCARow &rowDn = tracker.Row( Dn );
51#else
4acc2401 52 const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
53 const AliHLTTPCCARow &rowUp = tracker.Row( s.fIRowUp );
54 const AliHLTTPCCARow &rowDn = tracker.Row( s.fIRowDn );
f0bada7f 55#endif
ce565086 56
4acc2401 57 // - look at up link, if it's valid but the down link in the row above doesn't link to us remove
58 // the link
59 // - look at down link, if it's valid but the up link in the row below doesn't link to us remove
60 // the link
fbb9b71b 61 for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
4acc2401 62 int up = tracker.HitLinkUpData( row, ih );
fbb9b71b 63 if ( up >= 0 ) {
4acc2401 64 short upDn = tracker.HitLinkDownData( rowUp, up );
65 if ( ( upDn != ih ) ) tracker.SetHitLinkUpData( row, ih, -1 );
fbb9b71b 66 }
4acc2401 67 int dn = tracker.HitLinkDownData( row, ih );
fbb9b71b 68 if ( dn >= 0 ) {
4acc2401 69 short dnUp = tracker.HitLinkUpData( rowDn, dn );
70 if ( dnUp != ih ) tracker.SetHitLinkDownData( row, ih, -1 );
fbb9b71b 71 }
00d07bcd 72 }
73 }
fbb9b71b 74 }
00d07bcd 75}
76