00001
00002 #ifndef _CHAMBER_HH_
00003 #define _CHAMBER_HH_
00004
00005
00006
00007
00008
00009
00010
00011 #define GASSIPLEXCHAMBER1 "GASSIPLEXCHAMBER1"
00012 #define GASSIPLEXCHAMBER4 "GASSIPLEXCHAMBER4"
00013 #define HARDROCKCHAMBER6 "HARDROCKCHAMBER6" // 6 Boards per chamber
00014 #define HARDROCKCHAMBER1 "HARDROCKCHAMBER1" // 1 Boards per chamber
00015 #define DIRACCHAMBER1 "DIRACCHAMBER1"
00016 #define DIRAC24 "DIRAC24"
00017
00018
00019 #include "mTypes.h"
00020 #include <string>
00021 class Dif;
00022 class Board;
00023
00024
00025
00026
00027 class Chamber {
00028 friend std::ostream& operator <<(std::ostream& out, const Chamber& x);
00029 friend class Detector;
00030 protected:
00031 Chamber(const i32 xPos, const i32 yPos, const i32 zPos, const ui32 nbColumns, const ui32 nbRows, const i32 id);
00032 Chamber(const Chamber &source);
00033 Chamber& operator =(const Chamber &source);
00034 std::ostream& operator <<(std::ostream& out) const;
00035 virtual ~Chamber() ;
00036
00037
00038 public:
00039
00040 unsigned int getNumberOfBoards() const { return(boards.size()); };
00041 inline BoardMap_t getBoards(void) const { return boards; };
00042
00043 void setDescription(const std::string aDesc) { description = aDesc; };
00044 inline std::string getDescription() const { return description; };
00045 inline std::string getType() const { return type; };
00046
00047 const Channel& getChannelById(const i32 channelId, const i32 chipId = -1, const i32 difId = -1) const;
00048 const BoardMap_t& getBoardsByDifId(const i32 difId) const;
00049 void addDif(Dif *dif);
00050 void addBoard(Board *board);
00051
00052 inline i32 getX(void) const { return xPos; };
00053
00054 inline void setX(const i32 aX) { xPos = aX; };
00055
00056 inline i32 getY(void) const { return yPos; };
00057
00058 inline void setY(const i32 aY) { yPos = aY; };
00059
00060 inline i32 getZ(void) const { return zPos; };
00061
00062 inline void setZ(const i32 aZ) { zPos = aZ; };
00063
00064 inline i32 getId(void) const { return id; };
00065 inline void setId(const i32 aId) { id = aId; };
00066
00067 virtual const ui32 getXLength() const =0;
00068 virtual const ui32 getYLength() const =0;
00069
00070 virtual const ui32 getXGap() const = 0;
00071 virtual const ui32 getYGap() const = 0;
00072
00073 protected:
00074
00075 protected:
00076 i32 xPos, yPos, zPos;
00077 i32 id;
00078 std::string description;
00079 BoardMap_t boards;
00080 std::string type;
00081 ui32 nbColumns, nbRows;
00082 DifMap_t difs;
00083 };
00084
00085 #endif // _CHAMBER_HH_