//-*- Mode: C++ -*- // ***************************************************************************** // * // @Autors: I.Kulakov; M.Zyzak; I.Kisel * // @e-mail: I.Kulakov@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de * // * // ***************************************************************************** #ifndef ALIHLTTPCCATRACKPARAM_H #define ALIHLTTPCCATRACKPARAM_H #include #include "AliHLTTPCCADef.h" #include "AliHLTTPCCAMath.h" #include "AliHLTTPCCATrackParamVector.h" #include "AliHLTTPCCADef.h" #include "ITSCAHits.h" namespace std { template struct char_traits; template class basic_istream; typedef basic_istream > istream; template class basic_ostream; typedef basic_ostream > ostream; } // namespace std /** * @class AliHLTTPCCATrackParam * * AliHLTTPCCATrackParam class describes the track parametrisation * which is used by the AliHLTTPCCATracker slice tracker. * */ class AliHLTTPCCATrackParam { friend std::istream &operator>>( std::istream &, AliHLTTPCCATrackParam & ); friend std::ostream &operator<<( std::ostream &, const AliHLTTPCCATrackParam & ); public: AliHLTTPCCATrackParam() { Reset();} AliHLTTPCCATrackParam( const TrackParamVector &v, int i ) : x( v.X()[i] ), y( v.Y()[i] ), tx( v.Tx()[i] ), ty( v.Ty()[i] ), qp( v.QP()[i] ), z( v.Z()[i] ), C00( v.Cov(0)[i] ), C10( v.Cov(1)[i] ), C11( v.Cov(2)[i] ), C20( v.Cov(3)[i] ), C21( v.Cov(4)[i] ), C22( v.Cov(5)[i] ), C30( v.Cov(6)[i] ), C31( v.Cov(7)[i] ), C32( v.Cov(8)[i] ), C33( v.Cov(9)[i] ), C40( v.Cov(10)[i] ), C41( v.Cov(11)[i] ), C42( v.Cov(12)[i] ), C43( v.Cov(13)[i] ), C44( v.Cov(14)[i] ), chi2( v.Chi2()[i] ), ndf( v.NDF()[i] ), fAlpha( v.Angle()[i] ) {} float X() const { return x; } float Y() const { return y; } float Z() const { return z; } float Tx() const { return tx; } float Ty() const { return ty; } float QP() const { return qp; } float Chi2() const { return chi2; } int NDF() const { return ndf; } float QMomentum() const { return QP(); } // used for triplets comparison float Angle() const { return fAlpha; } float Err2X() const { return C00; } float Err2Y() const { return C11; } float Err2Tx() const { return C22; } float Err2Ty() const { return C33; } float Err2QP() const { return C44; } float Err2QMomentum() const { return Err2QP(); } float Par( int i ) const { switch ( i ) { case 0: return x; case 1: return y; case 2: return tx; case 3: return ty; case 4: return qp; } assert(0); return -1; } float Cov( int i ) const { switch ( i ) { case 0: return C00; case 1: return C10; case 2: return C11; case 3: return C20; case 4: return C21; case 5: return C22; case 6: return C30; case 7: return C31; case 8: return C32; case 9: return C33; case 10: return C40; case 11: return C41; case 12: return C42; case 13: return C43; case 14: return C44; } assert(0); return -1; } void SetCov( int i, float v ) { switch ( i ) { case 0: C00 = v; break; case 1: C10 = v; break; case 2: C11 = v; break; case 3: C20 = v; break; case 4: C21 = v; break; case 5: C22 = v; break; case 6: C30 = v; break; case 7: C31 = v; break; case 8: C32 = v; break; case 9: C33 = v; break; case 10: C40 = v; break; case 11: C41 = v; break; case 12: C42 = v; break; case 13: C43 = v; break; case 14: C44 = v; break; } } void SetX( float v ) { x = v; } void SetY( float v ) { y = v; } void SetZ( float v ) { z = v; } // void SetSinPhi( float v ) { fP[2] = v; } // void SetDzDs( float v ) { fP[3] = v; } // void SetQPt( float v ) { fP[4] = v; } // void SetSignCosPhi( float v ) { fSignCosPhi = v; } void SetChi2( float v ) { chi2 = v; } void SetNDF( int v ) { ndf = v; } // void SetAngle( float v ) { fAlpha = v; } // void SetErr2QPt( float v ) { fC[14] = v; } void Print() const; // void ResetCovMatrix() // { // fC[0] = 10.f; // fC[1] = 0.f; fC[2] = 10.f; // fC[3] = 0.f; fC[4] = 0.f; fC[5] = 1.f; // fC[6] = 0.f; fC[7] = 0.f; fC[8] = 0.f; fC[9] = 1.f; // fC[10] = 0.f; fC[11] = 0.f; fC[12] = 0.f; fC[13] = 0.f; fC[14] = 10.f; // } void Reset() { x=y=tx=ty=qp=z= C00= C10= C11= C20= C21= C22= C30= C31= C32= C33= C40= C41= C42= C43= C44=0.f; ndf = 0; chi2 = -1;} bool TransportToX0Line( float x0 ); bool IsValid() const { return chi2 != -1; } void SetAsInvalid(){ chi2 = -1; } bool Rotate( float ){ return 1; };// don't need rotation in CBM private: float x,y,tx,ty,qp,z, C00, C10, C11, C20, C21, C22, C30, C31, C32, C33, C40, C41, C42, C43, C44; float chi2; // the chi^2 value short ndf; // the Number of Degrees of Freedom float fAlpha; // coor system }; inline bool AliHLTTPCCATrackParam::TransportToX0Line( float x0_out ) { float dz = (x0_out - z); x += tx*dz; y += ty*dz; z += dz; const float dzC32_in = dz * C32; C21 += dzC32_in; C10 += dz * ( C21 + C30 ); const float C20_in = C20; C20 += dz * C22; C00 += dz * ( C20 + C20_in ); const float C31_in = C31; C31 += dz * C33; C11 += dz * ( C31 + C31_in ); C30 += dzC32_in; C40 += dz * C42; C41 += dz * C43; return 1; } typedef AliHLTTPCCATrackParam TrackParam; std::istream &operator>>( std::istream &in, AliHLTTPCCATrackParam &ot ); std::ostream &operator<<( std::ostream &out, const AliHLTTPCCATrackParam &ot ); #endif