00001
00002
00003 #ifndef _CHIP_HH_
00004 #define _CHIP_HH_
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mTypes.h"
00020 #include <map>
00021 #include "geometry/ChipSoftId.hh"
00022
00023
00024 class Channel;
00025 class Chamber;
00026 class ChipSoftId;
00027
00028
00029
00030
00031 class Chip {
00032 friend std::ostream& operator <<(std::ostream& out, const Chip& x);
00033 friend std::ostream& operator <<(std::ostream& out, const Chip* x);
00034
00035 friend class Board;
00036 protected :
00037 Chip(const Board& _board, const i32 aCol, const i32 aRow, const ui32 nbColumns,const ui32 nbRows ,const i32 aId,const ui32 aSerialNumber);
00038 Chip(const Chip& x);
00039 Chip& operator = (const Chip& x);
00040 std::ostream& operator <<(std::ostream& out) const;
00041 virtual ~Chip();
00042 public :
00043
00044 inline const Board& getBoard() const { return board; };
00045 inline const i32& getId() const { return id; };
00046 inline const ui32& getSerialNumber() const { return serialNum; };
00047 inline void setSerialNumber(ui32 value) { serialNum = value; };
00048
00049 inline const ChipSoftId getChipSoftId() const { return chipSoftId; };
00050 inline ChannelMap_t getChannels(void) const { return channels; };
00051
00052 const float getX() const;
00053 const float getY() const;
00054 const float getLeftBottomX() const;
00055 const float getLeftBottomY() const;
00056 const float getRightUpperX() const;
00057 const float getRightUpperY() const;
00058
00059
00060
00061 const ui32 getColumn(void) const { return column;} ;
00062 const ui32 getRow(void) const { return row;};
00063 Channel &getChannelById(const i32 channelId);
00064
00065
00066 i32 getMaxChannelId(void) const;
00067 i32 getMinChannelId(void) const;
00068
00069
00070 const float getXLength() const ;
00071 const float getYLength() const ;
00072
00073 virtual const ui32 getXGap() const = 0;
00074 virtual const ui32 getYGap() const = 0;
00075
00076 void setGain( const ui32 value) { gain = value;};
00077 ui32 getGain() const{ return gain;};
00078
00079 bool getBypassed() const { return bypassed; };
00080 void setBypassed(bool value) { bypassed = value;};
00081
00082 const ui16 getType() const { return type;};
00083 void setConfigured(bool value ){ configured = value; } ;
00084 bool isConfigured(void ) const { return configured;};
00085
00086 ui32 getNbColumns() const { return nbColumns; };
00087 ui32 getNbRows() const { return nbRows; };
00088
00089 const float getXRelative() const;
00090 const float getYRelative() const;
00091
00092
00093 protected :
00094
00095 bool configured;
00096 const Board& board;
00097 i32 id;
00098 ui32 serialNum;
00099 ui16 type;
00100 ui32 column, row;
00101 std::map<i32, Channel *> channels;
00102 ui32 nbColumns, nbRows;
00103 ChipSoftId chipSoftId;
00104
00105 ui32 gain;
00106 bool bypassed;
00107 };
00108
00109 #endif // _CHIP_HH_