14#include "MucGeoCreateAlg/MucIdTransform.h"
15#include "MucGeoCreateAlg/MucGeoConst.h"
42 if( part != BRID )
max = E_STR_NUM;
44 else if( segment == B_TOP )
max = B_TOPSTR_NUM;
45 else max = B_PHISTR_NUM;
54 for(
int i=0; i<part; i++) {
55 boxId += BOX_PER_PART[i];
61 boxId += ( segment * BOX_PER_SEG[part] + layer );
72 boxId =
GetBoxId( part, segment, layer );
76 strId = boxId*E_STR_NUM + strSubId;
78 else if( part == BRID )
80 strId = STR_PER_PART[0];
83 strId += segment * B_STR_PER_SEG[0] + E_STR_NUM;
85 strId += segment * B_STR_PER_SEG[0];
88 strId += (layer/2) * ( (segment == B_TOP)?B_TOPSTR_NUM:B_PHISTR_NUM );
94 strId = STR_PER_PART[0] + STR_PER_PART[1];
95 strId += (boxId - BOX_SUM[1])*E_STR_NUM + strSubId;
105 if( (boxId < 0) || (boxId > BOX_MAX-1) )
110 cout <<
"box id out range:\t" << boxId <<
"!" << endl;
115 if( boxId < BOX_SUM[0] ) { *part = 0; }
116 else if( boxId < BOX_SUM[1] ) { *part = 1; boxId -= BOX_SUM[0]; }
117 else { *part = 2; boxId -= BOX_SUM[1]; }
137 if( (stripId < 0) || (stripId > STRIP_MAX-1) )
143 cout <<
"strip id out range:\t" << stripId <<
"!" << endl;
148 if( stripId < STR_SUM[0] ) { *part = 0; }
149 else if ( stripId < STR_SUM[1] ) { *part = 1; stripId -= STR_SUM[0]; }
150 else { *part = 2; stripId -= STR_SUM[1]; }
156 if ( stripId >= 2*B_STR_PER_SEG[0] && stripId < 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] )
161 stripId -= 2*B_STR_PER_SEG[0];
162 temp = stripId % (
B_ZSTR_NUM + B_TOPSTR_NUM );
165 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / (
B_ZSTR_NUM + B_TOPSTR_NUM ) );
166 else *layer = 2*( stripId / (
B_ZSTR_NUM + B_TOPSTR_NUM ) ) + 1;
169 if( temp < B_ZSTR_NUM ) *strSubId = temp;
175 if (stripId >= 2*B_STR_PER_SEG[0] + B_STR_PER_SEG[1] ) stripId -= E_STR_NUM;
178 *segment = stripId / B_STR_PER_SEG[0];
180 stripId %= B_STR_PER_SEG[0];
181 temp = stripId % (
B_ZSTR_NUM + B_PHISTR_NUM );
184 if( temp < B_ZSTR_NUM ) *layer = 2*( stripId / (
B_ZSTR_NUM + B_PHISTR_NUM ) );
185 else *layer = 2*( stripId / (
B_ZSTR_NUM + B_PHISTR_NUM ) ) + 1;
188 if( temp < B_ZSTR_NUM ) *strSubId = temp;
194 *strSubId = stripId % E_STR_NUM;
195 *layer = ( stripId / E_STR_NUM ) % E_LAY_NUM ;
196 *segment = ( stripId / E_STR_NUM ) / E_LAY_NUM ;
207 cout <<
"prt: " << m_Part
208 <<
"\tseg: " << m_Segment
209 <<
"\tlay: " << m_Layer
210 <<
"\tstr: " << m_Strip
211 <<
"\tid: " << m_Id << endl;
215 cout <<
"id: " << m_Id
216 <<
"\tprt: " << m_Part
217 <<
"\tseg: " << m_Segment
218 <<
"\tlay: " << m_Layer
219 <<
"\tstr: " << m_Strip << endl;