]>
Commit | Line | Data |
---|---|---|
63d8b79d | 1 | //-*- Mode: C++ -*- |
2 | // ************************************************************************ | |
fbb9b71b | 3 | // This file is property of and copyright by the ALICE HLT Project * |
63d8b79d | 4 | // ALICE Experiment at CERN, All rights reserved. * |
5 | // See cxx source for full Copyright notice * | |
6 | // * | |
7 | //************************************************************************* | |
8 | ||
9 | ||
10 | #ifndef ALIHLTTPCCAMERGEROUTPUT_H | |
11 | #define ALIHLTTPCCAMERGEROUTPUT_H | |
12 | ||
13 | #include "AliHLTTPCCADef.h" | |
14 | #include "AliHLTTPCCAMergedTrack.h" | |
15 | ||
16 | /** | |
17 | * @class AliHLTTPCCAMergerOutput | |
18 | * | |
19 | * AliHLTTPCCAMergerOutput class is used to store the output of AliHLTTPCCATracker{Component} | |
20 | * and transport the output to AliHLTTPCCAMerger{Component} | |
21 | * | |
22 | * The class contains all the necessary information about TPC tracks, reconstructed in one slice. | |
fbb9b71b | 23 | * This includes the reconstructed track parameters and some compressed information |
63d8b79d | 24 | * about the assigned clusters: clusterId, position and amplitude. |
25 | * | |
26 | */ | |
27 | class AliHLTTPCCAMergerOutput | |
28 | { | |
fbb9b71b | 29 | public: |
63d8b79d | 30 | |
fbb9b71b | 31 | AliHLTTPCCAMergerOutput() |
6de2bc40 | 32 | : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterId( 0 ), fClusterPackedAmp( 0 ) {} |
63d8b79d | 33 | |
fbb9b71b | 34 | ~AliHLTTPCCAMergerOutput() {} |
63d8b79d | 35 | |
63d8b79d | 36 | |
fbb9b71b | 37 | GPUhd() int NTracks() const { return fNTracks; } |
38 | GPUhd() int NTrackClusters() const { return fNTrackClusters; } | |
63d8b79d | 39 | |
fbb9b71b | 40 | GPUhd() const AliHLTTPCCAMergedTrack &Track( int i ) const { return fTracks[i]; } |
6de2bc40 | 41 | GPUhd() int ClusterId ( int i ) const { return fClusterId[i]; } |
fbb9b71b | 42 | GPUhd() UChar_t ClusterPackedAmp( int i ) const { return fClusterPackedAmp[i]; } |
63d8b79d | 43 | |
fbb9b71b | 44 | GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters ); |
45 | GPUhd() void SetPointers(); | |
63d8b79d | 46 | |
fbb9b71b | 47 | GPUhd() void SetNTracks ( int v ) { fNTracks = v; } |
48 | GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; } | |
63d8b79d | 49 | |
fbb9b71b | 50 | GPUhd() void SetTrack( int i, const AliHLTTPCCAMergedTrack &v ) { fTracks[i] = v; } |
6de2bc40 | 51 | GPUhd() void SetClusterId( int i, int v ) { fClusterId[i] = v; } |
fbb9b71b | 52 | GPUhd() void SetClusterPackedAmp( int i, UChar_t v ) { fClusterPackedAmp[i] = v; } |
53 | ||
54 | private: | |
55 | ||
6de2bc40 | 56 | AliHLTTPCCAMergerOutput( const AliHLTTPCCAMergerOutput & ) |
b8139972 | 57 | : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterId( 0 ), fClusterPackedAmp( 0 ) {} |
6de2bc40 | 58 | |
b8139972 | 59 | const AliHLTTPCCAMergerOutput& operator=( const AliHLTTPCCAMergerOutput &/*v*/ ) const { |
6de2bc40 | 60 | return *this; |
b8139972 | 61 | } |
6de2bc40 | 62 | |
fbb9b71b | 63 | int fNTracks; // number of reconstructed tracks |
64 | int fNTrackClusters; // total number of track clusters | |
65 | AliHLTTPCCAMergedTrack *fTracks; // pointer to reconstructed tracks | |
6de2bc40 | 66 | int *fClusterId; // pointer to cluster IDs ( packed slice, patch, cluster ) |
fbb9b71b | 67 | UChar_t *fClusterPackedAmp; // pointer to packed cluster amplitudes |
63d8b79d | 68 | }; |
69 | ||
70 | ||
71 | ||
fbb9b71b | 72 | GPUhd() inline int AliHLTTPCCAMergerOutput::EstimateSize( int nOfTracks, int nOfTrackClusters ) |
63d8b79d | 73 | { |
74 | // calculate the amount of memory [bytes] needed for the event | |
75 | ||
6de2bc40 | 76 | const int kClusterDataSize = sizeof( int ) + sizeof( UChar_t ); |
63d8b79d | 77 | |
fbb9b71b | 78 | return sizeof( AliHLTTPCCAMergerOutput ) + sizeof( AliHLTTPCCAMergedTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters; |
63d8b79d | 79 | } |
80 | ||
81 | ||
82 | GPUhd() inline void AliHLTTPCCAMergerOutput::SetPointers() | |
83 | { | |
84 | // set all pointers | |
85 | ||
fbb9b71b | 86 | fTracks = ( AliHLTTPCCAMergedTrack* )( ( &fClusterPackedAmp ) + 1 ); |
6de2bc40 | 87 | fClusterId = ( int* ) ( fTracks + fNTracks ); |
88 | fClusterPackedAmp = ( UChar_t* ) ( fClusterId + fNTrackClusters ); | |
63d8b79d | 89 | } |
90 | ||
31649d4b | 91 | #endif //ALIHLTTPCCAMERGEROUTPUT_H |