]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCTrackArray.h
code documantation and minor cleanup
[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;
22
4fdaad1e 23/**
24 * @class AliHLTTPCTrackArray
25 * Array of AliHLTTrack objects.
26 * The class implements a dynamic array and handler methods.
297174de 27 *
28 * @ingroup alihlt_tpc
4fdaad1e 29 */
a6c02c85 30class AliHLTTPCTrackArray {
a6c02c85 31 public:
4fdaad1e 32 /** default constructor */
a6c02c85 33 AliHLTTPCTrackArray();
4fdaad1e 34 /**
35 * constructor
36 * @param ntrack initial size
37 */
a6c02c85 38 AliHLTTPCTrackArray(Int_t ntrack);
4fdaad1e 39 /**
40 * constructor
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
47 */
a6c02c85 48 AliHLTTPCTrackArray(char* tracktype,Int_t ntrack);
4fdaad1e 49 /**
50 * constructor
51 * @param tracktype string describing type, one of
52 * - AliHLTTPCTrack -> 't'
53 * - AliHLTTPCConfMapTrack -> 'c'
54 * - AliHLTTPCHoughTrack -> 'h'
55 * - AliHLTTPCModelTrack -> 'm'
56 */
a6c02c85 57 AliHLTTPCTrackArray(char* tracktype);
4fdaad1e 58 /** destructor */
a6c02c85 59 virtual ~AliHLTTPCTrackArray();
4fdaad1e 60
61 /**
62 * Get type of track.
63 * @return one of
64 * - 't' -> AliHLTTPCTrack
65 * - 'c' -> AliHLTTPCConfMapTrack
66 * - 'h' -> AliHLTTPCHoughTrack
67 * - 'm' -> AliHLTTPCModelTrack
68 */
a6c02c85 69 Int_t GetTrackType(){return fTrackType;}
4fdaad1e 70
71 /**
72 * Get size of the array.
73 * @return size of the array
74 */
a6c02c85 75 Int_t GetSize() const {return fSize;}
4fdaad1e 76
77 /**
78 * Set size.
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
81 */
a6c02c85 82 Bool_t SetSize(Int_t newsize=2000);
83
84 Int_t GetNPresent() const {return (fNTracks- fNAbsent);}
85 Int_t GetNTracks() const {return fNTracks;}
055fed30 86
87 /**
88 * Return pointer to next free track object.
89 * The array is grown if necessary.
90 */
a6c02c85 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];}
94
95 void Remove(Int_t track);
96 void RemoveLast() {fNTracks--;}
97 void Compress();
98 void Reset();
99 void QSort();
100 void QSort( AliHLTTPCTrack **a, Int_t first, Int_t last);
101 Int_t TrackCompare(AliHLTTPCTrack *a, AliHLTTPCTrack *b) const;
102
4fdaad1e 103 /**
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
112 */
113 void FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* tr,Int_t slice=-1, Int_t bTransform=1);
114
a6c02c85 115 UInt_t WriteTracks(AliHLTTPCTrackSegmentData* tr); //Write tracks
116 UInt_t WriteTracks(UInt_t & ntracks,AliHLTTPCTrackSegmentData* tr); //Write tracks
117 UInt_t GetOutSize();
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);
121
3cde846d 122 AliHLTTPCTrack* operator[](int index);
123
4fdaad1e 124 private:
8f8bf0af 125 /** copy constructor prohibited */
126 AliHLTTPCTrackArray(const AliHLTTPCTrackArray&);
127 /** assignment operator prohibited */
128 AliHLTTPCTrackArray& operator=(const AliHLTTPCTrackArray&);
4fdaad1e 129
130 Char_t fTrackType; //track type
055fed30 131 Int_t fSize; //size of array
4fdaad1e 132 Bool_t *fIsPresent;//!
133 Int_t fNAbsent; //ntracks absent
134
135 AliHLTTPCTrack **fTrack;//!
136 Int_t fNTracks; //ntracks in
137
138 UInt_t WriteConfMapTracks(AliHLTTPCTrackSegmentData* tr);
139 void DeleteArray();
140
3cde846d 141 ClassDef(AliHLTTPCTrackArray,2) //Track array class
a6c02c85 142};
143
144#endif