//-*- 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 ITSCATES_H #define ITSCATES_H struct TES { // Type for an Element on Station TES(): s(-1), e(-1){} TES( char is, unsigned short int ie ): s(is), e(ie){} TES( unsigned short int ie, char is ): s(is), e(ie){} // to prevent confusion operator unsigned short int() { return e; } friend bool operator!=( const TES& a, const TES& b ) { return (a.s != b.s) || (a.e != b.e); } char s; // index of station unsigned short int e; // index of element }; struct TESV { // Type for an Element on Station TESV(): s(-1), e(-1){} TESV( TES i ): s(i.s), e(i.e){} TESV( short_v is, ushort_v ie ): s(is), e(ie){} TESV( ushort_v ie, short_v is ): s(is), e(ie){} // to prevent confusion operator ushort_v() const { return e; } TES operator[](int i) const { return TES(s[i],e[i]); } sfloat_m IsValid() const { return static_cast(s >= Vc::Zero); } friend sfloat_m operator==( const TESV& a, const TES& b ) { return (a.s == static_cast(b.s)) & (a.e == b.e); } short_v s; // index of station ushort_v e; // index of element }; #endif