#include <MucIdTransform.h>
Public Member Functions | |
int | GetBoxId (int part, int segment, int layer) |
int | GetBoxId (int part, int segment, int layer) |
int | GetBoxId (int part, int segment, int layer) |
int | GetBoxId (int part, int segment, int layer) |
int | GetId () |
int | GetId () |
int | GetId () |
int | GetId () |
int | GetLayer () |
int | GetLayer () |
int | GetLayer () |
int | GetLayer () |
int | GetPart () |
int | GetPart () |
int | GetPart () |
int | GetPart () |
int | GetSegment () |
int | GetSegment () |
int | GetSegment () |
int | GetSegment () |
int | GetStrip () |
int | GetStrip () |
int | GetStrip () |
int | GetStrip () |
int | GetStripId (int part, int segment, int layer, int subid) |
int | GetStripId (int part, int segment, int layer, int subid) |
int | GetStripId (int part, int segment, int layer, int subid) |
int | GetStripId (int part, int segment, int layer, int subid) |
int | GetStripMax (int part, int segment, int layer) |
int | GetStripMax (int part, int segment, int layer) |
int | GetStripMax (int part, int segment, int layer) |
int | GetStripMax (int part, int segment, int layer) |
MucIdTransform () | |
MucIdTransform () | |
MucIdTransform () | |
MucIdTransform () | |
void | Print (int) |
void | Print (int) |
void | Print (int) |
void | Print (int) |
bool | SetBoxPos (int boxid, int *part, int *segment, int *layer) |
bool | SetBoxPos (int boxid, int *part, int *segment, int *layer) |
bool | SetBoxPos (int boxid, int *part, int *segment, int *layer) |
bool | SetBoxPos (int boxid, int *part, int *segment, int *layer) |
bool | SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid) |
bool | SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid) |
bool | SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid) |
bool | SetStripPos (int stripid, int *part, int *segment, int *layer, int *subid) |
~MucIdTransform () | |
~MucIdTransform () | |
~MucIdTransform () | |
~MucIdTransform () | |
Private Attributes | |
int | m_Id |
int | m_Layer |
int | m_Part |
int | m_Segment |
int | m_Strip |
|
00019 { 00020 m_Id = 0; 00021 m_Part = 0; 00022 m_Segment = 0; 00023 m_Layer = 0; 00024 m_Strip = 0; 00025 }
|
|
00028 { ; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00052 { 00053 int boxId = 0; 00054 for(int i=0; i<part; i++) { 00055 boxId += BOX_PER_PART[i]; 00056 } 00057 00058 if( segment == 0 ) 00059 boxId += layer; 00060 else 00061 boxId += ( segment * BOX_PER_SEG[part] + layer ); 00062 00063 return boxId; 00064 }
|
|
|
|
|
|
|
|
00031 { return m_Id; }
|
|
|
|
|
|
|
|
00034 { return m_Layer; }
|
|
|
|
|
|
|
|
00032 { return m_Part; }
|
|
|
|
|
|
|
|
00033 { return m_Segment; }
|
|
|
|
|
|
|
|
00035 { return m_Strip; }
|
|
|
|
|
|
|
|
00068 { 00069 int strId = 0; 00070 int boxId = 0; 00071 00072 boxId = GetBoxId( part, segment, layer ); 00073 00074 if( part == EEID ) { 00075 strId = boxId*E_STR_NUM + strSubId; 00076 } 00077 else if( part == BRID ) 00078 { 00079 strId = STR_PER_PART[0]; 00080 00081 if( segment > B_TOP ) 00082 strId += segment * B_STR_PER_SEG[0] + E_STR_NUM; 00083 else 00084 strId += segment * B_STR_PER_SEG[0]; 00085 00086 strId += ((1+layer)/2) * B_ZSTR_NUM; 00087 strId += (layer/2) * ( (segment == B_TOP)?B_TOPSTR_NUM:B_PHISTR_NUM ); 00088 00089 strId += strSubId; 00090 } 00091 else { 00092 strId = STR_PER_PART[0] + STR_PER_PART[1]; 00093 strId += (boxId - BOX_SUM[1])*E_STR_NUM + strSubId; 00094 } 00095 00096 return strId; 00097 }
|
|
|
|
|
|
|
|
00039 { 00040 int max = 0; 00041 00042 if( part != BRID ) max = E_STR_NUM; 00043 else if( (layer+1)%2 == 1 ) max = B_ZSTR_NUM; 00044 else if( segment == B_TOP ) max = B_TOPSTR_NUM; 00045 else max = B_PHISTR_NUM; 00046 00047 return max; 00048 }
|
|
|
|
|
|
|
|
00199 { 00200 if( mode == 0 ) // position to id 00201 { 00202 cout << "prt: " << m_Part 00203 << "\tseg: " << m_Segment 00204 << "\tlay: " << m_Layer 00205 << "\tstr: " << m_Strip 00206 << "\tid: " << m_Id << endl; 00207 } 00208 else // id to position 00209 { 00210 cout << "id: " << m_Id 00211 << "\tprt: " << m_Part 00212 << "\tseg: " << m_Segment 00213 << "\tlay: " << m_Layer 00214 << "\tstr: " << m_Strip << endl; 00215 } 00216 }
|
|
|
|
|
|
|
|
00101 { 00102 if( (boxId < 0) || (boxId > BOX_MAX-1) ) 00103 { 00104 *part = 0; 00105 *segment = 0; 00106 *layer = 0; 00107 cout << "box id out range:\t" << boxId << "!" << endl; 00108 return false; 00109 } 00110 00111 // get part 00112 if( boxId < BOX_SUM[0] ) { *part = 0; } 00113 else if( boxId < BOX_SUM[1] ) { *part = 1; boxId -= BOX_SUM[0]; } 00114 else { *part = 2; boxId -= BOX_SUM[1]; } 00115 00116 // get segment and layer 00117 if( *part == BRID ) { 00118 *segment = boxId / B_LAY_NUM; 00119 *layer = boxId % B_LAY_NUM; 00120 } 00121 else { 00122 *segment = boxId / E_LAY_NUM; 00123 *layer = boxId % E_LAY_NUM; 00124 } 00125 00126 return true; 00127 }
|
|
|
|
|
|
|
|
00131 { 00132 if( (stripId < 0) || (stripId > STRIP_MAX-1) ) 00133 { 00134 *part = 0; 00135 *segment = 0; 00136 *layer = 0; 00137 *strSubId = 0; 00138 cout << "strip id out range:\t" << stripId << "!" << endl; 00139 return false; 00140 } 00141 00142 // get part 00143 if( stripId < STR_SUM[0] ) { *part = 0; } 00144 else if ( stripId < STR_SUM[1] ) { *part = 1; stripId -= STR_SUM[0]; } 00145 else { *part = 2; stripId -= STR_SUM[1]; } 00146 00147 // get segment and layer 00148 if( *part == BRID ) 00149 { 00150 int temp = 0; 00151 if ( stripId >= 2*B_STR_PER_SEG[0] && stripId < 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] ) 00152 { 00153 // get segment 00154 *segment = B_TOP; 00155 00156 stripId -= 2*B_STR_PER_SEG[0]; 00157 temp = stripId % ( B_ZSTR_NUM + B_TOPSTR_NUM ); 00158 00159 // get layer 00160 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) ); 00161 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) ) + 1; 00162 00163 // get strip 00164 if( temp < B_ZSTR_NUM ) *strSubId = temp; 00165 else *strSubId = temp - B_ZSTR_NUM; 00166 00167 } // top segment 00168 else 00169 { 00170 if (stripId >= 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] ) stripId -= E_STR_NUM; 00171 00172 // get segment 00173 *segment = stripId / B_STR_PER_SEG[0]; 00174 00175 stripId %= B_STR_PER_SEG[0]; 00176 temp = stripId % ( B_ZSTR_NUM + B_PHISTR_NUM ); 00177 00178 // get layer 00179 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) ); 00180 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) ) + 1; 00181 00182 // get strip 00183 if( temp < B_ZSTR_NUM ) *strSubId = temp; 00184 else *strSubId = temp - B_ZSTR_NUM; 00185 } 00186 } // barrel 00187 else 00188 { 00189 *strSubId = stripId % E_STR_NUM; 00190 *layer = ( stripId / E_STR_NUM ) % E_LAY_NUM ; 00191 *segment = ( stripId / E_STR_NUM ) / E_LAY_NUM ; 00192 } 00193 00194 return true; 00195 }
|
|
|
|
|
|
|
|
|
|
|