00001 00002 #ifndef CHANNEL_HH 00003 #define CHANNEL_HH 00004 00005 ////////////////////////////////////////////////////////////////////////// 00006 // // 00007 // Channel for MICROMEGAS READOUT // 00008 // // 00009 ////////////////////////////////////////////////////////////////////////// 00010 00011 #ifdef __CINT__ 00012 typedef int __signed__; 00013 #endif 00014 00015 #include "mTypes.h" 00016 #include "TObject.h" 00017 #include <string> 00018 #include <vector> 00019 00020 class Chip; 00021 class Chamber; 00022 class ChannelHit; 00023 00024 ////////////////////////////////////////////////////////////////////////// 00025 /// CLASS Channel // 00026 ////////////////////////////////////////////////////////////////////////// 00027 class Channel { 00028 friend std::ostream& operator <<(std::ostream& out, const Channel& x); 00029 public: 00030 // Channel(const Chip &); 00031 // Channel(const Chip&, const std::string aDesc); 00032 Channel(const Chip&, const std::string description, const i32 aCol, const i32 aRow, const i32 aId); 00033 Channel(const Channel &source); 00034 Channel& operator = (const Channel &source); 00035 virtual ~Channel() ; // Un destucteur virtuel permet d'apple le destructeur de la classe derivee 00036 00037 //------ methods --------// 00038 public: 00039 inline std::string getDescription() const { return description; }; 00040 void print() const; 00041 00042 inline const Chip& getChip() const { return chip; }; 00043 const Chamber& getChamber() const; 00044 00045 inline int getColumn(void) const { return column; }; 00046 inline void setColumn(int aColumn) { column = aColumn; }; 00047 00048 inline int getRow(void) const { return row; }; 00049 inline void setRow(int aRow) { row = aRow; }; 00050 00051 ui32 getHardId(void) const { return hardId; } 00052 /** 00053 * ui32 result = 100000000 * getChamber().getId() 00054 + 1000000 * difId 00055 + 10000 * getChip().getId() 00056 + 100 * getColumn() + getRow() 00057 00058 chamber id < 41 00059 dif id < 100 00060 chip id < 100 00061 colomn < 100 00062 row < 100 00063 **/ 00064 ui32 getSoftId(void) const; 00065 00066 /** X, Y 'world'position **/ 00067 i32 getX() const; 00068 i32 getY() const; 00069 i32 getZ() const; // from chamber only 00070 00071 virtual const ui32 getXLength() const = 0; 00072 virtual const ui32 getYLength() const = 0 ; 00073 00074 virtual bool valueIsValid(const int value) { return(0); }; 00075 00076 // ChannelHit& getCorrespondingChannelHit(vector < ChannelHit* > &vec ) const ; 00077 // int getOrder(Event) 00078 // void sortChannelFromChannelHit(vector<Channel*>& vec,vector<ChannelHit*>& channelHits); 00079 00080 // ------ data members -------// 00081 protected: 00082 const Chip& chip; /** the chip this channel belongs to **/ 00083 std::string description; /** short description **/ 00084 ui32 hardId; /** unique within a chamber **/ 00085 ui32 column, row; /** column and row inside its container **/ 00086 /** Z position is done by the corresponding Chamber **/ 00087 00088 00089 }; 00090 #endif