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

Go to the documentation of this file.
00001 /* @version $Revision: 1399 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-12-18 18:05:40 +0100 (Sun, 18 Dec 2011) $ */
00002 
00003 #ifndef _CHIP_HH_
00004 #define _CHIP_HH_
00005 
00006 //////////////////////////////////////////////////////////////////////////
00007 // MICROMEGAS
00008 //
00009 //    Generic chip class for Gassiplex, Hardroc and Dirac chips
00010 //
00011 //////////////////////////////////////////////////////////////////////////
00012 // - this class is abstract
00013 // - the Gassiplex chip does not exist by itself, one channel corresponds
00014 //   to one chip
00015 // - Hardroc and Dirac boards usually contain 24 chips. Chip Id is unique
00016 //   for every Dif.
00017 //////////////////////////////////////////////////////////////////////////
00018 
00019 #include "mTypes.h"
00020 #include <map>
00021 #include "geometry/ChipSoftId.hh"
00022 //include <TreeClass.hh>
00023 
00024 class Channel;
00025 class Chamber;
00026 class ChipSoftId;
00027 
00028 //////////////////////////////////////////////////////////////////////////
00029 // generic class Chip
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     //----- methods -------------------//
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     //void setSerialNumber(ui16 value) { serialNum = value;} ;
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     //---- data members --------------//
00095     bool configured;
00096     const Board& board;                /** the board containing this chip **/
00097     i32 id;                            /** unique chip Id for every Dif */
00098     ui32 serialNum;                 /** unique chip serial number  */
00099     ui16 type;
00100     ui32 column, row;                   /** chip position inside the board **/
00101     std::map<i32, Channel *> channels;  /** sorted channel list */
00102     ui32 nbColumns, nbRows;            /** number of channels row and column **/
00103         ChipSoftId chipSoftId;
00104 
00105     ui32 gain;
00106     bool bypassed;
00107 }; // class Chip
00108 
00109 #endif // _CHIP_HH_

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