43 if( part !=
BRID )
max = E_STR_NUM;
45 else if( segment == B_TOP )
max = B_TOPSTR_NUM;
46 else max = B_PHISTR_NUM;
55 for(
int i=0; i<part; i++) {
56 boxId += BOX_PER_PART[i];
62 boxId += ( segment * BOX_PER_SEG[part] + layer );
73 boxId =
GetBoxId( part, segment, layer );
77 strId = boxId*E_STR_NUM + strSubId;
79 else if( part ==
BRID )
81 strId = STR_PER_PART[0];
84 strId += segment * B_STR_PER_SEG[0] + E_STR_NUM;
86 strId += segment * B_STR_PER_SEG[0];
89 strId += (layer/2) * ( (segment == B_TOP)?B_TOPSTR_NUM:B_PHISTR_NUM );
95 strId = STR_PER_PART[0] + STR_PER_PART[1];
96 strId += (boxId - BOX_SUM[1])*E_STR_NUM + strSubId;
106 if( (boxId < 0) || (boxId > BOX_MAX-1) )
111 cout <<
"box id out range:\t" << boxId <<
"!" << endl;
116 if( boxId < BOX_SUM[0] ) { *part = 0; }
117 else if( boxId < BOX_SUM[1] ) { *part = 1; boxId -= BOX_SUM[0]; }
118 else { *part = 2; boxId -= BOX_SUM[1]; }
138 if( (stripId < 0) || (stripId >
STRIP_MAX-1) )
144 cout <<
"strip id out range:\t" << stripId <<
"!" << endl;
149 if( stripId < STR_SUM[0] ) { *part = 0; }
150 else if ( stripId < STR_SUM[1] ) { *part = 1; stripId -= STR_SUM[0]; }
151 else { *part = 2; stripId -= STR_SUM[1]; }
157 if ( stripId >= 2*B_STR_PER_SEG[0] && stripId < 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] )
162 stripId -= 2*B_STR_PER_SEG[0];
163 temp = stripId % (
B_ZSTR_NUM + B_TOPSTR_NUM );
167 else *layer = 2*( stripId / (
B_ZSTR_NUM + B_TOPSTR_NUM ) ) + 1;
176 if (stripId >= 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] ) stripId -= E_STR_NUM;
179 *segment = stripId / B_STR_PER_SEG[0];
181 stripId %= B_STR_PER_SEG[0];
182 temp = stripId % (
B_ZSTR_NUM + B_PHISTR_NUM );
186 else *layer = 2*( stripId / (
B_ZSTR_NUM + B_PHISTR_NUM ) ) + 1;
195 *strSubId = stripId % E_STR_NUM;
196 *layer = ( stripId / E_STR_NUM ) %
E_LAY_NUM ;
197 *segment = ( stripId / E_STR_NUM ) /
E_LAY_NUM ;
208 cout <<
"prt: " << m_Part
209 <<
"\tseg: " << m_Segment
210 <<
"\tlay: " << m_Layer
211 <<
"\tstr: " << m_Strip
212 <<
"\tid: " << m_Id << endl;
216 cout <<
"id: " << m_Id
217 <<
"\tprt: " << m_Part
218 <<
"\tseg: " << m_Segment
219 <<
"\tlay: " << m_Layer
220 <<
"\tstr: " << m_Strip << endl;