StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCAHitId.h
1 /*
2  Copyright (C) 2009 Matthias Kretz <kretz@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) version 3.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 
19 */
20 
21 #ifndef ALIHLTTPCCAHITID_H
22 #define ALIHLTTPCCAHITID_H
23 
25 {
26  public:
27  inline void Set( unsigned short row, unsigned short hit ) { fRow = row; fHit = hit; }
28  inline short RowIndex() const { return fRow; }
29  inline unsigned short HitIndex() const { return fHit; }
30 
31  inline bool operator<( const AliHLTTPCCAHitId &rhs ) const {
32  const int rowStep = AliHLTTPCCAParameters::RowStep;
33  assert( rowStep <= 2 );
34  if (rowStep == 2){
35  return ( fRow & 1 ) < ( rhs.fRow & 1 )
36  || ( ( fRow & 1 ) == ( rhs.fRow & 1 ) && fRow < rhs.fRow );
37  }
38  else{
39  return ( fRow < rhs.fRow );
40  }
41  }
42 
43  short fRow;
44  unsigned short fHit; // index of hit in row array. Use data.ClusterDataIndex( row, iHit ) in order to obtain index in the slice array.
45 };
46 
47 typedef AliHLTTPCCAHitId HitId;
48 
49 #endif // ALIHLTTPCCAHITID_H