00001 /* Class MdcCosGeom describes the geometry of the chamber */ 00002 /* Created by Wu Linghui, 2006/05/28 */ 00003 00004 #ifndef MDCCOSGEOM_H 00005 #define MDCCOSGEOM_H 00006 00007 #include "MdcCosWire.h" 00008 #include "MdcCosLayer.h" 00009 #include "fun.h" 00010 00011 #include <iostream> 00012 #include <string> 00013 #include <vector> 00014 #include <assert.h> 00015 00016 class MdcCosGeom{ 00017 public: 00018 /* constructor */ 00019 MdcCosGeom(std::string fwireconf, std::string fAlign); 00020 00021 /* destructor */ 00022 ~MdcCosGeom(); 00023 00024 bool initialize(double rot); 00025 bool initWire(); 00026 bool initPream(); 00027 bool setTension(); 00028 void check(std::string fchk) const; /* check mdc geometry data */ 00029 00030 const int getLayerSize() const { return m_nLayer; } 00031 const int getWireSize() const { return m_nWire; } 00032 00033 const MdcCosWire* getWire(int iwire) const { return m_pwire[iwire]; } 00034 const MdcCosWire* getWire(int ilay, int icell) const; 00035 00036 const MdcCosLayer* getLayer(int ilay) const { return m_player[ilay]; } 00037 00038 const void getAlignPar(double alignPar[]) const; 00039 00040 private: 00041 bool initAlign(); 00042 00043 /* name of wire config file */ 00044 std::string m_fwconf; 00045 00046 /* name of wire alignment file */ 00047 std::string m_falign; 00048 00049 /* pointer to wire */ 00050 MdcCosWire* m_pwire[WIRENMAX]; 00051 00052 /* pointer to layer */ 00053 MdcCosLayer* m_player[LAYERNMAX]; 00054 00055 int m_nLayer; 00056 int m_nWire; 00057 int m_wiretable[LAYERNMAX][CELLNMAX]; 00058 00059 int m_fan[LAYERNMAX][100]; 00060 00061 /* alignment parameter */ 00062 /* 0-7: TX_east; 8-15: TX_west; 16-23: TY_east; 24-31: TY_west */ 00063 /* 32-39: TZ_east; 40-47: TZ_west; 48-55: RX_east; 56-63: RX_west */ 00064 /* 64-71: RY_east; 72-79: RY_west; 80-87: RZ_east; 88-95: RZ_west */ 00065 double m_alignPar[96]; 00066 00067 double m_rot; 00068 00069 int m_iTXf; /* translation in x of east endplate */ 00070 int m_iTXb; /* translation in x of west endplate */ 00071 int m_iTYf; /* translation in y of east endplate */ 00072 int m_iTYb; /* translation in y of west endplate */ 00073 int m_iTZf; /* translation in z of east endplate */ 00074 int m_iTZb; /* translation in z of west endplate */ 00075 00076 int m_iRXf; /* rotation in x of east endplate */ 00077 int m_iRXb; /* rotation in x of west endplate */ 00078 int m_iRYf; /* rotation in y of east endplate */ 00079 int m_iRYb; /* rotation in y of west endplate */ 00080 int m_iRZf; /* rotation in z of east endplate */ 00081 int m_iRZb; /* rotation in z of west endplate */ 00082 00083 }; 00084 00085 #endif /* MDCCOSGEOM_H */