StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCATracklet.h
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 ALIHLTTPCCATRACKLET_H
10 #define ALIHLTTPCCATRACKLET_H
11 
12 #include "AliHLTTPCCADef.h"
13 #include "AliHLTTPCCATrackParam.h"
14 #include "AliHLTArray.h"
15 
16 #include "AliHLTTPCCAParameters.h"
17 
25 {
26  public:
27  AliHLTTPCCATracklet() : fNHits( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fParam() {};
29  fNHits( tv.NHits()[i] ),
30  fFirstRow( tv.FirstRow()[i] ),
31  fLastRow( tv.LastRow()[i] ),
32  fParam( tv.Param(), i )
33  {
34  for ( int row = 0; row < AliHLTTPCCAParameters::MaxNumberOfRows8; ++row ) {
35  fRowHits[row] = tv.HitIndexAtRow( row )[i];
36  }
37  }
38 
39  bool operator<( const AliHLTTPCCATracklet &rhs ) const {
40  return fFirstRow < rhs.fFirstRow ||
41  ( fFirstRow == rhs.fFirstRow && ( fNHits < rhs.fNHits ||
42  ( fNHits == rhs.fNHits && fParam.Chi2() < rhs.fParam.Chi2() ) ) );
43  }
44 
45  int NHits() const { return fNHits; }
46  int FirstRow() const { return fFirstRow; }
47  int LastRow() const { return fLastRow; }
48  const AliHLTTPCCATrackParam &Param() const { return fParam; }
49  short RowHit( int i ) const { return fRowHits[i]; }
50 
51  void SetNHits( int v ) { fNHits = v; }
52  void SetFirstRow( int v ) { fFirstRow = v; }
53  void SetLastRow( int v ) { fLastRow = v; }
54  void SetParam( const AliHLTTPCCATrackParam &v ) { fParam = v; }
55  void SetRowHit( int irow, short ih ) { fRowHits[irow] = ih; }
56 
57  void ClearRowHits() {
58  const short_v zero( Vc::Zero );
59  STATIC_ASSERT( AliHLTTPCCAParameters::MaxNumberOfRows8 % short_v::Size == 0, Size_of_fRowHits_array_needs_to_be_a_multiple_of_short_v__Size );
60  for ( int i = 0; i < AliHLTTPCCAParameters::MaxNumberOfRows8; i += short_v::Size ) {
61  zero.store( &fRowHits[i] );
62  }
63  }
64 
65  private:
66 
67  int fNHits; // N hits
68  int fFirstRow; // first TPC row
69  int fLastRow; // last TPC row
70  AliHLTTPCCATrackParam fParam; // tracklet parameters
71  AliHLTFixedArray<short, AliHLTArraySize<AliHLTTPCCAParameters::MaxNumberOfRows8>, VectorAlignment> fRowHits; // hit index for each TPC row
72 };
73 
74 #endif