//-*- Mode: C++ -*- // $Id: AliHLTTPCCAGBHit.h,v 1.2 2010/09/01 10:38:27 ikulakov 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 ALIHLTTPCCAGBHIT_H #define ALIHLTTPCCAGBHIT_H #include "AliHLTTPCCADef.h" #include "AliHLTTPCCAMath.h" #include "ITSCAStrip.h" #include using std::ostream; using std::istream; /** * @class AliHLTTPCCAGBHit * * The AliHLTTPCCAGBHit class is the internal representation * of the TPC clusters for the AliHLTTPCCAGBTracker algorithm. * */ class AliHLTTPCCAGBHit { public: AliHLTTPCCAGBHit() : fX( 0 ), fY( 0 ), fZ( 0 ), fErr2X( 0 ), fErr2Y( 0 ), fErr2Z( 0 ), fIRow( 0 ), fID( 0 ), fPhi( 0 ) {} float X() const { return fX; } float Y() const { return fY; } float Z() const { return fZ; } float Err2X() const { return fErr2X; } float Err2Y() const { return fErr2Y; } float Err2Z() const { return fErr2Z; } float Err2X0() const { return fErr2Z; } float Err2X1() const { return fErr2X; } float Err2X2() const { return fErr2Y; } int IRow() const { return fIRow; } int ID() const { return fID; } ITSCAStrip* BStripP() const { return fBStripP; } ITSCAStrip* FStripP() const { return fFStripP; } void SetX( float v ) { fX = v; } void SetY( float v ) { fY = v; } void SetZ( float v ) { fZ = v; } void SetErr2X( float v ) { fErr2X = v; } void SetErr2Y( float v ) { fErr2Y = v; } void SetErr2Z( float v ) { fErr2Z = v; } void SetIRow( int v ) { fIRow = v; } void SetID( int v ) { fID = v; } void SetFStripP( ITSCAStrip* s ) { fFStripP = s; } void SetBStripP( ITSCAStrip* s ) { fBStripP = s; } float Angle() const { return fPhi; } void GetLocalX0X1X2( float& x0, float& x1, float &x2 ) const; static bool Compare( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b ); /// \brief Hits reordering in accordance with the geometry and the track-finder needs: /// Hits are sorted by sector number at first, than by row number and at last by z-coordinate static bool CompareRowDown( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b ) { return ( a.fIRow > b.fIRow ); /// Hits are sorted by row number } static bool ComparePRowDown( const AliHLTTPCCAGBHit *a, const AliHLTTPCCAGBHit *b ) { return ( a->fIRow > b->fIRow ); /// Hits are sorted by row number } friend ostream& operator<<(ostream& out, const AliHLTTPCCAGBHit &a); friend istream& operator>>(istream& in, AliHLTTPCCAGBHit &a); protected: ITSCAStrip* fFStripP, *fBStripP; float fX; //* X position float fY; //* Y position float fZ; //* Z position float fErr2X; //* X position error^2 float fErr2Y; float fErr2Z; int fIRow; //* row number int fID; //* external ID (id of AliTPCcluster) float fPhi; }; inline bool AliHLTTPCCAGBHit::Compare( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b ) /// \brief Hits reordering in accordance with the geometry and the track-finder needs: /// Hits are sorted by sector number at first, than by row number and at last by z-coordinate. { //* Comparison function for sorting hits if ( a.fIRow < b.fIRow ) return 1; if ( a.fIRow > b.fIRow ) return 0; return ( a.fZ < b.fZ ); } #endif