00001 /* @version $Revision: 1759 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-06-04 16:49:12 +0200 (Mon, 04 Jun 2012) $ */ 00002 00003 #ifndef CHANNEL_HH 00004 #define CHANNEL_HH 00005 00006 ////////////////////////////////////////////////////////////////////////// 00007 // // 00008 // Channel for MICROMEGAS READOUT // 00009 // // 00010 ////////////////////////////////////////////////////////////////////////// 00011 00012 #ifdef __CINT__ 00013 typedef int __signed__; 00014 #endif 00015 00016 #include "mTypes.h" 00017 //#include "TObject.h" 00018 #include <string> 00019 #include <vector> 00020 //#include <TreeClass.hh> 00021 #include "geometry/ChannelSoftId.hh" 00022 00023 00024 00025 class Chip; 00026 class Chamber; 00027 class ChannelHit; 00028 00029 ////////////////////////////////////////////////////////////////////////// 00030 /// CLASS Channel // 00031 ////////////////////////////////////////////////////////////////////////// 00032 class Channel { 00033 friend std::ostream& operator <<(std::ostream& out, const Channel& x); 00034 public: 00035 // Channel(const Chip &); 00036 // Channel(const Chip&, const std::string aDesc); 00037 Channel(const Chip&, const std::string description, const i32 aCol, const i32 aRow, const i32 aId); 00038 Channel(const Channel &source); 00039 Channel& operator = (const Channel &source); 00040 virtual ~Channel() ; // Un destucteur virtuel permet d'apple le destructeur de la classe derivee 00041 00042 //------ methods --------// 00043 public: 00044 inline std::string getDescription() const { return description; }; 00045 void print() const; 00046 00047 inline const Chip& getChip() const { return chip; }; 00048 const Chamber& getChamber() const; 00049 00050 inline int getColumn(void) const { return column; }; 00051 inline void setColumn(int aColumn) { column = aColumn; }; 00052 00053 // Get row / column inside chip 00054 inline int getRow(void) const { return row; }; 00055 inline void setRow(int aRow) { row = aRow; }; 00056 00057 ui32 getHardId(void) const { return hardId; } 00058 00059 const ChannelSoftId& getSoftId (void)const { return channelSoftId; }; 00060 00061 00062 00063 // std::string getStringSoftId() const; 00064 00065 /** X, Y 'world'position **/ 00066 const float getX() const; 00067 const float getY() const; 00068 float getZ() const; // from chamber only 00069 00070 const float getLeftBottomX() const; 00071 const float getLeftBottomY() const; 00072 const float getRightUpperX() const; 00073 const float getRightUpperY() const; 00074 00075 00076 // Get row / column inside chamber 00077 const ui16 getColInChamberRelative() const; // along side Y axis in this franework, without rotation 00078 const ui16 getRowInChamberRelative() const; // along side X axis in this franework, without rotation 00079 00080 const ui16 getColInChamber() const; // along side Y axis in this franework, with rotation 00081 const ui16 getRowInChamber() const; // along side Y axis in this franework, with rotation 00082 00083 virtual const ui32 getXLength() const = 0; // in micrometer 00084 virtual const ui32 getYLength() const = 0 ; 00085 00086 virtual bool valueIsValid(const int value) { return(0); }; 00087 00088 bool getEnable()const { return enable;}; 00089 bool getStimulate()const { return stimulate;}; 00090 unsigned int getPedestalOffset() const {return pedestal_offset;}; 00091 00092 void setEnable(bool _value) { enable = _value; }; 00093 void setStimulate(bool _value) { stimulate = _value; }; 00094 void setPedestalOffset( unsigned int value) { pedestal_offset = value; }; 00095 00096 const float getXRelative() const; 00097 const float getYRelative() const; 00098 00099 00100 // ------ data members -------// 00101 protected: 00102 const Chip& chip; /** the chip this channel belongs to **/ 00103 std::string description; /** short description **/ 00104 ui32 hardId; /** unique within a chamber **/ 00105 ui32 column, row; /** column and row inside its container **/ 00106 /** Z position is done by the corresponding Chamber **/ 00107 00108 bool enable; // Unquement valable pour dirac et Hardroc, pour microroc c'est trois value MASK0, MASK1 et MASK2 00109 bool stimulate; 00110 unsigned int pedestal_offset; // 4 bits 00111 00112 ChannelSoftId channelSoftId; 00113 00114 00115 00116 }; 00117 #endif