00001 //----------------------------------------------------------------------------- 00002 // $Id: TMDCLayer.h,v 1.4 2010/03/31 09:58:59 liucy Exp $ 00003 //----------------------------------------------------------------------------- 00004 // Filename : TMDCLayer.h 00005 // Section : Tracking MDC 00006 // Owner : Yoshi Iwasaki 00007 // Email : yoshihito.iwasaki@kek.jp 00008 //----------------------------------------------------------------------------- 00009 // Description : A class to represent a wire layer. 00010 // See http://bsunsrv1.kek.jp/~yiwasaki/tracking/ 00011 //----------------------------------------------------------------------------- 00012 00013 #ifndef TMDCLayer_FLAG_ 00014 #define TMDCLayer_FLAG_ 00015 00016 #ifdef TRKRECO_DEBUG_DETAIL 00017 #ifndef TRKRECO_DEBUG 00018 #define TRKRECO_DEBUG 00019 #endif 00020 #endif 00021 00022 #include <string> 00023 00024 #define HEP_SHORT_NAMES 00025 #include "CLHEP/Alist/AList.h" 00026 00027 class TMDCWire; 00028 //struct geocdc_layer; 00029 class MdcGeoLayer; 00030 00032 class TMDCLayer : public AList<TMDCWire> { 00033 00034 public: 00036 TMDCLayer(const MdcGeoLayer *); 00037 00039 virtual ~TMDCLayer(); 00040 00041 public:// Selectors 00043 unsigned id(void) const; 00044 00046 unsigned superLayerId(void) const; 00047 00049 unsigned localLayerId(void) const; 00050 00052 unsigned axialStereoLayerId(void) const; 00053 00055 unsigned nWires(void) const; 00056 00058 const TMDCWire * const wire(int id) const; 00059 00061 bool axial(void) const; 00062 00064 bool stereo(void) const; 00065 00067 float offset(void) const; 00068 00070 float cellSize(void) const; 00071 00073 const MdcGeoLayer * geocdc(void) const; 00074 00076 void dump(const std::string & message = std::string(""), 00077 const std::string & prefix = std::string("")) const; 00078 00079 public:// Modifiers 00080 00081 private: 00082 const MdcGeoLayer * _geo; 00083 00084 unsigned _id; 00085 //_type=0 axial; _type=1 stereo; 00086 unsigned _type; 00087 unsigned _superLayerId; 00088 unsigned _localLayerId; 00089 unsigned _axialStereoLayerId; 00090 00091 float _offset; 00092 float _cellSize; 00093 unsigned _nWires; 00094 }; 00095 00096 //----------------------------------------------------------------------------- 00097 00098 #ifdef TMDCLayer_NO_INLINE 00099 #define inline 00100 #else 00101 #undef inline 00102 #define TMDCLayer_INLINE_DEFINE_HERE 00103 #endif 00104 00105 #ifdef TMDCLayer_INLINE_DEFINE_HERE 00106 00107 inline 00108 unsigned 00109 TMDCLayer::id(void) const { 00110 return _id; 00111 } 00112 00113 inline 00114 unsigned 00115 TMDCLayer::superLayerId(void) const { 00116 return _superLayerId; 00117 } 00118 00119 inline 00120 unsigned 00121 TMDCLayer::localLayerId(void) const { 00122 return _localLayerId; 00123 } 00124 00125 inline 00126 const MdcGeoLayer * 00127 TMDCLayer::geocdc(void) const { 00128 return _geo; 00129 } 00130 00131 inline 00132 float 00133 TMDCLayer::offset(void) const { 00134 return _offset; 00135 } 00136 00137 inline 00138 unsigned 00139 TMDCLayer::nWires(void) const { 00140 return _nWires; 00141 } 00142 00143 inline 00144 bool 00145 TMDCLayer::axial(void) const { 00146 // cout<<"zsl,axial:"<<_superLayerId<<endl; 00147 // if (_superLayerId % 2) return false; 00148 if (_type==1) return false; 00149 return true; 00150 } 00151 00152 inline 00153 bool 00154 TMDCLayer::stereo(void) const { 00155 // cout<<"zsl,stereo:"<<_superLayerId<<endl; 00156 // if (_superLayerId % 2) return true; 00157 if (_type==1) return true; 00158 return false; 00159 } 00160 00161 inline 00162 unsigned 00163 TMDCLayer::axialStereoLayerId(void) const { 00164 return _axialStereoLayerId; 00165 } 00166 00167 inline 00168 float 00169 TMDCLayer::cellSize(void) const { 00170 return _cellSize; 00171 } 00172 00173 #endif 00174 00175 #undef inline 00176 00177 #endif /* TMDCLayer_FLAG_ */ 00178