]>
Commit | Line | Data |
---|---|---|
00d07bcd | 1 | // @(#) $Id: AliHLTTPCCAStartHitsFinder.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 | ||
20 | #include "AliHLTTPCCAStartHitsFinder.h" | |
21 | #include "AliHLTTPCCATracker.h" | |
22 | #include "AliHLTTPCCAMath.h" | |
23 | ||
24 | GPUd() void AliHLTTPCCAStartHitsFinder::Thread | |
fbb9b71b | 25 | ( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync, |
00d07bcd | 26 | AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker ) |
27 | { | |
28 | // find start hits for tracklets | |
29 | ||
fbb9b71b | 30 | if ( iSync == 0 ) { |
31 | if ( iThread == 0 ) { | |
32 | if ( iBlock == 0 ) { | |
33 | CAMath::AtomicExch( tracker.NTracklets(), 0 ); | |
34 | } | |
35 | s.fNRows = tracker.Param().NRows(); | |
36 | s.fIRow = iBlock + 1; | |
37 | s.fNRowStartHits = 0; | |
38 | if ( s.fIRow <= s.fNRows - 4 ) { | |
39 | s.fNHits = tracker.Row( s.fIRow ).NHits(); | |
40 | if ( s.fNHits >= 10240 ) s.fNHits = 10230; | |
fbb9b71b | 41 | } else s.fNHits = -1; |
00d07bcd | 42 | } |
fbb9b71b | 43 | } else if ( iSync == 1 ) { |
4acc2401 | 44 | const AliHLTTPCCARow &row = tracker.Row( s.fIRow ); |
fbb9b71b | 45 | for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) { |
4acc2401 | 46 | if ( ( tracker.HitLinkDownData( row, ih ) < 0 ) && ( tracker.HitLinkUpData( row, ih ) >= 0 ) ) { |
fbb9b71b | 47 | int oldNRowStartHits = CAMath::AtomicAdd( &s.fNRowStartHits, 1 ); |
4acc2401 | 48 | s.fRowStartHits[oldNRowStartHits].Set( s.fIRow, ih ); |
00d07bcd | 49 | } |
50 | } | |
fbb9b71b | 51 | } else if ( iSync == 2 ) { |
52 | if ( iThread == 0 ) { | |
53 | s.fNOldStartHits = CAMath::AtomicAdd( tracker.NTracklets(), s.fNRowStartHits ); | |
54 | } | |
55 | } else if ( iSync == 3 ) { | |
4acc2401 | 56 | AliHLTTPCCAHitId *const startHits = tracker.TrackletStartHits(); |
fbb9b71b | 57 | for ( int ish = iThread; ish < s.fNRowStartHits; ish += nThreads ) { |
58 | startHits[s.fNOldStartHits+ish] = s.fRowStartHits[ish]; | |
00d07bcd | 59 | } |
fbb9b71b | 60 | } |
00d07bcd | 61 | } |
62 |