]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCTrackArray.h
Updated SSD QA class (PAnos)
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCTrackArray.h
CommitLineData
4fdaad1e 1// -*- Mode: C++ -*-
a6c02c85 2// @(#) $Id$
4aa41877 3// Original: AliHLTTrackArray.h,v 1.7 2004/06/11 16:06:33 loizides
a6c02c85 4#ifndef ALIHLTTPCTRACKARRAY_H
5#define ALIHLTTPCTRACKARRAY_H
6
297174de 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 *
4fdaad1e 10
11/** @file AliHLTTPCTrackArray.h
12 @author Uli Frankenfeld, maintained by Matthias Richter
13 @date
14 @brief Array of AliHLTTPCTracks
15*/
16
a6c02c85 17#include "AliHLTTPCRootTypes.h"
18
19class AliHLTTPCConfMapTrack;
20class AliHLTTPCTrack;
21class AliHLTTPCTrackSegmentData;
febeb705 22class AliHLTTPCTrackSegmentDataV1;
a6c02c85 23
4fdaad1e 24/**
25 * @class AliHLTTPCTrackArray
26 * Array of AliHLTTrack objects.
27 * The class implements a dynamic array and handler methods.
297174de 28 *
29 * @ingroup alihlt_tpc
4fdaad1e 30 */
a6c02c85 31class AliHLTTPCTrackArray {
a6c02c85 32 public:
4fdaad1e 33 /** default constructor */
a6c02c85 34 AliHLTTPCTrackArray();
4fdaad1e 35 /**
36 * constructor
37 * @param ntrack initial size
38 */
a6c02c85 39 AliHLTTPCTrackArray(Int_t ntrack);
4fdaad1e 40 /**
41 * constructor
42 * @param tracktype string describing type, one of
43 * - AliHLTTPCTrack -> 't'
44 * - AliHLTTPCConfMapTrack -> 'c'
45 * - AliHLTTPCHoughTrack -> 'h'
46 * - AliHLTTPCModelTrack -> 'm'
47 * @param ntrack initial size
48 */
a6c02c85 49 AliHLTTPCTrackArray(char* tracktype,Int_t ntrack);
4fdaad1e 50 /**
51 * constructor
52 * @param tracktype string describing type, one of
53 * - AliHLTTPCTrack -> 't'
54 * - AliHLTTPCConfMapTrack -> 'c'
55 * - AliHLTTPCHoughTrack -> 'h'
56 * - AliHLTTPCModelTrack -> 'm'
57 */
a6c02c85 58 AliHLTTPCTrackArray(char* tracktype);
4fdaad1e 59 /** destructor */
a6c02c85 60 virtual ~AliHLTTPCTrackArray();
4fdaad1e 61
62 /**
63 * Get type of track.
64 * @return one of
65 * - 't' -> AliHLTTPCTrack
66 * - 'c' -> AliHLTTPCConfMapTrack
67 * - 'h' -> AliHLTTPCHoughTrack
68 * - 'm' -> AliHLTTPCModelTrack
69 */
a6c02c85 70 Int_t GetTrackType(){return fTrackType;}
4fdaad1e 71
72 /**
73 * Get size of the array.
74 * @return size of the array
75 */
a6c02c85 76 Int_t GetSize() const {return fSize;}
4fdaad1e 77
78 /**
79 * Set size.
80 * If the current size is smaller, the array is grown to the new size.
81 * @return kTRUE if the array was grown, kFALSE otherwise
82 */
ee18a059 83 Bool_t SetSize(Int_t newsize=0);
a6c02c85 84
85 Int_t GetNPresent() const {return (fNTracks- fNAbsent);}
86 Int_t GetNTracks() const {return fNTracks;}
055fed30 87
88 /**
89 * Return pointer to next free track object.
90 * The array is grown if necessary.
91 */
a6c02c85 92 AliHLTTPCTrack *NextTrack();
93 AliHLTTPCTrack *GetCheckedTrack(Int_t t){if(fIsPresent[t]) return fTrack[t]; return 0;}
94 AliHLTTPCTrack *GetTrack(Int_t t){return fTrack[t];}
95
96 void Remove(Int_t track);
97 void RemoveLast() {fNTracks--;}
98 void Compress();
99 void Reset();
100 void QSort();
101 void QSort( AliHLTTPCTrack **a, Int_t first, Int_t last);
102 Int_t TrackCompare(AliHLTTPCTrack *a, AliHLTTPCTrack *b) const;
103
febeb705 104 /**
105 * Fill track array from track segment array.
106 * Old method excluding buffer protection kept for backward compatibility.
107 * Forwarded to FillTracksChecked().
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
112 */
113 int FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* tr, Int_t slice=-1, Int_t bTransform=1);
114
4fdaad1e 115 /**
116 * Fill track array from track segment array.
117 * Reads the track from an array of AliHLTTrackSegmentData. The coordinates
118 * are transformed to global coordinates if the slice parameter is specified.
119 * In that case to internal slice variable is set to zero.
febeb705 120 *
121 * The sizeInByte parameter allows an additional buffer protection if
122 * non-zero. The size of the AliHLTTPCTrackSegmentData is not fixed due to
123 * variable array at the end of the structure. The pointer to the next
124 * entry must be set according to the variable array.
4fdaad1e 125 * @param ntracks size of the input array
126 * @param tr array of AliHLTTrackSegmentData
febeb705 127 * @param sizeInByte additional size protection
4fdaad1e 128 * @param slice slice no to transform the tracks to
129 * @param bTransform transform to global coordinates if 1
130 */
febeb705 131 int FillTracksChecked(AliHLTTPCTrackSegmentData* tr, Int_t ntracks, unsigned int sizeInByte, Int_t slice=-1, Int_t bTransform=1);
132
133 /**
134 * Fill array from version1 structure.
135 * The version 1 of ALiHLTTPCTrackSegmentData was valid until July 2008
136 * revision 27415.
137 *
138 * Similar behavior like FillTracksChecked.
139 */
140 int FillTracksVersion1(AliHLTTPCTrackSegmentDataV1* tr, Int_t ntracks, unsigned int sizeInByte, Int_t slice=-1, Int_t bTransform=1);
4fdaad1e 141
a6c02c85 142 UInt_t WriteTracks(AliHLTTPCTrackSegmentData* tr); //Write tracks
143 UInt_t WriteTracks(UInt_t & ntracks,AliHLTTPCTrackSegmentData* tr); //Write tracks
144 UInt_t GetOutSize();
145 UInt_t GetOutCount(){return (UInt_t) GetNPresent();}
146 void AddTracks(AliHLTTPCTrackArray *newtrack,Bool_t remove_old=kTRUE,Int_t slice=-1);//add all Tracks to this
147 void AddLast(AliHLTTPCTrack *track);
148
3cde846d 149 AliHLTTPCTrack* operator[](int index);
150
4fdaad1e 151 private:
8f8bf0af 152 /** copy constructor prohibited */
153 AliHLTTPCTrackArray(const AliHLTTPCTrackArray&);
154 /** assignment operator prohibited */
155 AliHLTTPCTrackArray& operator=(const AliHLTTPCTrackArray&);
4fdaad1e 156
157 Char_t fTrackType; //track type
055fed30 158 Int_t fSize; //size of array
4fdaad1e 159 Bool_t *fIsPresent;//!
160 Int_t fNAbsent; //ntracks absent
161
162 AliHLTTPCTrack **fTrack;//!
163 Int_t fNTracks; //ntracks in
164
165 UInt_t WriteConfMapTracks(AliHLTTPCTrackSegmentData* tr);
166 void DeleteArray();
167
3cde846d 168 ClassDef(AliHLTTPCTrackArray,2) //Track array class
a6c02c85 169};
170
171#endif