//-*- Mode: C++ -*- // @(#) $Id: AliHLTTPCCATrack.h,v 1.2 2010/08/09 17:51:15 mzyzak Exp $ // ************************************************************************ // This file is property of and copyright by the ALICE HLT Project * // ALICE Experiment at CERN, All rights reserved. * // See cxx source for full Copyright notice * // * //************************************************************************* #ifndef ALIHLTTPCCATRACK_H #define ALIHLTTPCCATRACK_H #include "AliHLTTPCCADef.h" #include "AliHLTTPCCATrackParam.h" #include "AliHLTTPCCAParameters.h" #include "AliHLTTPCCAHitId.h" #include "AliHLTArray.h" /** * @class ALIHLTTPCCAtrack * * The class describes the [partially] reconstructed TPC track [candidate]. * The class is dedicated for internal use by the AliHLTTPCCATracker algorithm. */ class AliHLTTPCCATrack { // friend class AliHLTTPCCATrackletSelector; public: AliHLTTPCCATrack() : fNumberOfHits( 0 ) {} short NumberOfHits() const { return fNumberOfHits; } const AliHLTTPCCATrackParam &Param() const { return fParam; }; const AliHLTTPCCAHitId &HitId( int i ) const { return fHitIdArray[i]; } AliHLTTPCCATrackParam &Param() { return fParam; }; AliHLTFixedArray > &HitIdArray() { return fHitIdArray; }; void SetNumberOfHits(short s){ fNumberOfHits = s; } private: AliHLTTPCCATrackParam fParam; // track parameters AliHLTFixedArray > fHitIdArray; short fNumberOfHits; // number of hits in the track // disallow copy AliHLTTPCCATrack( const AliHLTTPCCATrack & ); AliHLTTPCCATrack &operator=( const AliHLTTPCCATrack & ); }; typedef AliHLTTPCCATrack Track; // -- arbb part TODO find right place #include using arbb::bind; using arbb::dense; using arbb::f32; using arbb::i16; using arbb::u16; #include "AliHLTTPCCATrackParamArBB.h" #include "AliHLTTPCCAHitId.h" class AliHLTTPCCATrack_ArBB { friend class Reconstructor; friend class AliHLTTPCCATrackletSelector; public: AliHLTTPCCATrack_ArBB(){} const dense& NumberOfHits() const { return fNumberOfHits; } const AliHLTTPCCATrackParamArBB &Param() const { return fParam; }; AliHLTTPCCAHitId_ArBB::TDense<1> HitId( TRowI_ArBB i ) const { return fHitIdArray.col(i); }; AliHLTTPCCAHitId_ArBB::TDense<2> &HitIdArray() { return fHitIdArray; }; void SetHitId( TRowI_ArBB i, const dense& rows, const dense& hits, const dense& mask ) { AliHLTTPCCAHitId_ArBB::TDense<1> hitId(rows.length()); hitId.SetRow( select( mask, rows, HitId(i).Row() ) ); hitId.SetHit( select( mask, hits, HitId(i).Hit() ) ); fHitIdArray = replace_col( fHitIdArray, i, hitId ); }; void Resize( u16 n ) { fParam.Resize(n); fHitIdArray = reshape( fill( AliHLTTPCCAHitId_ArBB(), AliHLTTPCCAParameters::NumberOfRows*n ), AliHLTTPCCAParameters::NumberOfRows, n ); fNumberOfHits = fill(0,n); }; void Pack( const dense& mask ) { fParam.Pack(mask); { const dense packed = pack( fHitIdArray.flatten(), repeat( mask, AliHLTTPCCAParameters::NumberOfRows, false ) ); fHitIdArray = reshape( packed, AliHLTTPCCAParameters::NumberOfRows, packed.length()/AliHLTTPCCAParameters::NumberOfRows ); } fNumberOfHits = pack(fNumberOfHits,mask); } private: AliHLTTPCCATrackParamArBB fParam; // track parameters AliHLTTPCCAHitId_ArBB::TDense<2> fHitIdArray; // array of hits on row. each column in array = row in TPC, each row in array = track // TODO rearange? dense fNumberOfHits; // number of hits in the track // disallow copy AliHLTTPCCATrack_ArBB( const AliHLTTPCCATrack_ArBB & ); AliHLTTPCCATrack_ArBB &operator=( const AliHLTTPCCATrack_ArBB & ); }; #endif