1 // @(#) $Id: AliHLTTPCCANeighboursCleaner.cxx 27042 2008-07-02 12:06:02Z richterm $
2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
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. *
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. *
18 //***************************************************************************
21 #include "AliHLTTPCCANeighboursCleaner.h"
22 #include "AliHLTTPCCAMath.h"
23 #include "AliHLTTPCCATracker.h"
25 GPUd() void AliHLTTPCCANeighboursCleaner::Thread
26 ( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
27 AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
30 // * kill link to the neighbour if the neighbour is not pointed to the cluster
35 s.fNRows = tracker.Param().NRows();
37 if ( s.fIRow <= s.fNRows - 3 ) {
38 s.fIRowUp = s.fIRow + 2;
39 s.fIRowDn = s.fIRow - 2;
40 s.fFirstHit = tracker.Row( s.fIRow ).FirstHit();
41 const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
42 const AliHLTTPCCARow &rowUp = tracker.Row( s.fIRowUp );
43 const AliHLTTPCCARow &rowDn = tracker.Row( s.fIRowDn );
44 s.fHitLinkUp = ( ( short* )( tracker.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
45 s.fHitLinkDn = s.fHitLinkUp + row.NHits();
46 s.fDnHitLinkUp = ( ( short* )( tracker.RowData() + rowDn.FullOffset() ) ) + rowDn.FullLinkOffset();
47 s.fUpHitLinkDn = ( ( short* )( tracker.RowData() + rowUp.FullOffset() ) ) + rowUp.FullLinkOffset() + rowUp.NHits();
49 s.fNHits = tracker.Row( s.fIRow ).NHits();
52 } else if ( iSync == 1 ) {
53 if ( s.fIRow <= s.fNRows - 3 ) {
55 for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
56 int up = s.fHitLinkUp[ih];
58 short upDn = s.fUpHitLinkDn[up];
59 if ( ( upDn != ih ) ) s.fHitLinkUp[ih] = -1;
61 int dn = s.fHitLinkDn[ih];
63 short dnUp = s.fDnHitLinkUp[dn];
64 if ( dnUp != ih ) s.fHitLinkDn[ih] = -1;