/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/include/geometry/Board.hh

Go to the documentation of this file.
00001 /* @version $Revision: 1735 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-05-21 15:17:51 +0200 (Mon, 21 May 2012) $ */
00002 
00003 #ifndef _BOARD_HH_
00004 #define _BOARD_HH_
00005 
00006 //////////////////////////////////////////////////////////////////////////
00007 // MICROMEGAS
00008 //
00009 //    Generic board class for Gassiplex, Hardroc and Dirac boards
00010 //
00011 //////////////////////////////////////////////////////////////////////////
00012 // - this class is abstract
00013 //////////////////////////////////////////////////////////////////////////
00014 
00015 #include "mTypes.h"
00016 #include <map>
00017 #include <sstream>
00018 class Chip;
00019 class Channel;
00020 
00021 //////////////////////////////////////////////////////////////////////////
00022 // generic class Board
00023 //////////////////////////////////////////////////////////////////////////
00024 class Board {
00025   friend std::ostream& operator <<(std::ostream& out, const Board& x);
00026   friend class Chamber;
00027   protected :
00028     Board(const Chamber& _chamber, const ui32 aCol, const ui32 aRow, const ui32 nbColumns, const ui32 nbRows,  const i32 aId);
00029     Board(const Board &source); // Constructeur de copie
00030     Board& operator = (const Board &source); // Operateur = de copie
00031     virtual ~Board();  // Un destucteur virtuel permet d'apple le destructeur de la classe derivee
00032     std::ostream& operator << (std::ostream& out) const;
00033 
00034 
00035   //------ methods --------//
00036   public :
00037     inline const Chamber &getChamber() const { return(chamber); };
00038     inline const i32 getId() const { return(id); };
00039     inline const ui32 getColumn() const { return(column); };
00040     inline const ui32 getRow() const { return(row); };
00041 
00042     const float getX() const;
00043     const float getY() const;
00044     const float getLeftBottomX() const;
00045     const float getLeftBottomY() const;
00046     const float getRightUpperX() const;
00047     const float getRightUpperY() const;
00048 
00049     const float getXLength() const;
00050     const float getYLength() const;
00051 
00052     virtual  const float  getXGap() const = 0;
00053     virtual  const float  getYGap() const = 0;
00054 
00055     void addChip(Chip *chip);
00056     inline ChipMap_t getChips(void) const { return chips; };
00057     i32 getMaxChipId(void) const;
00058     i32 getMinChipId(void) const;
00059 
00060     void setDif(Dif *aDif);
00061    inline const Dif * getDif()const  { return dif; } ;
00062 
00063 
00064 
00065     Channel &getChannelById(const i32 channelId, const i32 chipId = -1);
00066     Chip &getChipById(const i32 chipId);
00067     Chip &getChipByRowCol(const i16 row, const i16 col );
00068 
00069     ui32 getNbColumns() const { return nbColumns; }; 
00070     ui32 getNbRows() const { return nbRows; }; 
00071 
00072     const float getXRelative() const;
00073     const float getYRelative() const;
00074 
00075   // ------ data members -------//
00076   protected :
00077     const Chamber& chamber;            /** the chamber to which the board belongs **/
00078     i32 id;                            /** the board id **/
00079     ui32 column, row;                  /** the board position **/
00080     std::map<i32, Chip *> chips;       /** the chip collection which composes the board **/
00081     ui32 nbColumns, nbRows;            /** number of chips row and column **/
00082     Dif *dif;
00083 };
00084 
00085 #endif // _BOARD_HH_
00086 

Generated on Mon Jan 7 13:15:20 2013 for MicromegasFramework by  doxygen 1.4.7