Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

AcdId.h

Go to the documentation of this file.
00001 
00002 #ifndef AcdId_H
00003 #define AcdId_H
00004 
00005 #include "TObject.h"
00006 
00044 class AcdId : public TObject {
00045 
00046 private:
00048     UInt_t m_id;  
00050     Char_t m_used;
00052     UShort_t m_readoutIndex;
00054     void setLayer( unsigned int val );
00056     void setFace (unsigned int f);
00058     void setRow( unsigned int r );
00060     void setColumn( unsigned int c );
00061     
00062     // extend the notion of a layer to allow for more than 2 layers - for XGTs for example
00063     enum {
00064         _layermask = 0x1800,
00065         _facemask  = 0x0700,
00066         _rowmask   = 0x00F0,
00067         _colmask   = 0x000F,
00068         layerShift = 11
00069     };
00070     
00071 public:
00072     AcdId();
00073     AcdId(const AcdId& id);
00074     AcdId(short l, short f, short r, short c);
00075     AcdId(UInt_t i, short base=10, short used=1);
00076     virtual ~AcdId() { };
00077     
00079     UInt_t getId(short base = 10) const;
00081     void setId(UInt_t newVal, short used = 1, short base=10);
00083     bool isTop () const;  
00085     bool isSide () const;   
00087     short getLayer () const;     
00089     short getFace() const;
00091     short getRow() const;     
00093     short getColumn () const;   
00095     bool wasConnected() const;
00097     void setConnected(Char_t c);
00099     UShort_t getReadoutIndex() const { return m_readoutIndex; };
00101     void setReadoutIndex(UShort_t i) { m_readoutIndex = i; };
00103     void base10ToAcdId(UInt_t val, short &lay, short &face, short &row, short &col);
00104     
00105     static UShort_t badId;
00106     
00107 private:
00108     inline short int word ( short i, const UInt_t& v ) const
00109     {
00110         short   shft = i*4;
00111         unsigned int  mask = 0x000F << shft;
00112         return (v & mask) >> shft;
00113     }
00114     
00115     void set_word ( short i, UInt_t& v, const UInt_t& s )
00116     {
00117         short   shft = i*4;
00118         unsigned int  mask = 0x000F << shft;
00119         v = ((v & ~mask) | ((s << shft) & mask));
00120     }
00121     
00122     ClassDef(AcdId,3)     // ACD Tile identification information
00123 };
00124 
00125 #endif

Generated at Mon Nov 26 18:19:59 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000