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

Go to the documentation of this file.
00001 /* @version $Revision: 1700 $ * @modifiedby $Author: lcdet $ * @lastmodified $Date: 2012-05-02 16:38:35 +0200 (Wed, 02 May 2012) $ */
00002 
00003 #ifndef _CHAMBER_HH_
00004 #define _CHAMBER_HH_
00005 
00006 //////////////////////////////////////////////////////////////////////////
00007 //                                                                      //
00008 // Chamber  for MICROMEGAS READOUT                                      //
00009 //                                                                      //
00010 //////////////////////////////////////////////////////////////////////////
00011 
00012 #define GASSIPLEXCHAMBER1                 "GASSIPLEXCHAMBER1"
00013 #define GASSIPLEXCHAMBER4                   "GASSIPLEXCHAMBER4"
00014 #define GASSIPLEXSTRIPCHAMBER1  "GASSIPLEXSTRIPCHAMBER1" // 2 GassiplexStripBoard 
00015 #define HARDROC1CHAMBER                 "HARDROC1CHAMBER"       // 1 Asu ( PCB ) per chamber,  4 HR1 per asu, 1 Dif
00016 #define HARDROC2CHAMBER1                "HARDROC2CHAMBER1"      // 1 Asu ( PCB ) per chamber, 24 HR2 per asu, 1 Dif
00017 #define HARDROC2CHAMBER2                "HARDROC2CHAMBER2"      // 2 Asu ( PCB ) per chamber, 24 HR2 per asu, 2 Dif
00018 #define HARDROC2CHAMBER6                "HARDROC2CHAMBER6"      // 6 Asu ( PCB ) per chamber, 24 HR2 per asu, 3 Dif
00019 #define HARDROC2IPNLCHAMBER6  "HARDROC2IPNLCHAMBER6"  // 6 Asu ( PCB ) per chamber, 24 HR2 IPNL  per asu, 3 Dif
00020 #define MICROROCCHAMBER1                "MICROROCCHAMBER1"      // 1 Asu ( PCB ) per chamber, 24 Microroc per asu, 1 Dif
00021 #define MICROROCCHAMBER6                "MICROROCCHAMBER6"      // 6 Asu ( PCB ) per chamber, 24 Microroc per asu, 3 Dif
00022 #define MICROROCTESTCHAMBER             "MICROROCTESTCHAMBER"   // 1 Asu ( PCB ) per chamber, 1 Microroc per asu, 1 Dif
00023 #define METRECARRECHAMBER               "METRECARRECHAMBER"     //5 Asu ( PCB ) per chamber, 24 HR2 per asu, 3 Dif
00024 #define DIRACCHAMBER1                   "DIRACCHAMBER1"
00025 #define DIRAC24                         "DIRAC24"
00026 #define MONITORINGDEVICE        "MONITORINGDEVICE"
00027 
00028 
00029 #include "mTypes.h"
00030 #include <string>
00031 class Dif;
00032 class Board;
00033 
00034 //////////////////////////////////////////////////////////////////////////
00035 ///     CLASS CHAMBER                                                   //
00036 //////////////////////////////////////////////////////////////////////////
00037 class Chamber {
00038   friend std::ostream& operator <<(std::ostream& out, const Chamber& x);
00039   friend class Detector;
00040   protected:
00041     Chamber(const float xPos, const float yPos, const float zPos,bool  xRotation,const bool yRotation,const i16 zRotation, const ui32 nbColumns, const ui32 nbRows, const i32 id);
00042     Chamber(const Chamber &source); // Constructeur de copie
00043     Chamber& operator =(const Chamber &source); // Operateur = de copie
00044     std::ostream& operator <<(std::ostream& out) const;
00045     virtual ~Chamber() ;  // Un destucteur virtuel permet d'apple le destructeur de la classe derivee
00046 
00047   //------ methods --------//
00048   public:
00049     // Methodes virtuelles pures. Chaque classe derivee doit obligatoirement implementer ces methodes
00050     const float  getXLength() const ;
00051     const float  getYLength() const ;
00052 
00053     virtual  const float getXGap() const = 0;
00054     virtual const float  getYGap() const = 0;
00055 
00056     operator bool () const { return myIsValid; }
00057     bool operator! () const {  return !myIsValid; }
00058     bool isValid () const {  return myIsValid; }
00059 
00060     unsigned int getNumberOfBoards() const { return(boards.size()); };
00061     virtual unsigned int getNumberOfGassiplexBoards() const { return 0; }; // only reimplement in GassioplexBoard* class
00062     inline BoardMap_t getBoards(void) const { return boards; };
00063 
00064     void setDescription(const std::string aDesc) { description = aDesc; };
00065     inline std::string getDescription() const { return description; };
00066     inline std::string getType() const { return type; };
00067 
00068     const Channel& getChannelById(const i32 channelId, const i32 chipId = -1, const i32 difId = -1) const;
00069     const BoardMap_t& getBoardsByDifId(const i32 difId) const;
00070     void addDif(Dif *dif);
00071     Dif* getDif(i32 key)const { return difs.find(key)->second; } ;
00072     DifMap_t getDifs()const { return difs ;} ;
00073                 const Dif& getDifById(const i32 difId) const;
00074     void addBoard(Board *board);
00075 
00076     float getX() const;
00077     inline void setX(const float aX) { xPos = aX; };
00078 
00079     //inline float getY(void) const { return yPos; };
00080     float getY() const ;
00081     inline void setY(const float aY) { yPos = aY; };
00082 
00083     inline float getZ(void) const { return zPos; };
00084     //inline const i32 getZWorld() const { return zPos; };
00085     inline void setZ(const float aZ) { zPos = aZ; };
00086 
00087     const float getLeftBottomX() const;
00088     const float getLeftBottomY() const;
00089     const float getRightUpperX() const;
00090     const float getRightUpperY() const;
00091 
00092     inline i32 getId(void) const { return id; };
00093     inline void setId(const i32 aId) { id = aId; };
00094 
00095                 inline bool getXrotation() const { return xRotation ;};
00096                 inline void setXrotation(bool val) {  xRotation = val;};
00097 
00098     inline bool getYrotation() const { return yRotation  ; };
00099                 inline void setYrotation(bool val) {  yRotation = val;};
00100 
00101     inline i16 getZrotation() const { return zRotation  ; };
00102     inline void setZrotation(i16 val) {  zRotation = val;};
00103 
00104 
00105 //    float getMaxX(void) const;
00106 //    float getMaxY(void) const;
00107 
00108    inline  ui32 getNbColumns(void)  const { return nbColumns; };
00109    inline  ui32 getNbRows(void) const  { return nbRows; };
00110 
00111 
00112 
00113 
00114   protected:
00115   // ------ data members -------//
00116   protected:
00117     float xPos, yPos, zPos;              /** the chamber position **/
00118                 bool xRotation;
00119                 bool yRotation;
00120                 i16 zRotation;
00121     i32 id;                            /** the chamber unique id **/
00122     std::string description;           /** short description **/
00123     BoardMap_t boards;                 /** the list of boards which compose the chamber **/
00124     std::string type;                  /** the type of the chamber **/
00125     ui32 nbColumns, nbRows;            /** number of  board row and column **/
00126     DifMap_t difs;                     /** the list of difs which compose the chamber (Hardroc and Dirac only) **/
00127     bool myIsValid;
00128 }; // class Chamber
00129 
00130 #endif // _CHAMBER_HH_

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