3 // Original: AliHLTTrackArray.h,v 1.7 2004/06/11 16:06:33 loizides
4 #ifndef ALIHLTTPCTRACKARRAY_H
5 #define ALIHLTTPCTRACKARRAY_H
7 //* This file is property of and copyright by the ALICE HLT Project *
8 //* ALICE Experiment at CERN, All rights reserved. *
9 //* See cxx source for full Copyright notice *
11 /** @file AliHLTTPCTrackArray.h
12 @author Uli Frankenfeld, maintained by Matthias Richter
14 @brief Array of AliHLTTPCTracks
17 #include "AliHLTTPCRootTypes.h"
19 class AliHLTTPCConfMapTrack;
21 class AliHLTTPCTrackSegmentData;
24 * @class AliHLTTPCTrackArray
25 * Array of AliHLTTrack objects.
26 * The class implements a dynamic array and handler methods.
30 class AliHLTTPCTrackArray {
32 /** default constructor */
33 AliHLTTPCTrackArray();
36 * @param ntrack initial size
38 AliHLTTPCTrackArray(Int_t ntrack);
41 * @param tracktype string describing type, one of
42 * - AliHLTTPCTrack -> 't'
43 * - AliHLTTPCConfMapTrack -> 'c'
44 * - AliHLTTPCHoughTrack -> 'h'
45 * - AliHLTTPCModelTrack -> 'm'
46 * @param ntrack initial size
48 AliHLTTPCTrackArray(char* tracktype,Int_t ntrack);
51 * @param tracktype string describing type, one of
52 * - AliHLTTPCTrack -> 't'
53 * - AliHLTTPCConfMapTrack -> 'c'
54 * - AliHLTTPCHoughTrack -> 'h'
55 * - AliHLTTPCModelTrack -> 'm'
57 AliHLTTPCTrackArray(char* tracktype);
59 virtual ~AliHLTTPCTrackArray();
64 * - 't' -> AliHLTTPCTrack
65 * - 'c' -> AliHLTTPCConfMapTrack
66 * - 'h' -> AliHLTTPCHoughTrack
67 * - 'm' -> AliHLTTPCModelTrack
69 Int_t GetTrackType(){return fTrackType;}
72 * Get size of the array.
73 * @return size of the array
75 Int_t GetSize() const {return fSize;}
79 * If the current size is smaller, the array is grown to the new size.
80 * @return kTRUE if the array was grown, kFALSE otherwise
82 Bool_t SetSize(Int_t newsize=2000);
84 Int_t GetNPresent() const {return (fNTracks- fNAbsent);}
85 Int_t GetNTracks() const {return fNTracks;}
88 * Return pointer to next free track object.
89 * The array is grown if necessary.
91 AliHLTTPCTrack *NextTrack();
92 AliHLTTPCTrack *GetCheckedTrack(Int_t t){if(fIsPresent[t]) return fTrack[t]; return 0;}
93 AliHLTTPCTrack *GetTrack(Int_t t){return fTrack[t];}
95 void Remove(Int_t track);
96 void RemoveLast() {fNTracks--;}
100 void QSort( AliHLTTPCTrack **a, Int_t first, Int_t last);
101 Int_t TrackCompare(AliHLTTPCTrack *a, AliHLTTPCTrack *b) const;
104 * Fill track array from track segment array.
105 * Reads the track from an array of AliHLTTrackSegmentData. The coordinates
106 * are transformed to global coordinates if the slice parameter is specified.
107 * In that case to internal slice variable is set to zero.
108 * @param ntracks size of the input array
109 * @param tr array of AliHLTTrackSegmentData
110 * @param slice slice no to transform the tracks to
111 * @param bTransform transform to global coordinates if 1
113 void FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* tr,Int_t slice=-1, Int_t bTransform=1);
115 UInt_t WriteTracks(AliHLTTPCTrackSegmentData* tr); //Write tracks
116 UInt_t WriteTracks(UInt_t & ntracks,AliHLTTPCTrackSegmentData* tr); //Write tracks
118 UInt_t GetOutCount(){return (UInt_t) GetNPresent();}
119 void AddTracks(AliHLTTPCTrackArray *newtrack,Bool_t remove_old=kTRUE,Int_t slice=-1);//add all Tracks to this
120 void AddLast(AliHLTTPCTrack *track);
122 AliHLTTPCTrack* operator[](int index);
125 /** copy constructor prohibited */
126 AliHLTTPCTrackArray(const AliHLTTPCTrackArray&);
127 /** assignment operator prohibited */
128 AliHLTTPCTrackArray& operator=(const AliHLTTPCTrackArray&);
130 Char_t fTrackType; //track type
131 Int_t fSize; //size of array
132 Bool_t *fIsPresent;//!
133 Int_t fNAbsent; //ntracks absent
135 AliHLTTPCTrack **fTrack;//!
136 Int_t fNTracks; //ntracks in
138 UInt_t WriteConfMapTracks(AliHLTTPCTrackSegmentData* tr);
141 ClassDef(AliHLTTPCTrackArray,2) //Track array class