]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCTrackArray.h
coding conventions and compilation warnings
[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
4fdaad1e 7/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
8 * See cxx source for full Copyright notice */
9
10/** @file AliHLTTPCTrackArray.h
11 @author Uli Frankenfeld, maintained by Matthias Richter
12 @date
13 @brief Array of AliHLTTPCTracks
14*/
15
a6c02c85 16#include "AliHLTTPCRootTypes.h"
17
18class AliHLTTPCConfMapTrack;
19class AliHLTTPCTrack;
20class AliHLTTPCTrackSegmentData;
21
4fdaad1e 22/**
23 * @class AliHLTTPCTrackArray
24 * Array of AliHLTTrack objects.
25 * The class implements a dynamic array and handler methods.
26 */
a6c02c85 27class AliHLTTPCTrackArray {
a6c02c85 28 public:
4fdaad1e 29 /** default constructor */
a6c02c85 30 AliHLTTPCTrackArray();
4fdaad1e 31 /**
32 * constructor
33 * @param ntrack initial size
34 */
a6c02c85 35 AliHLTTPCTrackArray(Int_t ntrack);
4fdaad1e 36 /**
37 * constructor
38 * @param tracktype string describing type, one of
39 * - AliHLTTPCTrack -> 't'
40 * - AliHLTTPCConfMapTrack -> 'c'
41 * - AliHLTTPCHoughTrack -> 'h'
42 * - AliHLTTPCModelTrack -> 'm'
43 * @param ntrack initial size
44 */
a6c02c85 45 AliHLTTPCTrackArray(char* tracktype,Int_t ntrack);
4fdaad1e 46 /**
47 * constructor
48 * @param tracktype string describing type, one of
49 * - AliHLTTPCTrack -> 't'
50 * - AliHLTTPCConfMapTrack -> 'c'
51 * - AliHLTTPCHoughTrack -> 'h'
52 * - AliHLTTPCModelTrack -> 'm'
53 */
a6c02c85 54 AliHLTTPCTrackArray(char* tracktype);
4fdaad1e 55 /** not a valid copy constructor, defined according to effective C++ style */
56 AliHLTTPCTrackArray(const AliHLTTPCTrackArray&);
57 /** not a valid assignment op, but defined according to effective C++ style */
58 AliHLTTPCTrackArray& operator=(const AliHLTTPCTrackArray&);
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 */
a6c02c85 83 Bool_t SetSize(Int_t newsize=2000);
84
85 Int_t GetNPresent() const {return (fNTracks- fNAbsent);}
86 Int_t GetNTracks() const {return fNTracks;}
87 AliHLTTPCTrack *NextTrack();
88 AliHLTTPCTrack *GetCheckedTrack(Int_t t){if(fIsPresent[t]) return fTrack[t]; return 0;}
89 AliHLTTPCTrack *GetTrack(Int_t t){return fTrack[t];}
90
91 void Remove(Int_t track);
92 void RemoveLast() {fNTracks--;}
93 void Compress();
94 void Reset();
95 void QSort();
96 void QSort( AliHLTTPCTrack **a, Int_t first, Int_t last);
97 Int_t TrackCompare(AliHLTTPCTrack *a, AliHLTTPCTrack *b) const;
98
4fdaad1e 99 /**
100 * Fill track array from track segment array.
101 * Reads the track from an array of AliHLTTrackSegmentData. The coordinates
102 * are transformed to global coordinates if the slice parameter is specified.
103 * In that case to internal slice variable is set to zero.
104 * @param ntracks size of the input array
105 * @param tr array of AliHLTTrackSegmentData
106 * @param slice slice no to transform the tracks to
107 * @param bTransform transform to global coordinates if 1
108 */
109 void FillTracks(Int_t ntracks, AliHLTTPCTrackSegmentData* tr,Int_t slice=-1, Int_t bTransform=1);
110
a6c02c85 111 UInt_t WriteTracks(AliHLTTPCTrackSegmentData* tr); //Write tracks
112 UInt_t WriteTracks(UInt_t & ntracks,AliHLTTPCTrackSegmentData* tr); //Write tracks
113 UInt_t GetOutSize();
114 UInt_t GetOutCount(){return (UInt_t) GetNPresent();}
115 void AddTracks(AliHLTTPCTrackArray *newtrack,Bool_t remove_old=kTRUE,Int_t slice=-1);//add all Tracks to this
116 void AddLast(AliHLTTPCTrack *track);
117
3cde846d 118 AliHLTTPCTrack* operator[](int index);
119
4fdaad1e 120 private:
121
122 Char_t fTrackType; //track type
123 Int_t fSize; //size of arra
124 Bool_t *fIsPresent;//!
125 Int_t fNAbsent; //ntracks absent
126
127 AliHLTTPCTrack **fTrack;//!
128 Int_t fNTracks; //ntracks in
129
130 UInt_t WriteConfMapTracks(AliHLTTPCTrackSegmentData* tr);
131 void DeleteArray();
132
3cde846d 133 ClassDef(AliHLTTPCTrackArray,2) //Track array class
a6c02c85 134};
135
136#endif