12#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/ISvcLocator.h"
28 m_CreateFlag = createFlag;
29 m_AlignFlag = alignFlag;
30 m_AlignFile = alignFile;
32 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
41 delete []m_StripPlaneOffset;
46 delete m_MucStripPlane;
58 MsgStream log(
msgSvc,
"MucGeoMgr");
62 if( m_AlignFlag ==
true )
64 log << MSG::INFO <<
"MucGeoMgr::initOffset()" << endreq;
66 TFile* froot =
new TFile(m_AlignFile.c_str(),
"read");
67 if( froot->IsZombie() ) {
68 log << MSG:: ERROR <<
"Open alignment data error!" << endreq;
69 return StatusCode::FAILURE;
72 const char OFFSET_NAME[3][5] = {
"dx",
"dy",
"dz"};
74 double strpln_offset[3];
78 tr_Offset = (TTree*)froot->Get(
"Offset");
79 tr_Offset->SetBranchAddress(
"box_dx", &box_offset[0]);
80 tr_Offset->SetBranchAddress(
"box_dy", &box_offset[1]);
81 tr_Offset->SetBranchAddress(
"box_dz", &box_offset[2]);
82 tr_Offset->SetBranchAddress(
"strpln_dx", &strpln_offset[0]);
83 tr_Offset->SetBranchAddress(
"strpln_dy", &strpln_offset[1]);
84 tr_Offset->SetBranchAddress(
"strpln_dz", &strpln_offset[2]);
86 int part, segment, layer;
87 part = segment = layer = 0;
89 log << MSG::INFO <<
"------------------------- offset data--------------------------" << endreq;
90 log << MSG::INFO <<
"Part\tSegment\tLayer\tdx0\tdy0\tdz0\tdx1\tdy1\tdz1" << endreq;
91 for(
int i=0; i<BOX_MAX; i++)
93 m_IdTr->
SetBoxPos(i, &part, &segment, &layer);
94 tr_Offset->GetEntry(i);
96 log << MSG::INFO << part <<
"\t" << segment <<
"\t" << layer <<
"\t";
97 for(
int j=0; j<3; j++ )
99 log << MSG::INFO << box_offset[j] <<
"\t";
102 log << MSG::INFO << endreq <<
"Box offset P" << part <<
"S" << segment <<
"L" << layer
103 <<
"_" << OFFSET_NAME[j] <<
"\tout range!" << endreq;
104 box_offset[j] = B_X_MAX[j];
108 for(
int j=0; j<3; j++ )
110 log << MSG::INFO << strpln_offset[j] <<
"\t";
113 log << MSG::INFO << endreq <<
"Strip plane offset P" << part <<
"S" << segment <<
"L" << layer
114 <<
"_" << OFFSET_NAME[j] <<
"\tout range!" << endreq;
115 strpln_offset[j] = STR_OFFSET_MAX[j];
119 log << MSG::INFO << endreq;
123 log << MSG::INFO <<
"---------------------------------------------------------------" << endreq;
130 for(
int m=0; m<3; m++)
132 m_BoxOffset[i][j][k][m] = 0.0;
133 m_StripPlaneOffset[i][j][k][m] = 0.0;
137 return StatusCode::SUCCESS;
142 int outRangeFlag = 0;
150 if( layer == 0 ) layerFlag = 0;
151 else if( layer%2 == 1 ) layerFlag = 1;
154 if( B_X_MAX[layerFlag] - fabs(offset) >= 0.0 )
155 m_BoxOffset[part][segment][layer][axis] = offset;
158 m_BoxOffset[part][segment][layer][axis] = B_X_MAX[layerFlag] * MAX_FRACTION;
162 if( B_Y_MAX - fabs(offset) >= 0.0 )
163 m_BoxOffset[part][segment][layer][axis] = offset;
166 m_BoxOffset[part][segment][layer][axis] = B_Y_MAX * MAX_FRACTION;
170 if( B_Z_MAX - fabs(offset) >= 0.0 )
171 m_BoxOffset[part][segment][layer][axis] = offset;
174 m_BoxOffset[part][segment][layer][axis] = B_Z_MAX * MAX_FRACTION;
182 if( E_OFFSET_MAX[axis] - fabs(offset) >= 0.0 )
183 m_BoxOffset[part][segment][layer][axis] = offset;
186 m_BoxOffset[part][segment][layer][axis] = E_OFFSET_MAX[axis] * MAX_FRACTION;
190 if( outRangeFlag > 0 )
return false;
196 int outRangeFlag = 0;
198 if( STR_OFFSET_MAX[axis] - fabs(offset) >= 0.0 )
199 m_StripPlaneOffset[part][segment][layer][axis] = offset;
202 m_StripPlaneOffset[part][segment][layer][axis] = STR_OFFSET_MAX[axis] * MAX_FRACTION;
205 if( outRangeFlag > 0 )
return false;
214 MsgStream log(
msgSvc,
"MucGeoMgr");
219 for(
unsigned int i=m_CreateFlag.size(); i<
ENTITY_NUM; i++ )
225 if( m_CreateFlag[i] ==
'1' ) entity++;
226 log << MSG::INFO << entity <<
"\tentities should be created." << endreq << endreq;
228 if( m_CreateFlag[0] ==
'1' )
231 if( sc == StatusCode::SUCCESS )
232 log << MSG::INFO <<
"Create absorber successfully!" << endreq << endreq;
234 log << MSG::INFO <<
"Create absorber failure!" << endreq << endreq;
237 if( m_CreateFlag[1] ==
'1' )
240 if( sc == StatusCode::SUCCESS )
241 log << MSG::INFO <<
"Create gap successfully!" << endreq << endreq;
243 log << MSG::INFO <<
"Create gap failure!" << endreq << endreq;
246 if( m_CreateFlag[2] ==
'1' )
249 if( sc == StatusCode::SUCCESS )
250 log << MSG::INFO <<
"Create box successfully!" << endreq << endreq;
252 log << MSG::INFO <<
"Create box failure!" << endreq << endreq;
255 if( m_CreateFlag[3] ==
'1' )
258 if( sc == StatusCode::SUCCESS )
259 log << MSG::INFO <<
"Create strip_plane successfully!" << endreq << endreq;
261 log << MSG::INFO <<
"Create strip_plane failure!" << endreq << endreq;
264 if( m_CreateFlag[4] ==
'1' )
267 if( sc == StatusCode::SUCCESS )
268 log << MSG::INFO <<
"Create strip successfully!" << endreq << endreq;
270 log << MSG::INFO <<
"Create strip failure!" << endreq << endreq;
273 if( m_CreateFlag[5] ==
'1' )
276 if( sc == StatusCode::SUCCESS )
277 log << MSG::INFO <<
"Create RPC successfully!" << endreq << endreq;
279 log << MSG::INFO <<
"Create RPC failure!" << endreq << endreq;
282 if( m_CreateFlag[6] ==
'1' )
285 if( sc == StatusCode::SUCCESS )
286 log << MSG::INFO <<
"Create gas mixture successfully!" << endreq << endreq;
288 log << MSG::INFO <<
"Create gas mixture failure!" << endreq << endreq;
291 if( m_CreateFlag[7] ==
'1' )
294 if( sc == StatusCode::SUCCESS )
295 log << MSG::INFO <<
"Create bakelite successfully!" << endreq << endreq;
297 log << MSG::INFO <<
"Create bakelite failure!" << endreq << endreq;
300 if( m_CreateFlag[8] ==
'1' )
303 if( sc == StatusCode::SUCCESS )
304 log << MSG::INFO <<
"Create box cover successfully!" << endreq << endreq;
306 log << MSG::INFO <<
"Create box cover failure!" << endreq << endreq;
309 return StatusCode::SUCCESS;
315 MsgStream log(
msgSvc,
"MucGeoMgr");
318 return StatusCode::SUCCESS;
324 MsgStream log(
msgSvc,
"MucGeoMgr");
328 ofstream fEast(
"EastEndStripGeo.dat", ios::out);
329 ofstream fBarrel(
"BarrelStripGeo.dat", ios::out);
330 ofstream fWest(
"WestEndStripGeo.dat", ios::out);
332 if( fEast.bad() || fBarrel.bad() || fWest.bad() ) {
333 log << MSG::INFO <<
"Strip: create ouput file error!" << endl;
334 return StatusCode::FAILURE;
349 else if( j != B_TOP )
350 maxStrip = B_PHISTR_NUM;
352 maxStrip = B_TOPSTR_NUM;
354 for(
int n=0;
n<maxStrip;
n++ )
357 fBarrel << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
358 << aMucStrip->
GetType()-2 <<
"\t"
359 << aMucStrip->
GetL() <<
"\t"
360 << aMucStrip->
GetW() <<
"\t"
361 << aMucStrip->
GetH() <<
"\t"
377 for(
int n=0;
n<E_STR_NUM;
n++ )
380 fEast << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
381 << aMucStrip->
GetType() <<
"\t"
382 << aMucStrip->
GetL() <<
"\t"
383 << aMucStrip->
GetW() <<
"\t"
384 << aMucStrip->
GetH() <<
"\t"
400 for(
int n=0;
n<E_STR_NUM;
n++ )
403 fWest << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
404 << aMucStrip->
GetType() <<
"\t"
405 << aMucStrip->
GetL() <<
"\t"
406 << aMucStrip->
GetW() <<
"\t"
407 << aMucStrip->
GetH() <<
"\t"
424 log << MSG::INFO <<
"Online display strips created." << endreq;
425 return StatusCode::SUCCESS;
437 MsgStream log(
msgSvc,
"MucGeoMgr");
439 ofstream fOrigin(
"MucAbsorberOrigin.dat", ios::out);
440 ofstream fPanel(
"MucAbsorberPanel.dat", ios::out);
441 ofstream fPos(
"MucAbsorberPanelPos.dat", ios::out);
443 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
444 log << MSG::INFO <<
"Absorber: create ouput file error!" << endreq;
445 return StatusCode::FAILURE;
447 fOrigin <<
"part\tsegment\tlayer\tW\tH\tL\tBes_x\tBes_y\tBes_z\tRot_x\tRot_y\tRot_z" << endl;
448 fPanel <<
"part\tsegment\tlayer\tpanel\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
449 fPos <<
"part\tsegment\tlayer\tpanel\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
461 for(
int n=0;
n<B_AS_NUM;
n++ )
464 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
465 << aMucAbsorber->
GetW() <<
"\t"
466 << aMucAbsorber->
GetH() <<
"\t"
467 << aMucAbsorber->
GetL() <<
"\t"
475 fPanel << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
476 << aMucAbsorber->
GetWu() <<
"\t"
477 << aMucAbsorber->
GetWd() <<
"\t"
478 << aMucAbsorber->
GetH() <<
"\t"
479 << aMucAbsorber->
GetL() <<
"\t"
484 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
506 for(
int k=0; k<E_ASLAY_NUM; k++ )
508 for(
int n=-1;
n<E_PANEL_NUM;
n++ )
513 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
514 << aMucAbsorber->
GetW() <<
"\t"
515 << aMucAbsorber->
GetH() <<
"\t"
516 << aMucAbsorber->
GetL() <<
"\t"
530 fPanel << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
531 << aMucAbsorber->
GetWu() <<
"\t"
532 << aMucAbsorber->
GetWd() <<
"\t"
533 << aMucAbsorber->
GetH() <<
"\t"
534 << aMucAbsorber->
GetL() <<
"\t"
540 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
563 log << MSG::INFO << totalObject <<
"\tabsorbers created." << endreq;
565 return StatusCode::SUCCESS;
572 MsgStream log(
msgSvc,
"MucGeoMgr");
574 ofstream fOrigin(
"MucGapOrigin.dat", ios::out);
575 ofstream fPanel(
"MucGapPanel.dat", ios::out);
576 ofstream fPos(
"MucGapPanelPos.dat", ios::out);
578 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
579 log << MSG::INFO <<
"Gap: create ouput file error!" << endreq;
580 return StatusCode::FAILURE;
582 fOrigin <<
"part\tsegment\tlayer\tW\tH\tL\tBes_x\tBes_y\tBes_z\tRot_x\tRot_y\tRot_z" << endl;
583 fPanel <<
"part\tsegment\tlayer\tpanel\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
584 fPos <<
"part\tsegment\tlayer\tpanel\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
596 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
597 else { idMin = -1; idMax = 3; }
601 for(
int n=idMin;
n<idMax;
n++ )
604 if( j == B_TOP &&
n != -1 )
606 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
607 << aMucGap->
GetWu() <<
"\t"
608 << aMucGap->
GetWd() <<
"\t"
609 << aMucGap->
GetH() <<
"\t"
610 << aMucGap->
GetL() <<
"\t"
617 if( j !=B_TOP ||
n == -1 )
619 fOrigin<< i <<
"\t" << j <<
"\t" << k <<
"\t"
620 << aMucGap->
GetW() <<
"\t"
621 << aMucGap->
GetH() <<
"\t"
622 << aMucGap->
GetL() <<
"\t"
635 fPos<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
656 for(
int n=-1;
n<E_PANEL_NUM;
n++ )
661 fOrigin<< i <<
"\t" << j <<
"\t" << k <<
"\t"
662 << aMucGap->
GetW() <<
"\t"
663 << aMucGap->
GetH() <<
"\t"
664 << aMucGap->
GetL() <<
"\t"
677 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
678 << aMucGap->
GetWu() <<
"\t"
679 << aMucGap->
GetWd() <<
"\t"
680 << aMucGap->
GetH() <<
"\t"
681 << aMucGap->
GetL() <<
"\t"
687 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
710 log << MSG::INFO << totalObject <<
"\tgaps created." << endreq;
711 return StatusCode::SUCCESS;
719 MsgStream log(
msgSvc,
"MucGeoMgr");
722 ofstream fOrigin(
"MucBoxOrigin.dat", ios::out);
723 ofstream fPanel(
"MucBoxPanel.dat", ios::out);
724 ofstream fPos(
"MucBoxPanelPos.dat", ios::out);
726 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
727 log << MSG::INFO <<
"Box: create ouput file error!" << endl;
728 return StatusCode::FAILURE;
730 fOrigin <<
"part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
731 fPanel <<
"part\tsegment\tlayer\tpanel\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
732 fPos <<
"part\tsegment\tlayer\tpanel\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
743 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
744 else { idMin = -1; idMax = 3; }
748 for(
int n=idMin;
n<idMax;
n++ )
751 if( j == B_TOP &&
n != -1 )
753 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
754 << aMucBox->
GetWu() <<
"\t"
755 << aMucBox->
GetWd() <<
"\t"
756 << aMucBox->
GetH() <<
"\t"
757 << aMucBox->
GetL() <<
"\t"
764 if( j !=B_TOP ||
n == -1 )
766 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
767 << aMucBox->
GetW() <<
"\t"
768 << aMucBox->
GetH() <<
"\t"
769 << aMucBox->
GetL() <<
"\t"
779 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
801 for(
int n=-1;
n<E_PANEL_NUM;
n++ )
806 fOrigin<< i <<
"\t" << j <<
"\t" << k <<
"\t"
807 << aMucBox->
GetW() <<
"\t"
808 << aMucBox->
GetH() <<
"\t"
809 << aMucBox->
GetL() <<
"\t"
820 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
821 << aMucBox->
GetWu() <<
"\t"
822 << aMucBox->
GetWd() <<
"\t"
823 << aMucBox->
GetH() <<
"\t"
824 << aMucBox->
GetL() <<
"\t"
832 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
857 ofstream fOrgAlign(
"MucBoxOriginAligned.dat", ios::out);
858 fOrgAlign <<
"part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
868 MucBox *aMucBox =
new MucBox( i, j, k, ((j==B_TOP)?-1:0) );
869 offset[0] =m_BoxOffset[i][j][k][0];
870 offset[1] =m_BoxOffset[i][j][k][1];
871 offset[2] =m_BoxOffset[i][j][k][2];
872 aMucBox->
SetAlignment( offset[0], offset[1], offset[2] );
874 fOrgAlign << i <<
"\t" << j <<
"\t" << k <<
"\t"
875 << aMucBox->
GetW() <<
"\t"
876 << aMucBox->
GetH() <<
"\t"
877 << aMucBox->
GetL() <<
"\t"
893 offset[0] =m_BoxOffset[i][j][k][0];
894 offset[1] =m_BoxOffset[i][j][k][1];
895 offset[2] =m_BoxOffset[i][j][k][2];
896 aMucBox->
SetAlignment( offset[0], offset[1], offset[2] );
898 fOrgAlign << i <<
"\t" << j <<
"\t" << k <<
"\t"
899 << aMucBox->
GetW() <<
"\t"
900 << aMucBox->
GetH() <<
"\t"
901 << aMucBox->
GetL() <<
"\t"
915 log << MSG::INFO << totalObject <<
"\tboxes created." << endreq;
916 return StatusCode::SUCCESS;
924 MsgStream log(
msgSvc,
"MucGeoMgr");
927 ofstream fOrigin(
"MucStripPlaneOrigin.dat", ios::out);
928 ofstream fPanel(
"MucStripPlanePanel.dat", ios::out);
929 ofstream fPos(
"MucStripPlanePanelPos.dat", ios::out);
931 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
932 log << MSG::INFO <<
"StripPlane: create ouput file error!" << endl;
933 return StatusCode::FAILURE;
935 fOrigin <<
"part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
936 fPanel <<
"part\tsegment\tlayer\tpanel\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
937 fPos <<
"part\tsegment\tlayer\tpanel\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
951 for(
int n=-1;
n<B_STR_PANEL_NUM;
n++ )
956 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
957 << aMucStripPlane->
GetW() <<
"\t"
958 << aMucStripPlane->
GetH() <<
"\t"
959 << aMucStripPlane->
GetL() <<
"\t"
964 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
980 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
981 << aMucStripPlane->
GetWu() <<
"\t"
982 << aMucStripPlane->
GetWd() <<
"\t"
983 << aMucStripPlane->
GetH() <<
"\t"
984 << aMucStripPlane->
GetL() <<
"\t"
990 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1008 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1009 << aMucStripPlane->
GetW() <<
"\t"
1010 << aMucStripPlane->
GetH() <<
"\t"
1011 << aMucStripPlane->
GetL() <<
"\t"
1016 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
"\t"
1039 for(
int n=-1;
n<E_PANEL_NUM;
n++ )
1044 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1045 << aMucStripPlane->
GetW() <<
"\t"
1046 << aMucStripPlane->
GetH() <<
"\t"
1047 << aMucStripPlane->
GetL() <<
"\t"
1053 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1069 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1070 << aMucStripPlane->
GetWu() <<
"\t"
1071 << aMucStripPlane->
GetWd() <<
"\t"
1072 << aMucStripPlane->
GetH() <<
"\t"
1073 << aMucStripPlane->
GetL() <<
"\t"
1079 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1105 ofstream fOrgAlign(
"MucStripPlaneOriginAligned.dat", ios::out);
1106 fOrgAlign <<
"part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
1117 offset[0] =m_StripPlaneOffset[i][j][k][0];
1118 offset[1] =m_StripPlaneOffset[i][j][k][1];
1119 offset[2] =m_StripPlaneOffset[i][j][k][2];
1120 aMucStripPlane->
SetAlignment( offset[0], offset[1], offset[2] );
1122 fOrgAlign << i <<
"\t" << j <<
"\t" << k <<
"\t"
1123 << aMucStripPlane->
GetW() <<
"\t"
1124 << aMucStripPlane->
GetH() <<
"\t"
1125 << aMucStripPlane->
GetL() <<
"\t"
1141 offset[0] =m_StripPlaneOffset[i][j][k][0];
1142 offset[1] =m_StripPlaneOffset[i][j][k][1];
1143 offset[2] =m_StripPlaneOffset[i][j][k][2];
1144 aMucStripPlane->
SetAlignment( offset[0], offset[1], offset[2] );
1146 fOrgAlign << i <<
"\t" << j <<
"\t" << k <<
"\t"
1147 << aMucStripPlane->
GetW() <<
"\t"
1148 << aMucStripPlane->
GetH() <<
"\t"
1149 << aMucStripPlane->
GetL() <<
"\t"
1163 log << MSG::INFO << totalObject <<
"\tstrip_planes created." << endreq;
1164 return StatusCode::SUCCESS;
1171 MsgStream log(
msgSvc,
"MucGeoMgr");
1174 ofstream fOrigin(
"MucStrip.dat", ios::out);
1175 ofstream fPos(
"MucStripPos.dat", ios::out);
1177 if( fOrigin.bad() || fPos.bad() ) {
1178 log << MSG::INFO <<
"Strip: create ouput file error!" << endl;
1179 return StatusCode::FAILURE;
1181 fOrigin <<
"part\tsegment\tlayer\tstrip\ttype\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z\tBes_x\tBes_y\tBes_z" << endl;
1182 fPos <<
"part\tsegment\tlayer\tstrip\ttype\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
1184 int totalObject = 0;
1196 if( ( k+1 )%2 == 1 )
1198 else if( j != B_TOP )
1199 maxStrip = B_PHISTR_NUM;
1201 maxStrip = B_TOPSTR_NUM;
1203 for(
int n=0;
n<maxStrip;
n++ )
1206 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1207 << aMucStrip->
GetType() <<
"\t"
1208 << aMucStrip->
GetW() <<
"\t"
1209 << aMucStrip->
GetH() <<
"\t"
1210 << aMucStrip->
GetL() <<
"\t"
1219 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1220 << aMucStrip->
GetType() <<
"\t"
1244 for(
int n=0;
n<E_STR_NUM;
n++ )
1247 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1248 << aMucStrip->
GetType() <<
"\t"
1249 << aMucStrip->
GetW() <<
"\t"
1250 << aMucStrip->
GetH() <<
"\t"
1251 << aMucStrip->
GetL() <<
"\t"
1260 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1261 << aMucStrip->
GetType() <<
"\t"
1283 log << MSG::INFO << totalObject <<
"\tstrips created." << endreq;
1284 return StatusCode::SUCCESS;
1292 MsgStream log(
msgSvc,
"MucGeoMgr");
1295 ofstream fOrigin(
"MucRpc.dat", ios::out);
1296 ofstream fPos(
"MucRpcPos.dat", ios::out);
1298 if( fOrigin.bad() || fPos.bad() ) {
1299 log << MSG::INFO <<
"Rpc: create ouput file error!" << endl;
1300 return StatusCode::FAILURE;
1302 fOrigin <<
"part\tsegment\tlayer\tupDown\trpc\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z\tBes_x\tBes_y\tBes_z" << endl;
1303 fPos <<
"part\tsegment\tlayer\tupDown\trpc\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
1305 int totalObject = 0;
1316 maxRpc = B_TOP_RPC_NUM;
1322 for(
int m=0; m<SL_NUM; m++ )
1324 for(
int n=0;
n<maxRpc;
n++ )
1327 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1328 << m <<
"\t" <<
n <<
"\t"
1329 << aMucRpc->
GetWu() <<
"\t"
1330 << aMucRpc->
GetWd() <<
"\t"
1331 << aMucRpc->
GetH() <<
"\t"
1332 << aMucRpc->
GetL() <<
"\t"
1341 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1342 << m <<
"\t" <<
n <<
"\t"
1367 for(
int m=0; m<SL_NUM; m++ )
1369 for(
int n=0;
n<E_RPC_NUM[m];
n++ )
1372 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1373 << m <<
"\t" <<
n <<
"\t"
1374 << aMucRpc->
GetWu() <<
"\t"
1375 << aMucRpc->
GetWd() <<
"\t"
1376 << aMucRpc->
GetH() <<
"\t"
1377 << aMucRpc->
GetL() <<
"\t"
1386 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1387 << m <<
"\t" <<
n <<
"\t"
1410 log << MSG::INFO << totalObject <<
"\t RPCs created." << endreq;
1411 return StatusCode::SUCCESS;
1418 MsgStream log(
msgSvc,
"MucGeoMgr");
1421 ofstream fOrigin(
"MucGas.dat", ios::out);
1422 ofstream fPos(
"MucGasPos.dat", ios::out);
1424 if( fOrigin.bad() || fPos.bad() ) {
1425 log << MSG::INFO <<
"Gas: create ouput file error!" << endl;
1426 return StatusCode::FAILURE;
1428 fOrigin <<
"part\tsegment\tlayer\tupDown\tgas\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z\tBes_x\tBes_y\tBes_z" << endl;
1429 fPos <<
"part\tsegment\tlayer\tupDown\tgas\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
1431 int totalObject = 0;
1442 maxRpc = B_TOP_RPC_NUM;
1448 for(
int m=0; m<SL_NUM; m++ )
1450 for(
int n=0;
n<maxRpc;
n++ )
1453 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1454 << m <<
"\t" <<
n <<
"\t"
1455 << aMucGas->
GetWu() <<
"\t"
1456 << aMucGas->
GetWd() <<
"\t"
1457 << aMucGas->
GetH() <<
"\t"
1458 << aMucGas->
GetL() <<
"\t"
1467 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t" <<
n <<
"\t"
1492 for(
int m=0; m<SL_NUM; m++ )
1494 for(
int n=0;
n<E_RPC_NUM[m];
n++ )
1497 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1498 << m <<
"\t" <<
n <<
"\t"
1499 << aMucGas->
GetWu() <<
"\t"
1500 << aMucGas->
GetWd() <<
"\t"
1501 << aMucGas->
GetH() <<
"\t"
1502 << aMucGas->
GetL() <<
"\t"
1511 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1512 << m <<
"\t" <<
n <<
"\t"
1535 log << MSG::INFO << totalObject <<
"\tgases created." << endreq;
1536 return StatusCode::SUCCESS;
1543 MsgStream log(
msgSvc,
"MucGeoMgr");
1546 ofstream fOrigin(
"MucBakelite.dat", ios::out);
1547 ofstream fPos(
"MucBakelitePos.dat", ios::out);
1549 if( fOrigin.bad() || fPos.bad() ) {
1550 log << MSG::INFO <<
"Bakelite: create ouput file error!" << endl;
1551 return StatusCode::FAILURE;
1553 fOrigin <<
"part\tsegment\tlayer\tupDown\trpcId\tBKLT\t"
1554 <<
"Wu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z\tBes_x\tBes_y\tBes_z" << endl;
1555 fPos <<
"part\tsegment\tlayer\tupDown\trpcId\tBKLT\t"
1556 <<
"LBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
1558 int totalObject = 0;
1569 maxRpc = B_TOP_RPC_NUM;
1575 for(
int m=0; m<SL_NUM; m++ )
1577 for(
int n=0;
n<maxRpc;
n++ )
1579 for(
int t=0;
t<BKLT_NUM;
t++)
1582 fOrigin<< i <<
"\t" << j <<
"\t" << k <<
"\t"
1583 << m <<
"\t" <<
n <<
"\t" <<
t <<
"\t"
1584 << aMucBakelite->
GetWu() <<
"\t"
1585 << aMucBakelite->
GetWd() <<
"\t"
1586 << aMucBakelite->
GetH() <<
"\t"
1587 << aMucBakelite->
GetL() <<
"\t"
1596 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1597 << m <<
"\t" <<
n <<
"\t" <<
t <<
"\t"
1623 for(
int m=0; m<SL_NUM; m++ )
1625 for(
int n=0;
n<E_RPC_NUM[m];
n++ )
1627 for(
int t=0;
t<BKLT_NUM;
t++ )
1630 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1631 << m <<
"\t" <<
n <<
"\t" <<
t <<
"\t"
1632 << aMucBakelite->
GetWu() <<
"\t"
1633 << aMucBakelite->
GetWd() <<
"\t"
1634 << aMucBakelite->
GetH() <<
"\t"
1635 << aMucBakelite->
GetL() <<
"\t"
1644 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1645 << m <<
"\t" <<
n <<
"\t" <<
t <<
"\t"
1670 log << MSG::INFO << totalObject <<
"\tbakelites created." << endreq;
1671 return StatusCode::SUCCESS;
1678 MsgStream log(
msgSvc,
"MucGeoMgr");
1681 ofstream fOrigin(
"MucBoxCoverOrigin.dat", ios::out);
1682 ofstream fPanel(
"MucBoxCoverPanel.dat", ios::out);
1683 ofstream fPos(
"MucBoxCoverPanelPos.dat", ios::out);
1685 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
1686 log << MSG::INFO <<
"BoxCover: create ouput file error!" << endl;
1687 return StatusCode::FAILURE;
1689 fOrigin <<
"part\tsegment\tlayer\tU/D\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
1690 fPanel <<
"part\tsegment\tlayer\tU/D\tpanel\tWu\tWd\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
1691 fPos <<
"part\tsegment\tlayer\tU/D\tpanel\tLBes_x\tLBes_y\tLBes_z\tOBes_x\tOBes_y\tOBes_z\tLoc_x\tLoc_y\tLoc_z" << endl;
1693 int totalObject = 0;
1703 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
1704 else { idMin = -1; idMax = 3; }
1708 for(
int m=0; m<SL_NUM; m++ )
1710 for(
int n = idMin;
n<idMax;
n++ )
1713 if( j == B_TOP ||
n != -1 )
1715 fPanel << i <<
"\t" << j <<
"\t" << k <<
"\t"
1716 << m <<
"\t" <<
n <<
"\t"
1717 << aMucBoxCover->
GetW() <<
"\t"
1718 << aMucBoxCover->
GetW() <<
"\t"
1719 << aMucBoxCover->
GetH() <<
"\t"
1720 << aMucBoxCover->
GetL() <<
"\t"
1728 if( j != B_TOP ||
n == -1 )
1730 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1732 << aMucBoxCover->
GetW() <<
"\t"
1733 << aMucBoxCover->
GetH() <<
"\t"
1734 << aMucBoxCover->
GetL() <<
"\t"
1744 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1745 << m <<
"\t" <<
n <<
"\t"
1768 for(
int m=0; m<SL_NUM; m++ )
1770 for(
int n=-1;
n<E_PANEL_NUM;
n++ )
1775 fOrigin << i <<
"\t" << j <<
"\t" << k <<
"\t"
1777 << aMucBoxCover->
GetW() <<
"\t"
1778 << aMucBoxCover->
GetH() <<
"\t"
1779 << aMucBoxCover->
GetL() <<
"\t"
1789 fPanel<< i <<
"\t" << j <<
"\t" << k <<
"\t"
1790 << m <<
"\t" <<
n <<
"\t"
1791 << aMucBoxCover->
GetWu() <<
"\t"
1792 << aMucBoxCover->
GetWd() <<
"\t"
1793 << aMucBoxCover->
GetH() <<
"\t"
1794 << aMucBoxCover->
GetL() <<
"\t"
1802 fPos << i <<
"\t" << j <<
"\t" << k <<
"\t"
1803 << m <<
"\t" <<
n <<
"\t"
1826 log << MSG::INFO << totalObject <<
"\tbox_covers created." << endreq;
1827 return StatusCode::SUCCESS;
1834 if( m_MucAbsorber !=
NULL )
delete m_MucAbsorber;
1835 return ( m_MucAbsorber =
new MucAbsorber(part, segment, layer,
id) );
1840 if( m_MucGap !=
NULL )
delete m_MucGap;
1841 return ( m_MucGap =
new MucGap(part, segment, layer,
id) );
1846 if( m_MucBox !=
NULL )
delete m_MucBox;
1847 return ( m_MucBox =
new MucBox(part, segment, layer,
id) );
1852 if( m_MucStripPlane !=
NULL )
delete m_MucStripPlane;
1853 return ( m_MucStripPlane =
new MucStripPlane(part, segment, layer,
id) );
1858 if( m_MucStrip !=
NULL )
delete m_MucStrip;
1859 return ( m_MucStrip =
new MucStrip(part, segment, layer,
id) );
1864 if( m_MucRpc !=
NULL )
delete m_MucRpc;
1865 return ( m_MucRpc =
new MucRpc(part, segment, layer, upDown,
id) );
1870 if( m_MucGas !=
NULL )
delete m_MucGas;
1871 return ( m_MucGas =
new MucGas(part, segment, layer, upDown, rpcId,
id) );
1876 if( m_MucBakelite !=
NULL )
delete m_MucBakelite;
1877 return ( m_MucBakelite =
new MucBakelite(part, segment, layer, upDown, rpcId,
id) );
1882 if( m_MucBoxCover !=
NULL )
delete m_MucBoxCover;
1883 return ( m_MucBoxCover =
new MucBoxCover(part, segment, layer, upDown,
id) );
const unsigned int ENTITY_NUM
virtual void SetAlignment(double dx, double dy, double dz)
double GetObjRotToMot(int i)
double GetObjOrgInBes(int i)
double GetLocOrgInBes(int i)
double GetObjOrgInLoc(int i)
bool CheckStripPlaneOffset(int part, int segment, int layer, int axis, double offset)
MucGap * GetGap(int part, int segment, int layer, int id)
MucAbsorber * GetAbsorber(int part, int segment, int layer, int id)
MucStripPlane * GetStripPlane(int part, int segment, int layer, int id)
MucGeoMgr(const std::string createFlag, bool alignFlag, const std::string alignFile)
MucGas * GetGas(int part, int segment, int layer, int upDown, int rpcId, int id)
StatusCode CreateAbsorber()
StatusCode CreateOnlineStripGeo()
StatusCode CreateBoxCover()
MucBoxCover * GetBoxCover(int part, int segment, int layer, int upDown, int id)
MucBakelite * GetBakelite(int part, int segment, int layer, int upDown, int rpcId, int id)
StatusCode CreateBakelite()
StatusCode CreateStripPlane()
MucStrip * GetStrip(int part, int segment, int layer, int id)
MucBox * GetBox(int part, int segment, int layer, int id)
bool CheckBoxOffset(int part, int segment, int layer, int axis, double offset)
StatusCode CreateEntities()
StatusCode CreateRootGeo()
MucRpc * GetRpc(int part, int segment, int layer, int upDown, int id)
virtual void SetAlignment(double dx, double dy, double dz)