/* Copyright (C) 2009 Matthias Kretz This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) version 3. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ALIHLTTPCCAHITID_H #define ALIHLTTPCCAHITID_H #include "AliHLTVector.h" class AliHLTTPCCAHitId { public: inline void Set( unsigned short row, unsigned short hit ) { fRow = row; fHit = hit; } inline short RowIndex() const { return fRow; } inline unsigned short HitIndex() const { return fHit; } inline bool operator<( const AliHLTTPCCAHitId &rhs ) const { const int rowStep = AliHLTTPCCAParameters::RowStep; assert( rowStep <= 2 ); if (rowStep == 2){ return ( fRow & 1 ) < ( rhs.fRow & 1 ) || ( ( fRow & 1 ) == ( rhs.fRow & 1 ) && fRow < rhs.fRow ); } else{ return ( fRow < rhs.fRow ); } } short fRow; unsigned short fHit; // index of hit in row array. Use data.ClusterDataIndex( row, iHit ) in order to obtain index in the slice array. }; typedef AliHLTTPCCAHitId HitId; // ArBB TODO find a right place #include "AliHLTTPCCADef.h" #include using arbb::bind; using arbb::dense; using arbb::i16; using arbb::u16; class AliHLTTPCCAHitId_ArBB { public: AliHLTTPCCAHitId_ArBB(): fRow(0), fHit(-1) {}; AliHLTTPCCAHitId_ArBB( TRowI_ArBB row, THitI_ArBB hit ): fRow(row), fHit(hit) {}; // AliHLTTPCCAHitId_ArBB select( arbb::boolean mask, const AliHLTTPCCAHitId_ArBB& a, const AliHLTTPCCAHitId_ArBB& b) { // AliHLTTPCCAHitId_ArBB r; // r.fRow = select( mask, a.fRow, b.fRow ); // r.fHit = select( mask, a.fHit, b.fHit ); // return r; // } template< size_t D > class TDense; friend class TDense<1>; // ARBB_ELTWISE_METHOD_3( AliHLTTPCCAHitId_ArBB, AliHLTTPCCAHitId_ArBB, select, arbb::boolean, const AliHLTTPCCAHitId_ArBB&, const AliHLTTPCCAHitId_ArBB_help& ) private: TRowI_ArBB fRow; THitI_ArBB fHit; // index of hit in row array. Use data.ClusterDataIndex( row, iHit ) in order to obtain index in the slice array. typedef u16 TArtKey; TArtKey ArtKey(); }; ARBB_UDT_DENSE_2(AliHLTTPCCAHitId_ArBB, TRowI_ArBB, Row, THitI_ArBB, Hit) #endif // ALIHLTTPCCAHITID_H