Line data Source code
1 : //-*- Mode: C++ -*-
2 : // ************************************************************************
3 : // This file is property of and copyright by the ALICE HLT Project *
4 : // ALICE Experiment at CERN, All rights reserved. *
5 : // See cxx source for full Copyright notice *
6 : // *
7 : //*************************************************************************
8 :
9 : #ifndef ALIHLTTPCGMMERGER_H
10 : #define ALIHLTTPCGMMERGER_H
11 :
12 : #include "AliHLTTPCCADef.h"
13 : #include "AliHLTTPCCAParam.h"
14 : #include "AliHLTTPCGMBorderTrack.h"
15 : #include "AliHLTTPCGMSliceTrack.h"
16 : #include "AliHLTTPCCAGPUTracker.h"
17 :
18 : #if !defined(HLTCA_GPUCODE)
19 : #include <iostream>
20 : #include <cmath>
21 : #endif //HLTCA_GPUCODE
22 :
23 : class AliHLTTPCCASliceTrack;
24 : class AliHLTTPCCASliceOutput;
25 : class AliHLTTPCGMCluster;
26 : class AliHLTTPCGMTrackParam;
27 : class AliHLTTPCGMMergedTrack;
28 :
29 : /**
30 : * @class AliHLTTPCGMMerger
31 : *
32 : */
33 : class AliHLTTPCGMMerger
34 : {
35 :
36 : public:
37 :
38 : AliHLTTPCGMMerger();
39 : ~AliHLTTPCGMMerger();
40 :
41 0 : void SetSliceParam( const AliHLTTPCCAParam &v ) { fSliceParam = v; }
42 :
43 : void Clear();
44 : void SetSliceData( int index, const AliHLTTPCCASliceOutput *SliceData );
45 : bool Reconstruct();
46 :
47 0 : Int_t NOutputTracks() const { return fNOutputTracks; }
48 0 : const AliHLTTPCGMMergedTrack * OutputTracks() const { return fOutputTracks; }
49 0 : const UInt_t * OutputClusterIds() const { return fOutputClusterIds; }
50 :
51 0 : const AliHLTTPCCAParam &SliceParam() const { return fSliceParam; }
52 :
53 0 : void SetGPUTracker(AliHLTTPCCAGPUTracker* gpu) {fGPUTracker = gpu;}
54 0 : void SetDebugLevel(int debug) {fDebugLevel = debug;}
55 :
56 0 : float* PolinomialFieldBz() const {return((float*) fPolinomialFieldBz);}
57 :
58 0 : int NClusters() const { return(fNClusters); }
59 0 : int NOutputTrackClusters() const { return(fNOutputTrackClusters); }
60 0 : float* ClusterX() const {return(fClusterX);}
61 0 : float* ClusterY() const {return(fClusterY);}
62 0 : float* ClusterZ() const {return(fClusterZ);}
63 0 : float* ClusterAngle() const {return(fClusterAngle);}
64 0 : UInt_t* ClusterRowType() const {return(fClusterRowType);}
65 :
66 : private:
67 :
68 : AliHLTTPCGMMerger( const AliHLTTPCGMMerger& );
69 :
70 : const AliHLTTPCGMMerger &operator=( const AliHLTTPCGMMerger& ) const;
71 :
72 : void MakeBorderTracks( int iSlice, int iBorder, AliHLTTPCGMBorderTrack B[], int &nB );
73 :
74 : void MergeBorderTracks( int iSlice1, AliHLTTPCGMBorderTrack B1[], int N1,
75 : int iSlice2, AliHLTTPCGMBorderTrack B2[], int N2 );
76 :
77 : static bool CompareTrackParts( const AliHLTTPCGMSliceTrack *t1, const AliHLTTPCGMSliceTrack *t2 ){
78 : //return (t1->X() > t2->X() );
79 0 : return (fabs(t1->OrigTrack()->Cluster(0).GetX() - t2->OrigTrack()->Cluster(t2->NClusters() - 1).GetX()) <
80 0 : fabs(t2->OrigTrack()->Cluster(0).GetX() - t1->OrigTrack()->Cluster(t1->NClusters() - 1).GetX()));
81 : }
82 :
83 : static int CompareClusterIds(const void* a, const void* b) {
84 0 : return(((int2*)a)->y < ((int2*)b)->y ? 1 : -1);
85 : }
86 :
87 : void ClearMemory();
88 : bool AllocateMemory();
89 : void UnpackSlices();
90 : void MergeWithingSlices();
91 : void MergeSlices();
92 : void CollectMergedTracks();
93 : void Refit();
94 :
95 : static const int fgkNSlices = 36; //* N slices
96 : int fNextSliceInd[fgkNSlices];
97 : int fPrevSliceInd[fgkNSlices];
98 :
99 : AliHLTTPCCAParam fSliceParam; //* slice parameters (geometry, calibr, etc.)
100 : const AliHLTTPCCASliceOutput *fkSlices[fgkNSlices]; //* array of input slice tracks
101 :
102 : Int_t fNOutputTracks;
103 : Int_t fNOutputTrackClusters;
104 : AliHLTTPCGMMergedTrack *fOutputTracks; //* array of output merged tracks
105 : UInt_t * fOutputClusterIds;
106 :
107 : AliHLTTPCGMSliceTrack *fSliceTrackInfos; //* additional information for slice tracks
108 : int fSliceTrackInfoStart[fgkNSlices]; //* slice starting index in fTrackInfos array;
109 : int fSliceNTrackInfos[fgkNSlices]; //* N of slice track infos in fTrackInfos array;
110 : int fSliceTrackGlobalInfoStart[fgkNSlices]; //* Same for global tracks
111 : int fSliceNGlobalTrackInfos[fgkNSlices]; //* Same for global tracks
112 : int fMaxSliceTracks; // max N tracks in one slice
113 : float *fClusterX; // cluster X
114 : float *fClusterY; // cluster Y
115 : float *fClusterZ; // cluster Z
116 : UInt_t *fClusterRowType; // cluster row type
117 : float *fClusterAngle; // angle
118 : AliHLTTPCGMBorderTrack *fBorderMemory; // memory for border tracks
119 : AliHLTTPCGMBorderTrack::Range *fBorderRangeMemory; // memory for border tracks
120 :
121 : AliHLTTPCCAGPUTracker* fGPUTracker;
122 : int fDebugLevel;
123 :
124 : int fNClusters; //Total number of incoming clusters
125 :
126 : float fPolinomialFieldBz[6]; // field coefficients
127 : };
128 :
129 : #endif //ALIHLTTPCCAMERGER_H
|