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];
88 strId += ((1+layer)/2) * B_ZSTR_NUM;
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]; }
123 *segment = boxId / B_LAY_NUM;
124 *layer = boxId % B_LAY_NUM;
128 *segment = boxId / E_LAY_NUM;
129 *layer = boxId % E_LAY_NUM;
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 );
166 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) );
167 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_TOPSTR_NUM ) ) + 1;
170 if( temp < B_ZSTR_NUM ) *strSubId = temp;
171 else *strSubId = temp - B_ZSTR_NUM;
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 );
185 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) );
186 else *layer = 2*( stripId / ( B_ZSTR_NUM + B_PHISTR_NUM ) ) + 1;
189 if( temp < B_ZSTR_NUM ) *strSubId = temp;
190 else *strSubId = temp - B_ZSTR_NUM;
195 *strSubId = stripId % E_STR_NUM;
196 *layer = ( stripId / E_STR_NUM ) % E_LAY_NUM ;
197 *segment = ( stripId / E_STR_NUM ) / E_LAY_NUM ;