StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCATracker.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id: AliHLTTPCCATracker.h,v 1.2 2016/07/15 14:43:33 fisyak Exp $
3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project *
5 // ALICE Experiment at CERN, All rights reserved. *
6 // See cxx source for full Copyright notice *
7 // *
8 //*************************************************************************
9 
10 #ifndef ALIHLTTPCCATRACKER_H
11 #define ALIHLTTPCCATRACKER_H
12 
13 
14 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCAParam.h"
16 #include "AliHLTTPCCARow.h"
17 #include "AliHLTTPCCAHit.h"
18 #include <iostream>
19 #include "AliHLTArray.h"
20 #include "AliHLTTPCCATrackletVector.h"
21 #include "AliHLTTPCCATrack.h"
22 #include "AliHLTTPCCAStartHitId.h"
23 #include "AliHLTTPCCAOutTrack.h"
24 #include <cstdio>
25 #include "AliHLTTPCCASliceDataVector.h"
26 #include <vector>
27 
28 class AliHLTTPCCATrack;
32 
33 //X using Vc::int_v;
34 //X using Vc::uint_v;
35 //X using Vc::float_v;
36 //X using Vc::Mask;
37 
51 {
52  friend class AliHLTTPCCAPerformance;
53  public:
54  class NeighboursFinder;
55  class NeighboursCleaner;
56  class StartHitsFinder;
57  class Reconstructor;
58 
60 
62 
63  void Initialize( const AliHLTTPCCAParam &param );
64 
65  void StartEvent();
66 
67  void ReadEvent( AliHLTTPCCAClusterData *clusterData );
68 
69  void Reconstruct();
70  void WriteOutput();
71 
72  void GetErrors2( int iRow, const AliHLTTPCCATrackParam &t, float *Err2Y, float *Err2Z ) const;
73  void GetErrors2( int iRow, const AliHLTTPCCATrackParamVector &t, sfloat_v *Err2Y, sfloat_v *Err2Z ) const;
74  void GetErrors2( const ushort_v &rowIndexes, const AliHLTTPCCATrackParamVector &t, sfloat_v *Err2Y, sfloat_v *Err2Z ) const;
75 
76  void RecalculateHitsSize( int MaxNHits );
77  void SetPointersHits( int MaxNHits );
78  void RecalculateTrackMemorySize( int MaxNTracks, int MaxNHits );
79  void SetPointersTracks( int MaxNTracks, int MaxNHits );
80 
81  void WriteTracks( std::ostream &out ) ;
82  void ReadTracks( std::istream &in );
83 
84  int ISlice() const { return fParam.ISlice(); }
85  float SliceAlpha() const { return fParam.Alpha(); }
86  const AliHLTTPCCAParam &Param() const { return fParam; }
87 
88  double Timer( int i ) const { return fTimers[i]; }
89 
90  const SliceData &Data() const { return fData; }
91  const AliHLTTPCCAClusterData &ClusterData() const { return *fClusterData; }
92 
93  int NTracklets() const { return fNTracklets; }
94  int *NTracklets() { return &fNTracklets; }
95  void SetNTracklets(int nTrlets) { fNTracklets = nTrlets; }
96 
97  const AliHLTTPCCAStartHitId &TrackletStartHit( int i ) const { return fTrackletStartHits[i]; }
98  AliHLTTPCCAStartHitId *TrackletStartHits() const { return fTrackletStartHits; }
99 
100  size_t NTracks() const { return fTracks.size(); }
101  const std::vector<AliHLTTPCCATrack *> &Tracks() const { return fTracks; }
102 
103  const AliHLTTPCCASliceOutput * Output() const { return fOutput; }
104 
105 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
106  int fNOutTracks1; // number of tracks in fOutTracks array
107  AliHLTTPCCAOutTrack *fOutTracks1; // output array of the reconstructed tracks
108 
109  int NOutTracks1() const { return fNOutTracks1; }
110  AliHLTTPCCAOutTrack *OutTracks1() const { return fOutTracks1; }
111  const AliHLTTPCCAOutTrack &OutTrack1( int index ) const { return fOutTracks1[index]; }
112 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
113  void StoreToFile( FILE *f ) const;
114  void RestoreFromFile( FILE *f );
115 
116  private:
117  void SetupCommonMemory();
118 
119  AliHLTTPCCAParam fParam; // parameters
120  double fTimers[11]; // running CPU time for different parts of the algorithm
121 
124  AliHLTTPCCAClusterData *fClusterData; // ^
125  AliHLTTPCCASliceData fData; // The SliceData object. It is used to encapsulate the storage in memory from the access
126 
127  // event
128 
129  char *fHitMemory; // event memory for hits
130  int fHitMemorySize; // size of the event memory [bytes]
131 
132  char *fTrackMemory; // event memory for tracks
133  int fTrackMemorySize; // size of the event memory [bytes]
134 
135 
136  AliHLTTPCCAStartHitId *fTrackletStartHits; // start hits for the tracklets
137 
138  int fNTracklets; // number of tracklets
139  AliHLTResizableArray<TrackletVector> fTrackletVectors; // tracklet data
140 
141  //
142  int fNumberOfTracks;
143  std::vector<AliHLTTPCCATrack *> fTracks; // reconstructed tracks
144 
145  int fNTrackHits; // number of track hits
146 
147  // output
148 
149  AliHLTTPCCASliceOutput *fOutput;
150 
151  private:
153  AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
154 };
155 
156 inline void AliHLTTPCCATracker::GetErrors2( int iRow, const AliHLTTPCCATrackParamVector &t, sfloat_v *Err2Y, sfloat_v *Err2Z ) const
157 {
158  //
159  // Use calibrated cluster error from OCDB
160  //
161 
162  fParam.GetClusterErrors2( iRow, t, Err2Y, Err2Z );
163 }
164 inline void AliHLTTPCCATracker::GetErrors2( const ushort_v &rowIndexes, const AliHLTTPCCATrackParamVector &t, sfloat_v *Err2Y, sfloat_v *Err2Z ) const
165 {
166  //
167  // Use calibrated cluster error from OCDB
168  //
169 
170  fParam.GetClusterErrors2( rowIndexes, t, Err2Y, Err2Z );
171 }
173 /*
174 inline void AliHLTTPCCATracker::GetErrors2( int iRow, const sfloat_v &z, const sfloat_v &sinPhi,
175  const sfloat_v &DzDs, sfloat_v *Err2Y, sfloat_v *Err2Z ) const
176 {
177  //
178  // Use calibrated cluster error from OCDB
179  //
180 
181  fParam.GetClusterErrors2( iRow, z, sinPhi, DzDs, *Err2Y, *Err2Z );
182 }
183 inline void AliHLTTPCCATracker::GetErrors2( const ushort_v &iRow, const sfloat_v &z, const sfloat_v &sinPhi,
184  const sfloat_v &DzDs, sfloat_v *Err2Y, sfloat_v *Err2Z ) const {
185  fParam.GetClusterErrors2( iRow, z, sinPhi, DzDs, *Err2Y, *Err2Z );
186 }*/
189 
190 #endif
void GetClusterErrors2(int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z) const
mvz start 20.01.2010