BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MucGeoMgr.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------|
2// [File ]: MucGeoMgr.cxx |
3// [Brief ]: MUC geometry created manager class |
4// [Author]: Xie Yuguang, <[email protected]> |
5// [Date ]: Mar 28, 2006 |
6//------------------------------------------------------------------------------|
7
8#include<iostream>
9#include<string>
10#include<fstream>
11
12#include "GaudiKernel/MsgStream.h"
13#include "GaudiKernel/Bootstrap.h"
14#include "GaudiKernel/ISvcLocator.h"
15
16#include "TFile.h"
17#include "TTree.h"
18#include "TH1F.h"
19
22
23using namespace std;
24
25// Constructor
26MucGeoMgr::MucGeoMgr( const std::string createFlag, bool alignFlag, const std::string alignFile )
27{
28 m_CreateFlag = createFlag;
29 m_AlignFlag = alignFlag;
30 m_AlignFile = alignFile;
31
32 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
33
34 InitOffset();
35}
36
37// Destructor
39{
40 delete []m_BoxOffset;
41 delete []m_StripPlaneOffset;
42
43 delete m_MucAbsorber;
44 delete m_MucGap;
45 delete m_MucBox;
46 delete m_MucStripPlane;
47 delete m_MucStrip;
48 delete m_MucRpc;
49 delete m_MucGas;
50 delete m_MucBakelite;
51 delete m_MucBoxCover;
52}
53
54//========================================= Alignment initialization==================================================
55// Offset init
57{
58 MsgStream log(msgSvc, "MucGeoMgr");
59
60 m_IdTr = new MucIdTransform();
61
62 if( m_AlignFlag == true )
63 {
64 log << MSG::INFO << "MucGeoMgr::initOffset()" << endreq;
65
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;
70 }
71
72 const char OFFSET_NAME[3][5] = {"dx", "dy", "dz"};
73 double box_offset[3];
74 double strpln_offset[3];
75
76 TTree* tr_Offset;
77
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]);
85
86 int part, segment, layer;
87 part = segment = layer = 0;
88
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++)
92 {
93 m_IdTr->SetBoxPos(i, &part, &segment, &layer);
94 tr_Offset->GetEntry(i);
95
96 log << MSG::INFO << part << "\t" << segment << "\t" << layer << "\t";
97 for( int j=0; j<3; j++ )
98 {
99 log << MSG::INFO << box_offset[j] << "\t";
100 if( !CheckBoxOffset(part, segment, layer, j, box_offset[j]) )
101 {
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];
105 }
106 }
107
108 for( int j=0; j<3; j++ )
109 {
110 log << MSG::INFO << strpln_offset[j] << "\t";
111 if( !CheckStripPlaneOffset(part, segment, layer, j, strpln_offset[j]) )
112 {
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];
116 }
117 }
118
119 log << MSG::INFO << endreq;
120 } // end box
121
122 froot->Close();
123 log << MSG::INFO << "---------------------------------------------------------------" << endreq;
124 } // end alignflag
125 else
126 {
127 for(int i=0; i<PART_MAX; i++)
128 for(int j=0; j<B_SEG_NUM; j++)
129 for(int k=0; k<B_LAY_NUM; k++)
130 for(int m=0; m<3; m++)
131 {
132 m_BoxOffset[i][j][k][m] = 0.0;
133 m_StripPlaneOffset[i][j][k][m] = 0.0;
134 }
135 }
136
137 return StatusCode::SUCCESS;
138}
139
140bool MucGeoMgr::CheckBoxOffset( int part, int segment, int layer, int axis, double offset )
141{
142 int outRangeFlag = 0;
143
144 if( part == BRID )
145 {
146 switch( axis )
147 {
148 case 0: // x
149 int layerFlag;
150 if( layer == 0 ) layerFlag = 0;
151 else if( layer%2 == 1 ) layerFlag = 1;
152 else layerFlag = 2;
153
154 if( B_X_MAX[layerFlag] - fabs(offset) >= 0.0 ) // |offset|<=B_X_MAX
155 m_BoxOffset[part][segment][layer][axis] = offset;
156 else {
157 outRangeFlag ++;
158 m_BoxOffset[part][segment][layer][axis] = B_X_MAX[layerFlag] * MAX_FRACTION;
159 }
160 break;
161 case 1: // y
162 if( B_Y_MAX - fabs(offset) >= 0.0 ) // |offset|<=B_Y_MAX
163 m_BoxOffset[part][segment][layer][axis] = offset;
164 else {
165 outRangeFlag ++;
166 m_BoxOffset[part][segment][layer][axis] = B_Y_MAX * MAX_FRACTION;
167 }
168 break;
169 case 2: // z
170 if( B_Z_MAX - fabs(offset) >= 0.0 ) // |offset|<=B_Y_MAX
171 m_BoxOffset[part][segment][layer][axis] = offset;
172 else {
173 outRangeFlag ++;
174 m_BoxOffset[part][segment][layer][axis] = B_Z_MAX * MAX_FRACTION;
175 }
176 break;
177 default: ;
178 }
179 } // End barrel
180 else
181 {
182 if( E_OFFSET_MAX[axis] - fabs(offset) >= 0.0 ) // |offset|<=B_Y_MAX
183 m_BoxOffset[part][segment][layer][axis] = offset;
184 else {
185 outRangeFlag ++;
186 m_BoxOffset[part][segment][layer][axis] = E_OFFSET_MAX[axis] * MAX_FRACTION;
187 }
188 }
189
190 if( outRangeFlag > 0 ) return false;
191 else return true;
192}
193
194bool MucGeoMgr::CheckStripPlaneOffset( int part, int segment, int layer, int axis, double offset )
195{
196 int outRangeFlag = 0;
197
198 if( STR_OFFSET_MAX[axis] - fabs(offset) >= 0.0 ) // |offset|<=STR_OFFSET_MAX
199 m_StripPlaneOffset[part][segment][layer][axis] = offset;
200 else {
201 outRangeFlag ++;
202 m_StripPlaneOffset[part][segment][layer][axis] = STR_OFFSET_MAX[axis] * MAX_FRACTION;
203 }
204
205 if( outRangeFlag > 0 ) return false;
206 else return true;
207}
208
209//====================================== Geometry entities creating methods=============================================
210//
211//------------------------------------------Total data of all entities -------------------------------------------------
213{
214 MsgStream log(msgSvc, "MucGeoMgr");
215
216 StatusCode sc;
217
218 if( m_CreateFlag.size() < ENTITY_NUM ) {
219 for( unsigned int i=m_CreateFlag.size(); i<ENTITY_NUM; i++ )
220 m_CreateFlag += '0';
221 }
222
223 int entity = 0;
224 for( unsigned int i=0; i< ENTITY_NUM; i++ )
225 if( m_CreateFlag[i] == '1' ) entity++;
226 log << MSG::INFO << entity << "\tentities should be created." << endreq << endreq;
227
228 if( m_CreateFlag[0] == '1' )
229 {
230 sc = CreateAbsorber();
231 if( sc == StatusCode::SUCCESS )
232 log << MSG::INFO << "Create absorber successfully!" << endreq << endreq;
233 else
234 log << MSG::INFO << "Create absorber failure!" << endreq << endreq;
235 }
236
237 if( m_CreateFlag[1] == '1' )
238 {
239 sc = CreateGap();
240 if( sc == StatusCode::SUCCESS )
241 log << MSG::INFO << "Create gap successfully!" << endreq << endreq;
242 else
243 log << MSG::INFO << "Create gap failure!" << endreq << endreq;
244 }
245
246 if( m_CreateFlag[2] == '1' )
247 {
248 sc = CreateBox();
249 if( sc == StatusCode::SUCCESS )
250 log << MSG::INFO << "Create box successfully!" << endreq << endreq;
251 else
252 log << MSG::INFO << "Create box failure!" << endreq << endreq;
253 }
254
255 if( m_CreateFlag[3] == '1' )
256 {
257 sc = CreateStripPlane();
258 if( sc == StatusCode::SUCCESS )
259 log << MSG::INFO << "Create strip_plane successfully!" << endreq << endreq;
260 else
261 log << MSG::INFO << "Create strip_plane failure!" << endreq << endreq;
262 }
263
264 if( m_CreateFlag[4] == '1' )
265 {
266 sc = CreateStrip();
267 if( sc == StatusCode::SUCCESS )
268 log << MSG::INFO << "Create strip successfully!" << endreq << endreq;
269 else
270 log << MSG::INFO << "Create strip failure!" << endreq << endreq;
271 }
272
273 if( m_CreateFlag[5] == '1' )
274 {
275 sc = CreateRpc();
276 if( sc == StatusCode::SUCCESS )
277 log << MSG::INFO << "Create RPC successfully!" << endreq << endreq;
278 else
279 log << MSG::INFO << "Create RPC failure!" << endreq << endreq;
280 }
281
282 if( m_CreateFlag[6] == '1' )
283 {
284 sc = CreateGas();
285 if( sc == StatusCode::SUCCESS )
286 log << MSG::INFO << "Create gas mixture successfully!" << endreq << endreq;
287 else
288 log << MSG::INFO << "Create gas mixture failure!" << endreq << endreq;
289 }
290
291 if( m_CreateFlag[7] == '1' )
292 {
293 sc = CreateBakelite();
294 if( sc == StatusCode::SUCCESS )
295 log << MSG::INFO << "Create bakelite successfully!" << endreq << endreq;
296 else
297 log << MSG::INFO << "Create bakelite failure!" << endreq << endreq;
298 }
299
300 if( m_CreateFlag[8] == '1' )
301 {
302 sc = CreateBoxCover();
303 if( sc == StatusCode::SUCCESS )
304 log << MSG::INFO << "Create box cover successfully!" << endreq << endreq;
305 else
306 log << MSG::INFO << "Create box cover failure!" << endreq << endreq;
307 }
308
309 return StatusCode::SUCCESS;
310}
311
312//------------------------------------ROOT geometry-----------------------------------------------
314{
315 MsgStream log(msgSvc, "MucGeoMgr");
316 //StatusCode sc;
317
318 return StatusCode::SUCCESS;
319}
320
321//------------------------------------Strip geometry for online display----------------------------
323{
324 MsgStream log(msgSvc, "MucGeoMgr");
325 //StatusCode sc;
326
327 //-------------------------- ideal geometry----------------------
328 ofstream fEast("EastEndStripGeo.dat", ios::out);
329 ofstream fBarrel("BarrelStripGeo.dat", ios::out);
330 ofstream fWest("WestEndStripGeo.dat", ios::out);
331
332 if( fEast.bad() || fBarrel.bad() || fWest.bad() ) {
333 log << MSG::INFO << "Strip: create ouput file error!" << endl;
334 return StatusCode::FAILURE;
335 }
336
337 for( int i=0; i<PART_MAX; i++ )
338 {
339 if( i == BRID )
340 {
341 for( int j=0; j<B_SEG_NUM; j++ )
342 {
343 for( int k=0; k<B_LAY_NUM; k++ )
344 {
345 // Set maximum strip
346 int maxStrip;
347 if( ( k+1 )%2 == 1 )
348 maxStrip = B_ZSTR_NUM; // odd layer
349 else if( j != B_TOP )
350 maxStrip = B_PHISTR_NUM; // even layer not top segment
351 else
352 maxStrip = B_TOPSTR_NUM; // even layer top segment
353
354 for( int n=0; n<maxStrip; n++ )
355 {
356 MucStrip *aMucStrip = new MucStrip( i, j, k, 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"
362 << aMucStrip->GetObjOrgInBes(1) <<"\t"
363 << aMucStrip->GetObjOrgInBes(2) <<"\t"
364 << aMucStrip->GetObjOrgInBes(3) <<"\t"
365 << endl;
366 // delete aMucStrip;
367 } // strip
368 } // layer
369 } // segment
370 } // barrel
371 else if( i == EEID )
372 {
373 for( int j=0; j<E_SEG_NUM; j++ )
374 {
375 for( int k=0; k<E_LAY_NUM; k++ )
376 {
377 for( int n=0; n<E_STR_NUM; n++ )
378 {
379 MucStrip *aMucStrip = new MucStrip( i, j, k, 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"
385 << aMucStrip->GetObjOrgInBes(1) <<"\t"
386 << aMucStrip->GetObjOrgInBes(2) <<"\t"
387 << aMucStrip->GetObjOrgInBes(3) <<"\t"
388 << endl;
389 // delete aMucStrip;
390 } // strip
391 } // layer
392 } // segment
393 } // east endcap
394 else
395 {
396 for( int j=0; j<E_SEG_NUM; j++ )
397 {
398 for( int k=0; k<E_LAY_NUM; k++ )
399 {
400 for( int n=0; n<E_STR_NUM; n++ )
401 {
402 MucStrip *aMucStrip = new MucStrip( i, j, k, 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"
408 << aMucStrip->GetObjOrgInBes(1) <<"\t"
409 << aMucStrip->GetObjOrgInBes(2) <<"\t"
410 << aMucStrip->GetObjOrgInBes(3) <<"\t"
411 << endl;
412 // delete aMucStrip;
413 } // strip
414 } // layer
415 } // segment
416 } // west endcap
417
418 } // part
419
420 fEast.close();
421 fBarrel.close();
422 fWest.close();
423
424 log << MSG::INFO << "Online display strips created." << endreq;
425 return StatusCode::SUCCESS;
426
427}
428
429
430///////////////////////////////////////////////////////////////////////////////////////////////
431// Sub funtions //
432///////////////////////////////////////////////////////////////////////////////////////////////
433//------------------MucAbsorber-------------
434// No alignment
436{
437 MsgStream log(msgSvc, "MucGeoMgr");
438
439 ofstream fOrigin("MucAbsorberOrigin.dat", ios::out);
440 ofstream fPanel("MucAbsorberPanel.dat", ios::out);
441 ofstream fPos("MucAbsorberPanelPos.dat", ios::out);
442
443 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
444 log << MSG::INFO << "Absorber: create ouput file error!" << endreq;
445 return StatusCode::FAILURE;
446 }
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;
450
451 int totalObject = 0;
452
453 for( int i=0; i<PART_MAX; i++ )
454 {
455 if( i == BRID )
456 {
457 for( int j=0; j<B_SEG_NUM; j++ )
458 {
459 for( int k=0; k<B_LAY_NUM; k++ )
460 {
461 for( int n=0; n<B_AS_NUM; n++ )
462 {
463 MucAbsorber *aMucAbsorber = new MucAbsorber( i, j, k, n );
464 fOrigin << i << "\t" << j << "\t" << k << "\t"
465 << aMucAbsorber->GetW() <<"\t"
466 << aMucAbsorber->GetH() <<"\t"
467 << aMucAbsorber->GetL() <<"\t"
468 << aMucAbsorber->GetLocOrgInBes(1) <<"\t"
469 << aMucAbsorber->GetLocOrgInBes(2) <<"\t"
470 << aMucAbsorber->GetLocOrgInBes(3) <<"\t"
471 << aMucAbsorber->GetObjRotToMot(1) <<"\t"
472 << aMucAbsorber->GetObjRotToMot(2) <<"\t"
473 << aMucAbsorber->GetObjRotToMot(3) <<"\t"
474 << endl;
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"
480 << aMucAbsorber->GetObjOrgInLoc(1) <<"\t"
481 << aMucAbsorber->GetObjOrgInLoc(2) <<"\t"
482 << aMucAbsorber->GetObjOrgInLoc(3) <<"\t"
483 << endl;
484 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
485 << aMucAbsorber->GetLocOrgInBes(1) <<"\t"
486 << aMucAbsorber->GetLocOrgInBes(2) <<"\t"
487 << aMucAbsorber->GetLocOrgInBes(3) <<"\t"
488 << aMucAbsorber->GetObjOrgInBes(1) <<"\t"
489 << aMucAbsorber->GetObjOrgInBes(2) <<"\t"
490 << aMucAbsorber->GetObjOrgInBes(3) <<"\t"
491 << aMucAbsorber->GetObjOrgInLoc(1) <<"\t"
492 << aMucAbsorber->GetObjOrgInLoc(2) <<"\t"
493 << aMucAbsorber->GetObjOrgInLoc(3) <<"\t"
494 << endl;
495
496 totalObject++;
497 // delete aMucAbsorber;
498 } // panel
499 } // layer
500 } // segment
501 } // barrel
502 else
503 {
504 for( int j=0; j<E_SEG_NUM; j++ )
505 {
506 for( int k=0; k<E_ASLAY_NUM; k++ )
507 {
508 for( int n=-1; n<E_PANEL_NUM; n++ )
509 {
510 MucAbsorber *aMucAbsorber = new MucAbsorber( i, j, k, n );
511 if( n == -1 )
512 {
513 fOrigin << i << "\t" << j << "\t" << k << "\t"
514 << aMucAbsorber->GetW() <<"\t"
515 << aMucAbsorber->GetH() <<"\t"
516 << aMucAbsorber->GetL() <<"\t"
517 << aMucAbsorber->GetLocOrgInBes(1) <<"\t"
518 << aMucAbsorber->GetLocOrgInBes(2) <<"\t"
519 << aMucAbsorber->GetLocOrgInBes(3) <<"\t"
520 << aMucAbsorber->GetObjRotToMot(1) <<"\t"
521 << aMucAbsorber->GetObjRotToMot(2) <<"\t"
522 << aMucAbsorber->GetObjRotToMot(3) <<"\t"
523 << endl;
524
525 totalObject ++;
526 // delete aMucAbsorber;
527 }
528 else
529 {
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"
535 << aMucAbsorber->GetObjOrgInLoc(1) <<"\t"
536 << aMucAbsorber->GetObjOrgInLoc(2) <<"\t"
537 << aMucAbsorber->GetObjOrgInLoc(3) <<"\t"
538 << endl;
539
540 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
541 << aMucAbsorber->GetLocOrgInBes(1) <<"\t"
542 << aMucAbsorber->GetLocOrgInBes(2) <<"\t"
543 << aMucAbsorber->GetLocOrgInBes(3) <<"\t"
544 << aMucAbsorber->GetObjOrgInBes(1) <<"\t"
545 << aMucAbsorber->GetObjOrgInBes(2) <<"\t"
546 << aMucAbsorber->GetObjOrgInBes(3) <<"\t"
547 << aMucAbsorber->GetObjOrgInLoc(1) <<"\t"
548 << aMucAbsorber->GetObjOrgInLoc(2) <<"\t"
549 << aMucAbsorber->GetObjOrgInLoc(3) <<"\t"
550 << endl;
551 // delete aMucAbsorber;
552 }
553 } // panel
554 } // layer
555 } // segment
556 } // endcap
557 } // part
558
559 fOrigin.close();
560 fPanel.close();
561 fPos.close();
562
563 log << MSG::INFO << totalObject << "\tabsorbers created." << endreq;
564
565 return StatusCode::SUCCESS;
566} // MucAbsorber
567
568//------------------MucGap-------------
569// No alignment
571{
572 MsgStream log(msgSvc, "MucGeoMgr");
573
574 ofstream fOrigin("MucGapOrigin.dat", ios::out);
575 ofstream fPanel("MucGapPanel.dat", ios::out);
576 ofstream fPos("MucGapPanelPos.dat", ios::out);
577
578 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
579 log << MSG::INFO << "Gap: create ouput file error!" << endreq;
580 return StatusCode::FAILURE;
581 }
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;
585
586 int totalObject = 0;
587
588 for( int i=0; i<PART_MAX; i++ )
589 {
590 if( i == BRID )
591 {
592 for( int j=0; j<B_SEG_NUM; j++ )
593 {
594 // set panel number
595 int idMin, idMax;
596 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
597 else { idMin = -1; idMax = 3; }
598
599 for( int k=0; k<B_LAY_NUM; k++ )
600 {
601 for( int n=idMin; n<idMax; n++ )
602 {
603 MucGap *aMucGap = new MucGap( i, j, k, n );
604 if( j == B_TOP && n != -1 ) // barrel top segment panels
605 {
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"
611 << aMucGap->GetObjOrgInLoc(1) <<"\t"
612 << aMucGap->GetObjOrgInLoc(2) <<"\t"
613 << aMucGap->GetObjOrgInLoc(3) <<"\t"
614 << endl;
615 }
616
617 if( j !=B_TOP || n == -1 )
618 {
619 fOrigin<< i << "\t" << j << "\t" << k << "\t"
620 << aMucGap->GetW() <<"\t"
621 << aMucGap->GetH() <<"\t"
622 << aMucGap->GetL() <<"\t"
623 << aMucGap->GetLocOrgInBes(1) <<"\t"
624 << aMucGap->GetLocOrgInBes(2) <<"\t"
625 << aMucGap->GetLocOrgInBes(3) <<"\t"
626 << aMucGap->GetObjRotToMot(1) <<"\t"
627 << aMucGap->GetObjRotToMot(2) <<"\t"
628 << aMucGap->GetObjRotToMot(3) <<"\t"
629 << endl;
630
631 totalObject++;
632 // delete aMucGap;
633 }
634
635 fPos<< i << "\t" << j << "\t" << k << "\t" << n << "\t"
636 << aMucGap->GetLocOrgInBes(1) <<"\t"
637 << aMucGap->GetLocOrgInBes(2) <<"\t"
638 << aMucGap->GetLocOrgInBes(3) <<"\t"
639 << aMucGap->GetObjOrgInBes(1) <<"\t"
640 << aMucGap->GetObjOrgInBes(2) <<"\t"
641 << aMucGap->GetObjOrgInBes(3) <<"\t"
642 << aMucGap->GetObjOrgInLoc(1) <<"\t"
643 << aMucGap->GetObjOrgInLoc(2) <<"\t"
644 << aMucGap->GetObjOrgInLoc(3) <<"\t"
645 << endl;
646 } //panel
647 } // layer
648 } // segment
649 } // barrel
650 else
651 {
652 for( int j=0; j<E_SEG_NUM; j++ )
653 {
654 for( int k=0; k<E_LAY_NUM; k++ )
655 {
656 for( int n=-1; n<E_PANEL_NUM; n++ )
657 {
658 MucGap *aMucGap = new MucGap( i, j, k, n );
659 if( n == -1 )
660 {
661 fOrigin<< i << "\t" << j << "\t" << k << "\t"
662 << aMucGap->GetW() <<"\t"
663 << aMucGap->GetH() <<"\t"
664 << aMucGap->GetL() <<"\t"
665 << aMucGap->GetLocOrgInBes(1) <<"\t"
666 << aMucGap->GetLocOrgInBes(2) <<"\t"
667 << aMucGap->GetLocOrgInBes(3) <<"\t"
668 << aMucGap->GetObjRotToMot(1) <<"\t"
669 << aMucGap->GetObjRotToMot(2) <<"\t"
670 << aMucGap->GetObjRotToMot(3) <<"\t"
671 << endl;
672
673 totalObject++;
674 }
675 else
676 {
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"
682 << aMucGap->GetObjOrgInLoc(1) <<"\t"
683 << aMucGap->GetObjOrgInLoc(2) <<"\t"
684 << aMucGap->GetObjOrgInLoc(3) <<"\t"
685 << endl;
686
687 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
688 << aMucGap->GetLocOrgInBes(1) <<"\t"
689 << aMucGap->GetLocOrgInBes(2) <<"\t"
690 << aMucGap->GetLocOrgInBes(3) <<"\t"
691 << aMucGap->GetObjOrgInBes(1) <<"\t"
692 << aMucGap->GetObjOrgInBes(2) <<"\t"
693 << aMucGap->GetObjOrgInBes(3) <<"\t"
694 << aMucGap->GetObjOrgInLoc(1) <<"\t"
695 << aMucGap->GetObjOrgInLoc(2) <<"\t"
696 << aMucGap->GetObjOrgInLoc(3) <<"\t"
697 << endl;
698 // delete aMucGap;
699 }
700 } // panel
701 } // layer
702 } // segment
703 } // endcap
704 } // for
705
706 fOrigin.close();
707 fPanel.close();
708 fPos.close();
709
710 log << MSG::INFO << totalObject << "\tgaps created." << endreq;
711 return StatusCode::SUCCESS;
712
713} // MucGap
714
715//------------------MucBox-------------
716// Alignment
718{
719 MsgStream log(msgSvc, "MucGeoMgr");
720
721 //-------------------------- ideal geometry----------------------
722 ofstream fOrigin("MucBoxOrigin.dat", ios::out);
723 ofstream fPanel("MucBoxPanel.dat", ios::out);
724 ofstream fPos("MucBoxPanelPos.dat", ios::out);
725
726 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
727 log << MSG::INFO << "Box: create ouput file error!" << endl;
728 return StatusCode::FAILURE;
729 }
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;
733
734 int totalObject = 0;
735 for( int i=0; i<PART_MAX; i++ )
736 {
737 if( i == BRID )
738 {
739 for( int j=0; j<B_SEG_NUM; j++ )
740 {
741 // set panel number
742 int idMin, idMax;
743 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
744 else { idMin = -1; idMax = 3; }
745
746 for( int k=0; k<B_LAY_NUM; k++ )
747 {
748 for( int n=idMin; n<idMax; n++ )
749 {
750 MucBox *aMucBox = new MucBox( i, j, k, n );
751 if( j == B_TOP && n != -1 ) // barrel top segment panels
752 {
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"
758 << aMucBox->GetObjOrgInLoc(1) <<"\t"
759 << aMucBox->GetObjOrgInLoc(2) <<"\t"
760 << aMucBox->GetObjOrgInLoc(3) <<"\t"
761 << endl;
762 }
763
764 if( j !=B_TOP || n == -1 ) // box
765 {
766 fOrigin << i << "\t" << j << "\t" << k << "\t"
767 << aMucBox->GetW() <<"\t"
768 << aMucBox->GetH() <<"\t"
769 << aMucBox->GetL() <<"\t"
770 << aMucBox->GetObjOrgInLoc(1) <<"\t"
771 << aMucBox->GetObjOrgInLoc(2) <<"\t"
772 << aMucBox->GetObjOrgInLoc(3) <<"\t"
773 << endl;
774
775 totalObject++;
776 // delete aMucBox;
777 }
778
779 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
780 << aMucBox->GetLocOrgInBes(1) <<"\t"
781 << aMucBox->GetLocOrgInBes(2) <<"\t"
782 << aMucBox->GetLocOrgInBes(3) <<"\t"
783 << aMucBox->GetObjOrgInBes(1) <<"\t"
784 << aMucBox->GetObjOrgInBes(2) <<"\t"
785 << aMucBox->GetObjOrgInBes(3) <<"\t"
786 << aMucBox->GetObjOrgInLoc(1) <<"\t"
787 << aMucBox->GetObjOrgInLoc(2) <<"\t"
788 << aMucBox->GetObjOrgInLoc(3) <<"\t"
789 << endl;
790 // delete aMucBox;
791 } // panel
792 } // layer
793 } // segment
794 } // barrel
795 else
796 {
797 for( int j=0; j<E_SEG_NUM; j++ )
798 {
799 for( int k=0; k<E_LAY_NUM; k++ )
800 {
801 for( int n=-1; n<E_PANEL_NUM; n++ )
802 {
803 MucBox *aMucBox = new MucBox( i, j, k, n );
804 if( n == -1 )
805 {
806 fOrigin<< i << "\t" << j << "\t" << k << "\t"
807 << aMucBox->GetW() <<"\t"
808 << aMucBox->GetH() <<"\t"
809 << aMucBox->GetL() <<"\t"
810 << aMucBox->GetObjOrgInLoc(1) <<"\t"
811 << aMucBox->GetObjOrgInLoc(2) <<"\t"
812 << aMucBox->GetObjOrgInLoc(3) <<"\t"
813 << endl;
814
815 totalObject++;
816 // delete aMucBox;
817 }
818 else
819 {
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"
825 << aMucBox->GetObjOrgInLoc(1) <<"\t"
826 << aMucBox->GetObjOrgInLoc(2) <<"\t"
827 << aMucBox->GetObjOrgInLoc(3) <<"\t"
828 << endl;
829 // delete aMucBox;
830 }
831
832 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
833 << aMucBox->GetLocOrgInBes(1) <<"\t"
834 << aMucBox->GetLocOrgInBes(2) <<"\t"
835 << aMucBox->GetLocOrgInBes(3) <<"\t"
836 << aMucBox->GetObjOrgInBes(1) <<"\t"
837 << aMucBox->GetObjOrgInBes(2) <<"\t"
838 << aMucBox->GetObjOrgInBes(3) <<"\t"
839 << aMucBox->GetObjOrgInLoc(1) <<"\t"
840 << aMucBox->GetObjOrgInLoc(2) <<"\t"
841 << aMucBox->GetObjOrgInLoc(3) <<"\t"
842 << endl;
843 // delete aMucBox;
844 }
845 } // layer
846 } // segment
847 } // endcap
848 } // for
849
850 fOrigin.close();
851 fPanel.close();
852 fPos.close();
853
854 //-----------------------------real geometry-------------------------
855 if( m_AlignFlag )
856 {
857 ofstream fOrgAlign("MucBoxOriginAligned.dat", ios::out);
858 fOrgAlign << "part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
859 double offset[3];
860 for( int i=0; i<PART_MAX; i++ )
861 {
862 if( i == BRID )
863 {
864 for( int j=0; j<B_SEG_NUM; j++ )
865 {
866 for( int k=0; k<B_LAY_NUM; k++ )
867 {
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] );
873
874 fOrgAlign << i << "\t" << j << "\t" << k << "\t"
875 << aMucBox->GetW() <<"\t"
876 << aMucBox->GetH() <<"\t"
877 << aMucBox->GetL() <<"\t"
878 << aMucBox->GetObjOrgInLoc(1) <<"\t"
879 << aMucBox->GetObjOrgInLoc(2) <<"\t"
880 << aMucBox->GetObjOrgInLoc(3) <<"\t"
881 << endl;
882 // delete aMucBox;
883 } // layer
884 } // segment
885 } // barrel
886 else
887 {
888 for( int j=0; j<E_SEG_NUM; j++ )
889 {
890 for( int k=0; k<E_LAY_NUM; k++ )
891 {
892 MucBox *aMucBox = new MucBox( i, j, k, -1 );
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] );
897
898 fOrgAlign << i << "\t" << j << "\t" << k << "\t"
899 << aMucBox->GetW() <<"\t"
900 << aMucBox->GetH() <<"\t"
901 << aMucBox->GetL() <<"\t"
902 << aMucBox->GetObjOrgInLoc(1) <<"\t"
903 << aMucBox->GetObjOrgInLoc(2) <<"\t"
904 << aMucBox->GetObjOrgInLoc(3) <<"\t"
905 << endl;
906 // delete aMucBox;
907 } // layer
908 } // segment
909 } // endcap
910 } // part
911
912 fOrgAlign.close();
913 } // End align
914
915 log << MSG::INFO << totalObject << "\tboxes created." << endreq;
916 return StatusCode::SUCCESS;
917
918} // MucBox
919
920//------------------MucStripPlane-------------
921// Alignment
923{
924 MsgStream log(msgSvc, "MucGeoMgr");
925
926 //-------------------------- ideal geometry----------------------
927 ofstream fOrigin("MucStripPlaneOrigin.dat", ios::out);
928 ofstream fPanel("MucStripPlanePanel.dat", ios::out);
929 ofstream fPos("MucStripPlanePanelPos.dat", ios::out);
930
931 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
932 log << MSG::INFO << "StripPlane: create ouput file error!" << endl;
933 return StatusCode::FAILURE;
934 }
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;
938
939 int totalObject = 0;
940
941 for( int i=0; i<PART_MAX; i++ )
942 {
943 if( i == BRID )
944 {
945 for( int j=0; j<B_SEG_NUM; j++ )
946 {
947 for( int k=0; k<B_LAY_NUM; k++ )
948 {
949 if( j==B_TOP )
950 {
951 for( int n=-1; n<B_STR_PANEL_NUM; n++ )
952 {
953 MucStripPlane *aMucStripPlane = new MucStripPlane( i, j, k, n );
954 if( n == -1 )
955 {
956 fOrigin << i << "\t" << j << "\t" << k << "\t"
957 << aMucStripPlane->GetW() <<"\t"
958 << aMucStripPlane->GetH() <<"\t"
959 << aMucStripPlane->GetL() <<"\t"
960 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
961 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
962 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
963 << endl;
964 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
965 << aMucStripPlane->GetLocOrgInBes(1) <<"\t"
966 << aMucStripPlane->GetLocOrgInBes(2) <<"\t"
967 << aMucStripPlane->GetLocOrgInBes(3) <<"\t"
968 << aMucStripPlane->GetObjOrgInBes(1) <<"\t"
969 << aMucStripPlane->GetObjOrgInBes(2) <<"\t"
970 << aMucStripPlane->GetObjOrgInBes(3) <<"\t"
971 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
972 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
973 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
974 << endl;
975 totalObject++;
976 // delete aMucStripPlane;
977 }
978 else
979 {
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"
985 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
986 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
987 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
988 << endl;
989
990 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
991 << aMucStripPlane->GetLocOrgInBes(1) <<"\t"
992 << aMucStripPlane->GetLocOrgInBes(2) <<"\t"
993 << aMucStripPlane->GetLocOrgInBes(3) <<"\t"
994 << aMucStripPlane->GetObjOrgInBes(1) <<"\t"
995 << aMucStripPlane->GetObjOrgInBes(2) <<"\t"
996 << aMucStripPlane->GetObjOrgInBes(3) <<"\t"
997 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
998 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
999 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1000 << endl;
1001 // delete aMucStripPlane;
1002 }
1003 }// for
1004 }// B_TOP
1005 else
1006 {
1007 MucStripPlane *aMucStripPlane = new MucStripPlane( i, j, k, 0 );
1008 fOrigin << i << "\t" << j << "\t" << k << "\t"
1009 << aMucStripPlane->GetW() <<"\t"
1010 << aMucStripPlane->GetH() <<"\t"
1011 << aMucStripPlane->GetL() <<"\t"
1012 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1013 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1014 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1015 << endl;
1016 fPos << i << "\t" << j << "\t" << k << "\t" << "\t"
1017 << aMucStripPlane->GetLocOrgInBes(1) <<"\t"
1018 << aMucStripPlane->GetLocOrgInBes(2) <<"\t"
1019 << aMucStripPlane->GetLocOrgInBes(3) <<"\t"
1020 << aMucStripPlane->GetObjOrgInBes(1) <<"\t"
1021 << aMucStripPlane->GetObjOrgInBes(2) <<"\t"
1022 << aMucStripPlane->GetObjOrgInBes(3) <<"\t"
1023 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1024 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1025 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1026 << endl;
1027 totalObject++;
1028 // delete aMucStripPlane;
1029 }
1030 } // layer
1031 } // segment
1032 } // barrel
1033 else
1034 {
1035 for( int j=0; j<E_SEG_NUM; j++ )
1036 {
1037 for( int k=0; k<E_LAY_NUM; k++ )
1038 {
1039 for( int n=-1; n<E_PANEL_NUM; n++ )
1040 {
1041 MucStripPlane *aMucStripPlane = new MucStripPlane( i, j, k, n );
1042 if( n == -1 )
1043 {
1044 fOrigin << i << "\t" << j << "\t" << k << "\t"
1045 << aMucStripPlane->GetW() <<"\t"
1046 << aMucStripPlane->GetH() <<"\t"
1047 << aMucStripPlane->GetL() <<"\t"
1048 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1049 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1050 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1051 << endl;
1052
1053 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
1054 << aMucStripPlane->GetLocOrgInBes(1) <<"\t"
1055 << aMucStripPlane->GetLocOrgInBes(2) <<"\t"
1056 << aMucStripPlane->GetLocOrgInBes(3) <<"\t"
1057 << aMucStripPlane->GetObjOrgInBes(1) <<"\t"
1058 << aMucStripPlane->GetObjOrgInBes(2) <<"\t"
1059 << aMucStripPlane->GetObjOrgInBes(3) <<"\t"
1060 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1061 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1062 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1063 << endl;
1064 totalObject++;
1065 // delete aMucStripPlane;
1066 }
1067 else
1068 {
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"
1074 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1075 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1076 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1077 << endl;
1078
1079 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
1080 << aMucStripPlane->GetLocOrgInBes(1) <<"\t"
1081 << aMucStripPlane->GetLocOrgInBes(2) <<"\t"
1082 << aMucStripPlane->GetLocOrgInBes(3) <<"\t"
1083 << aMucStripPlane->GetObjOrgInBes(1) <<"\t"
1084 << aMucStripPlane->GetObjOrgInBes(2) <<"\t"
1085 << aMucStripPlane->GetObjOrgInBes(3) <<"\t"
1086 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1087 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1088 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1089 << endl;
1090 // delete aMucStripPlane;
1091 }
1092 }
1093 } // layer
1094 } // segment
1095 } // endcap
1096 } // part
1097
1098 fOrigin.close();
1099 fPanel.close();
1100 fPos.close();
1101
1102 //-----------------------------real geometry-------------------------
1103 if( m_AlignFlag )
1104 {
1105 ofstream fOrgAlign("MucStripPlaneOriginAligned.dat", ios::out);
1106 fOrgAlign << "part\tsegment\tlayer\tW\tH\tL\tLoc_x\tLoc_y\tLoc_z" << endl;
1107 double offset[3];
1108 for( int i=0; i<PART_MAX; i++ )
1109 {
1110 if( i == BRID )
1111 {
1112 for( int j=0; j<B_SEG_NUM; j++ )
1113 {
1114 for( int k=0; k<B_LAY_NUM; k++ )
1115 {
1116 MucStripPlane *aMucStripPlane = new MucStripPlane( i, j, k, 0 );
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] );
1121
1122 fOrgAlign << i << "\t" << j << "\t" << k << "\t"
1123 << aMucStripPlane->GetW() <<"\t"
1124 << aMucStripPlane->GetH() <<"\t"
1125 << aMucStripPlane->GetL() <<"\t"
1126 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1127 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1128 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1129 << endl;
1130 // delete aMucStripPlane;
1131 } // layer
1132 } // segment
1133 } // barrel
1134 else
1135 {
1136 for( int j=0; j<E_SEG_NUM; j++ )
1137 {
1138 for( int k=0; k<E_LAY_NUM; k++ )
1139 {
1140 MucStripPlane *aMucStripPlane = new MucStripPlane( i, j, k, -1 );
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] );
1145
1146 fOrgAlign << i << "\t" << j << "\t" << k << "\t"
1147 << aMucStripPlane->GetW() <<"\t"
1148 << aMucStripPlane->GetH() <<"\t"
1149 << aMucStripPlane->GetL() <<"\t"
1150 << aMucStripPlane->GetObjOrgInLoc(1) <<"\t"
1151 << aMucStripPlane->GetObjOrgInLoc(2) <<"\t"
1152 << aMucStripPlane->GetObjOrgInLoc(3) <<"\t"
1153 << endl;
1154 // delete aMucStripPlane;
1155 } // layer
1156 } // segment
1157 } // endcap
1158 } // for
1159
1160 fOrgAlign.close();
1161 } // if
1162
1163 log << MSG::INFO << totalObject << "\tstrip_planes created." << endreq;
1164 return StatusCode::SUCCESS;
1165
1166} // MucStripPlane
1167
1168//------------------MucStrip------------------
1170{
1171 MsgStream log(msgSvc, "MucGeoMgr");
1172
1173 //-------------------------- ideal geometry----------------------
1174 ofstream fOrigin("MucStrip.dat", ios::out);
1175 ofstream fPos("MucStripPos.dat", ios::out);
1176
1177 if( fOrigin.bad() || fPos.bad() ) {
1178 log << MSG::INFO << "Strip: create ouput file error!" << endl;
1179 return StatusCode::FAILURE;
1180 }
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;
1183
1184 int totalObject = 0;
1185
1186 for( int i=0; i<PART_MAX; i++ )
1187 {
1188 if( i == BRID )
1189 {
1190 for( int j=0; j<B_SEG_NUM; j++ )
1191 {
1192 for( int k=0; k<B_LAY_NUM; k++ )
1193 {
1194 // Set maximum strip
1195 int maxStrip;
1196 if( ( k+1 )%2 == 1 )
1197 maxStrip = B_ZSTR_NUM; // odd layer
1198 else if( j != B_TOP )
1199 maxStrip = B_PHISTR_NUM; // even layer not top segment
1200 else
1201 maxStrip = B_TOPSTR_NUM; // even layer top segment
1202
1203 for( int n=0; n<maxStrip; n++ )
1204 {
1205 MucStrip *aMucStrip = new MucStrip( i, j, k, 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"
1211 << aMucStrip->GetObjOrgInLoc(1) <<"\t"
1212 << aMucStrip->GetObjOrgInLoc(2) <<"\t"
1213 << aMucStrip->GetObjOrgInLoc(3) <<"\t"
1214 << aMucStrip->GetObjOrgInBes(1) <<"\t"
1215 << aMucStrip->GetObjOrgInBes(2) <<"\t"
1216 << aMucStrip->GetObjOrgInBes(3) <<"\t"
1217 << endl;
1218
1219 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
1220 << aMucStrip->GetType() <<"\t"
1221 << aMucStrip->GetLocOrgInBes(1) <<"\t"
1222 << aMucStrip->GetLocOrgInBes(2) <<"\t"
1223 << aMucStrip->GetLocOrgInBes(3) <<"\t"
1224 << aMucStrip->GetObjOrgInBes(1) <<"\t"
1225 << aMucStrip->GetObjOrgInBes(2) <<"\t"
1226 << aMucStrip->GetObjOrgInBes(3) <<"\t"
1227 << aMucStrip->GetObjOrgInLoc(1) <<"\t"
1228 << aMucStrip->GetObjOrgInLoc(2) <<"\t"
1229 << aMucStrip->GetObjOrgInLoc(3) <<"\t"
1230 << endl;
1231
1232 totalObject++;
1233 // delete aMucStrip;
1234 } // for
1235 } // layer
1236 } // segment
1237 } // barrel
1238 else
1239 {
1240 for( int j=0; j<E_SEG_NUM; j++ )
1241 {
1242 for( int k=0; k<E_LAY_NUM; k++ )
1243 {
1244 for( int n=0; n<E_STR_NUM; n++ )
1245 {
1246 MucStrip *aMucStrip = new MucStrip( i, j, k, 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"
1252 << aMucStrip->GetObjOrgInLoc(1) <<"\t"
1253 << aMucStrip->GetObjOrgInLoc(2) <<"\t"
1254 << aMucStrip->GetObjOrgInLoc(3) <<"\t"
1255 << aMucStrip->GetObjOrgInBes(1) <<"\t"
1256 << aMucStrip->GetObjOrgInBes(2) <<"\t"
1257 << aMucStrip->GetObjOrgInBes(3) <<"\t"
1258 << endl;
1259
1260 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
1261 << aMucStrip->GetType() << "\t"
1262 << aMucStrip->GetLocOrgInBes(1) <<"\t"
1263 << aMucStrip->GetLocOrgInBes(2) <<"\t"
1264 << aMucStrip->GetLocOrgInBes(3) <<"\t"
1265 << aMucStrip->GetObjOrgInBes(1) <<"\t"
1266 << aMucStrip->GetObjOrgInBes(2) <<"\t"
1267 << aMucStrip->GetObjOrgInBes(3) <<"\t"
1268 << aMucStrip->GetObjOrgInLoc(1) <<"\t"
1269 << aMucStrip->GetObjOrgInLoc(2) <<"\t"
1270 << aMucStrip->GetObjOrgInLoc(3) <<"\t"
1271 << endl;
1272 totalObject++;
1273 // delete aMucStrip;
1274 } // for
1275 } // layer
1276 } // segment
1277 } // endcap
1278 } // for
1279
1280 fOrigin.close();
1281 fPos.close();
1282
1283 log << MSG::INFO << totalObject << "\tstrips created." << endreq;
1284 return StatusCode::SUCCESS;
1285
1286} // MucStrip
1287
1288
1289//------------------MucRpc--------------------
1291{
1292 MsgStream log(msgSvc, "MucGeoMgr");
1293
1294 //-------------------------- ideal geometry----------------------
1295 ofstream fOrigin("MucRpc.dat", ios::out);
1296 ofstream fPos("MucRpcPos.dat", ios::out);
1297
1298 if( fOrigin.bad() || fPos.bad() ) {
1299 log << MSG::INFO << "Rpc: create ouput file error!" << endl;
1300 return StatusCode::FAILURE;
1301 }
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;
1304
1305 int totalObject = 0;
1306
1307 for( int i=0; i<PART_MAX; i++ )
1308 {
1309 if( i == BRID )
1310 {
1311 for( int j=0; j<B_SEG_NUM; j++ )
1312 {
1313 // Set maximum rpc
1314 int maxRpc;
1315 if( j ==B_TOP )
1316 maxRpc = B_TOP_RPC_NUM; // top segment
1317 else
1318 maxRpc = B_RPC_NUM; // not top segment
1319
1320 for( int k=0; k<B_LAY_NUM; k++ )
1321 {
1322 for( int m=0; m<SL_NUM; m++ )
1323 {
1324 for( int n=0; n<maxRpc; n++ )
1325 {
1326 MucRpc *aMucRpc = new MucRpc( i, j, k, m, 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"
1333 << aMucRpc->GetObjOrgInLoc(1) <<"\t"
1334 << aMucRpc->GetObjOrgInLoc(2) <<"\t"
1335 << aMucRpc->GetObjOrgInLoc(3) <<"\t"
1336 << aMucRpc->GetObjOrgInBes(1) <<"\t"
1337 << aMucRpc->GetObjOrgInBes(2) <<"\t"
1338 << aMucRpc->GetObjOrgInBes(3) <<"\t"
1339 << endl;
1340
1341 fPos << i << "\t" << j << "\t" << k << "\t"
1342 << m << "\t" << n << "\t"
1343 << aMucRpc->GetLocOrgInBes(1) <<"\t"
1344 << aMucRpc->GetLocOrgInBes(2) <<"\t"
1345 << aMucRpc->GetLocOrgInBes(3) <<"\t"
1346 << aMucRpc->GetObjOrgInBes(1) <<"\t"
1347 << aMucRpc->GetObjOrgInBes(2) <<"\t"
1348 << aMucRpc->GetObjOrgInBes(3) <<"\t"
1349 << aMucRpc->GetObjOrgInLoc(1) <<"\t"
1350 << aMucRpc->GetObjOrgInLoc(2) <<"\t"
1351 << aMucRpc->GetObjOrgInLoc(3) <<"\t"
1352 << endl;
1353
1354 totalObject++;
1355 // delete aMucRpc;
1356 } // for
1357 } // super layer
1358 } // layer
1359 } // segment
1360 } // barrel
1361 else
1362 {
1363 for( int j=0; j<E_SEG_NUM; j++ )
1364 {
1365 for( int k=0; k<E_LAY_NUM; k++ )
1366 {
1367 for( int m=0; m<SL_NUM; m++ )
1368 {
1369 for( int n=0; n<E_RPC_NUM[m]; n++ )
1370 {
1371 MucRpc *aMucRpc = new MucRpc( i, j, k, 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"
1378 << aMucRpc->GetObjOrgInLoc(1) <<"\t"
1379 << aMucRpc->GetObjOrgInLoc(2) <<"\t"
1380 << aMucRpc->GetObjOrgInLoc(3) <<"\t"
1381 << aMucRpc->GetObjOrgInBes(1) <<"\t"
1382 << aMucRpc->GetObjOrgInBes(2) <<"\t"
1383 << aMucRpc->GetObjOrgInBes(3) <<"\t"
1384 << endl;
1385
1386 fPos << i << "\t" << j << "\t" << k << "\t"
1387 << m << "\t" << n << "\t"
1388 << aMucRpc->GetLocOrgInBes(1) <<"\t"
1389 << aMucRpc->GetLocOrgInBes(2) <<"\t"
1390 << aMucRpc->GetLocOrgInBes(3) <<"\t"
1391 << aMucRpc->GetObjOrgInBes(1) <<"\t"
1392 << aMucRpc->GetObjOrgInBes(2) <<"\t"
1393 << aMucRpc->GetObjOrgInBes(3) <<"\t"
1394 << aMucRpc->GetObjOrgInLoc(1) <<"\t"
1395 << aMucRpc->GetObjOrgInLoc(2) <<"\t"
1396 << aMucRpc->GetObjOrgInLoc(3) <<"\t"
1397 << endl;
1398 totalObject++;
1399 // delete aMucRpc;
1400 } // for
1401 } // super layer
1402 } // layer
1403 } // segment
1404 } // endcap
1405 } // for, part
1406
1407 fOrigin.close();
1408 fPos.close();
1409
1410 log << MSG::INFO << totalObject << "\t RPCs created." << endreq;
1411 return StatusCode::SUCCESS;
1412
1413} // MucRpc
1414
1415//------------------MucGas--------------------
1417{
1418 MsgStream log(msgSvc, "MucGeoMgr");
1419
1420 //-------------------------- ideal geometry----------------------
1421 ofstream fOrigin("MucGas.dat", ios::out);
1422 ofstream fPos("MucGasPos.dat", ios::out);
1423
1424 if( fOrigin.bad() || fPos.bad() ) {
1425 log << MSG::INFO << "Gas: create ouput file error!" << endl;
1426 return StatusCode::FAILURE;
1427 }
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;
1430
1431 int totalObject = 0;
1432
1433 for( int i=0; i<PART_MAX; i++ )
1434 {
1435 if( i == BRID )
1436 {
1437 for( int j=0; j<B_SEG_NUM; j++ )
1438 {
1439 // Set maximum gas
1440 int maxRpc;
1441 if( j ==B_TOP )
1442 maxRpc = B_TOP_RPC_NUM; // top segment
1443 else
1444 maxRpc = B_RPC_NUM; // not top segment
1445
1446 for( int k=0; k<B_LAY_NUM; k++ )
1447 {
1448 for( int m=0; m<SL_NUM; m++ )
1449 {
1450 for( int n=0; n<maxRpc; n++ )
1451 {
1452 MucGas *aMucGas = new MucGas( i, j, k, m, n, 0);
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"
1459 << aMucGas->GetObjOrgInLoc(1) <<"\t"
1460 << aMucGas->GetObjOrgInLoc(2) <<"\t"
1461 << aMucGas->GetObjOrgInLoc(3) <<"\t"
1462 << aMucGas->GetObjOrgInBes(1) <<"\t"
1463 << aMucGas->GetObjOrgInBes(2) <<"\t"
1464 << aMucGas->GetObjOrgInBes(3) <<"\t"
1465 << endl;
1466
1467 fPos << i << "\t" << j << "\t" << k << "\t" << n << "\t"
1468 << aMucGas->GetLocOrgInBes(1) <<"\t"
1469 << aMucGas->GetLocOrgInBes(2) <<"\t"
1470 << aMucGas->GetLocOrgInBes(3) <<"\t"
1471 << aMucGas->GetObjOrgInBes(1) <<"\t"
1472 << aMucGas->GetObjOrgInBes(2) <<"\t"
1473 << aMucGas->GetObjOrgInBes(3) <<"\t"
1474 << aMucGas->GetObjOrgInLoc(1) <<"\t"
1475 << aMucGas->GetObjOrgInLoc(2) <<"\t"
1476 << aMucGas->GetObjOrgInLoc(3) <<"\t"
1477 << endl;
1478
1479 totalObject++;
1480 // delete aMucGas;
1481 } // for
1482 } // super layer
1483 } // layer
1484 } // segment
1485 } // barrel
1486 else
1487 {
1488 for( int j=0; j<E_SEG_NUM; j++ )
1489 {
1490 for( int k=0; k<E_LAY_NUM; k++ )
1491 {
1492 for( int m=0; m<SL_NUM; m++ )
1493 {
1494 for( int n=0; n<E_RPC_NUM[m]; n++ )
1495 {
1496 MucGas *aMucGas = new MucGas( i, j, k, m, n, 0 );
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"
1503 << aMucGas->GetObjOrgInLoc(1) <<"\t"
1504 << aMucGas->GetObjOrgInLoc(2) <<"\t"
1505 << aMucGas->GetObjOrgInLoc(3) <<"\t"
1506 << aMucGas->GetObjOrgInBes(1) <<"\t"
1507 << aMucGas->GetObjOrgInBes(2) <<"\t"
1508 << aMucGas->GetObjOrgInBes(3) <<"\t"
1509 << endl;
1510
1511 fPos << i << "\t" << j << "\t" << k << "\t"
1512 << m << "\t" << n << "\t"
1513 << aMucGas->GetLocOrgInBes(1) <<"\t"
1514 << aMucGas->GetLocOrgInBes(2) <<"\t"
1515 << aMucGas->GetLocOrgInBes(3) <<"\t"
1516 << aMucGas->GetObjOrgInBes(1) <<"\t"
1517 << aMucGas->GetObjOrgInBes(2) <<"\t"
1518 << aMucGas->GetObjOrgInBes(3) <<"\t"
1519 << aMucGas->GetObjOrgInLoc(1) <<"\t"
1520 << aMucGas->GetObjOrgInLoc(2) <<"\t"
1521 << aMucGas->GetObjOrgInLoc(3) <<"\t"
1522 << endl;
1523 totalObject++;
1524 // delete aMucGas;
1525 } // for
1526 } // super layer
1527 } // layer
1528 } // segment
1529 } // endcap
1530 } // for, part
1531
1532 fOrigin.close();
1533 fPos.close();
1534
1535 log << MSG::INFO << totalObject << "\tgases created." << endreq;
1536 return StatusCode::SUCCESS;
1537
1538} // MucGas
1539
1540//------------------MucBakelite---------------
1542{
1543 MsgStream log(msgSvc, "MucGeoMgr");
1544
1545 //-------------------------- ideal geometry----------------------
1546 ofstream fOrigin("MucBakelite.dat", ios::out);
1547 ofstream fPos("MucBakelitePos.dat", ios::out);
1548
1549 if( fOrigin.bad() || fPos.bad() ) {
1550 log << MSG::INFO << "Bakelite: create ouput file error!" << endl;
1551 return StatusCode::FAILURE;
1552 }
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;
1557
1558 int totalObject = 0;
1559
1560 for( int i=0; i<PART_MAX; i++ )
1561 {
1562 if( i == BRID )
1563 {
1564 for( int j=0; j<B_SEG_NUM; j++ )
1565 {
1566 // Set maximum rpc number
1567 int maxRpc;
1568 if( j ==B_TOP )
1569 maxRpc = B_TOP_RPC_NUM; // top segment
1570 else
1571 maxRpc = B_RPC_NUM; // not top segment
1572
1573 for( int k=0; k<B_LAY_NUM; k++ )
1574 {
1575 for( int m=0; m<SL_NUM; m++ )
1576 {
1577 for( int n=0; n<maxRpc; n++ )
1578 {
1579 for( int t=0; t<BKLT_NUM; t++)
1580 {
1581 MucBakelite *aMucBakelite = new MucBakelite( i, j, k, m, n, 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"
1588 << aMucBakelite->GetObjOrgInLoc(1) <<"\t"
1589 << aMucBakelite->GetObjOrgInLoc(2) <<"\t"
1590 << aMucBakelite->GetObjOrgInLoc(3) <<"\t"
1591 << aMucBakelite->GetObjOrgInBes(1) <<"\t"
1592 << aMucBakelite->GetObjOrgInBes(2) <<"\t"
1593 << aMucBakelite->GetObjOrgInBes(3) <<"\t"
1594 << endl;
1595
1596 fPos << i << "\t" << j << "\t" << k << "\t"
1597 << m << "\t" << n << "\t" << t << "\t"
1598 << aMucBakelite->GetLocOrgInBes(1) <<"\t"
1599 << aMucBakelite->GetLocOrgInBes(2) <<"\t"
1600 << aMucBakelite->GetLocOrgInBes(3) <<"\t"
1601 << aMucBakelite->GetObjOrgInBes(1) <<"\t"
1602 << aMucBakelite->GetObjOrgInBes(2) <<"\t"
1603 << aMucBakelite->GetObjOrgInBes(3) <<"\t"
1604 << aMucBakelite->GetObjOrgInLoc(1) <<"\t"
1605 << aMucBakelite->GetObjOrgInLoc(2) <<"\t"
1606 << aMucBakelite->GetObjOrgInLoc(3) <<"\t"
1607 << endl;
1608
1609 totalObject++;
1610 // delete aMucBakelite;
1611 } // bakelite
1612 } // rpc
1613 } // super layer
1614 } // layer
1615 } // segment
1616 } // barrel
1617 else
1618 {
1619 for( int j=0; j<E_SEG_NUM; j++ )
1620 {
1621 for( int k=0; k<E_LAY_NUM; k++ )
1622 {
1623 for( int m=0; m<SL_NUM; m++ )
1624 {
1625 for( int n=0; n<E_RPC_NUM[m]; n++ )
1626 {
1627 for( int t=0; t<BKLT_NUM; t++ )
1628 {
1629 MucBakelite *aMucBakelite = new MucBakelite( i, j, k, m, n, 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"
1636 << aMucBakelite->GetObjOrgInLoc(1) <<"\t"
1637 << aMucBakelite->GetObjOrgInLoc(2) <<"\t"
1638 << aMucBakelite->GetObjOrgInLoc(3) <<"\t"
1639 << aMucBakelite->GetObjOrgInBes(1) <<"\t"
1640 << aMucBakelite->GetObjOrgInBes(2) <<"\t"
1641 << aMucBakelite->GetObjOrgInBes(3) <<"\t"
1642 << endl;
1643
1644 fPos << i << "\t" << j << "\t" << k << "\t"
1645 << m << "\t" << n << "\t" << t << "\t"
1646 << aMucBakelite->GetLocOrgInBes(1) <<"\t"
1647 << aMucBakelite->GetLocOrgInBes(2) <<"\t"
1648 << aMucBakelite->GetLocOrgInBes(3) <<"\t"
1649 << aMucBakelite->GetObjOrgInBes(1) <<"\t"
1650 << aMucBakelite->GetObjOrgInBes(2) <<"\t"
1651 << aMucBakelite->GetObjOrgInBes(3) <<"\t"
1652 << aMucBakelite->GetObjOrgInLoc(1) <<"\t"
1653 << aMucBakelite->GetObjOrgInLoc(2) <<"\t"
1654 << aMucBakelite->GetObjOrgInLoc(3) <<"\t"
1655 << endl;
1656
1657 totalObject++;
1658 // delete aMucBakelite;
1659 } // bakelite
1660 } // rpc
1661 } // super layer
1662 } // layer
1663 } // segment
1664 } // endcap
1665 } // for, part
1666
1667 fOrigin.close();
1668 fPos.close();
1669
1670 log << MSG::INFO << totalObject << "\tbakelites created." << endreq;
1671 return StatusCode::SUCCESS;
1672
1673} // MucBakelite
1674
1675//------------------MucBoxCover---------------
1677{
1678 MsgStream log(msgSvc, "MucGeoMgr");
1679
1680 //-------------------------- ideal geometry----------------------
1681 ofstream fOrigin("MucBoxCoverOrigin.dat", ios::out);
1682 ofstream fPanel("MucBoxCoverPanel.dat", ios::out);
1683 ofstream fPos("MucBoxCoverPanelPos.dat", ios::out);
1684
1685 if( fOrigin.bad() || fPanel.bad() || fPos.bad() ) {
1686 log << MSG::INFO << "BoxCover: create ouput file error!" << endl;
1687 return StatusCode::FAILURE;
1688 }
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;
1692
1693 int totalObject = 0;
1694
1695 for( int i=0; i<PART_MAX; i++ )
1696 {
1697 if( i == BRID )
1698 {
1699 for( int j=0; j<B_SEG_NUM; j++ )
1700 {
1701 // set panel number
1702 int idMin, idMax;
1703 if( j != B_TOP ) { idMin = 0; idMax = B_GP_NUM; }
1704 else { idMin = -1; idMax = 3; }
1705
1706 for( int k=0; k<B_LAY_NUM; k++ )
1707 {
1708 for( int m=0; m<SL_NUM; m++ )
1709 {
1710 for( int n = idMin; n<idMax; n++ )
1711 {
1712 MucBoxCover *aMucBoxCover = new MucBoxCover( i, j, k, m, n );
1713 if( j == B_TOP || n != -1 ) // barrel top segment panels
1714 {
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"
1721 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1722 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1723 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1724 << endl;
1725 // delete aMucBoxCover;
1726 }
1727
1728 if( j != B_TOP || n == -1 ) // box cover
1729 {
1730 fOrigin << i << "\t" << j << "\t" << k << "\t"
1731 << m << "\t"
1732 << aMucBoxCover->GetW() <<"\t"
1733 << aMucBoxCover->GetH() <<"\t"
1734 << aMucBoxCover->GetL() <<"\t"
1735 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1736 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1737 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1738 << endl;
1739
1740 totalObject++;
1741 // delete aMucBoxCover;
1742 }
1743
1744 fPos << i << "\t" << j << "\t" << k << "\t"
1745 << m << "\t" << n << "\t"
1746 << aMucBoxCover->GetLocOrgInBes(1) <<"\t"
1747 << aMucBoxCover->GetLocOrgInBes(2) <<"\t"
1748 << aMucBoxCover->GetLocOrgInBes(3) <<"\t"
1749 << aMucBoxCover->GetObjOrgInBes(1) <<"\t"
1750 << aMucBoxCover->GetObjOrgInBes(2) <<"\t"
1751 << aMucBoxCover->GetObjOrgInBes(3) <<"\t"
1752 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1753 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1754 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1755 << endl;
1756 // delete aMucBoxCover;
1757 } // panel
1758 }// super layer
1759 } // layer
1760 } // segment
1761 } // barrel
1762 else
1763 {
1764 for( int j=0; j<E_SEG_NUM; j++ )
1765 {
1766 for( int k=0; k<E_LAY_NUM; k++ )
1767 {
1768 for( int m=0; m<SL_NUM; m++ )
1769 {
1770 for( int n=-1; n<E_PANEL_NUM; n++ )
1771 {
1772 MucBoxCover *aMucBoxCover = new MucBoxCover( i, j, k, m, n );
1773 if( n == -1 )
1774 {
1775 fOrigin << i << "\t" << j << "\t" << k << "\t"
1776 << m << "\t"
1777 << aMucBoxCover->GetW() <<"\t"
1778 << aMucBoxCover->GetH() <<"\t"
1779 << aMucBoxCover->GetL() <<"\t"
1780 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1781 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1782 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1783 << endl;
1784 totalObject++;
1785 // delete aMucBoxCover;
1786 }
1787 else
1788 {
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"
1795 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1796 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1797 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1798 << endl;
1799 // delete aMucBoxCover;
1800 }
1801
1802 fPos << i << "\t" << j << "\t" << k << "\t"
1803 << m << "\t" << n << "\t"
1804 << aMucBoxCover->GetLocOrgInBes(1) <<"\t"
1805 << aMucBoxCover->GetLocOrgInBes(2) <<"\t"
1806 << aMucBoxCover->GetLocOrgInBes(3) <<"\t"
1807 << aMucBoxCover->GetObjOrgInBes(1) <<"\t"
1808 << aMucBoxCover->GetObjOrgInBes(2) <<"\t"
1809 << aMucBoxCover->GetObjOrgInBes(3) <<"\t"
1810 << aMucBoxCover->GetObjOrgInLoc(1) <<"\t"
1811 << aMucBoxCover->GetObjOrgInLoc(2) <<"\t"
1812 << aMucBoxCover->GetObjOrgInLoc(3) <<"\t"
1813 << endl;
1814 // delete aMucBoxCover;
1815 } // panel
1816 } // super layer
1817 } // layer
1818 } // segment
1819 } // endcap
1820 } // for
1821
1822 fOrigin.close();
1823 fPanel.close();
1824 fPos.close();
1825
1826 log << MSG::INFO << totalObject << "\tbox_covers created." << endreq;
1827 return StatusCode::SUCCESS;
1828
1829} // MucBoxCover
1830
1831//=================================== Geometry entities getting methods====================================
1832MucAbsorber* MucGeoMgr::GetAbsorber( int part, int segment, int layer, int id )
1833{
1834 if( m_MucAbsorber != NULL ) delete m_MucAbsorber;
1835 return ( m_MucAbsorber = new MucAbsorber(part, segment, layer, id) );
1836}
1837
1838MucGap* MucGeoMgr::GetGap( int part, int segment, int layer, int id )
1839{
1840 if( m_MucGap != NULL ) delete m_MucGap;
1841 return ( m_MucGap = new MucGap(part, segment, layer, id) );
1842}
1843
1844MucBox* MucGeoMgr::GetBox( int part, int segment, int layer, int id )
1845{
1846 if( m_MucBox != NULL ) delete m_MucBox;
1847 return ( m_MucBox = new MucBox(part, segment, layer, id) );
1848}
1849
1850MucStripPlane* MucGeoMgr::GetStripPlane( int part, int segment, int layer, int id )
1851{
1852 if( m_MucStripPlane != NULL ) delete m_MucStripPlane;
1853 return ( m_MucStripPlane = new MucStripPlane(part, segment, layer, id) );
1854}
1855
1856MucStrip* MucGeoMgr::GetStrip( int part, int segment, int layer, int id )
1857{
1858 if( m_MucStrip != NULL ) delete m_MucStrip;
1859 return ( m_MucStrip = new MucStrip(part, segment, layer, id) );
1860}
1861
1862MucRpc* MucGeoMgr::GetRpc( int part, int segment, int layer, int upDown, int id )
1863{
1864 if( m_MucRpc != NULL ) delete m_MucRpc;
1865 return ( m_MucRpc = new MucRpc(part, segment, layer, upDown, id) );
1866}
1867
1868MucGas* MucGeoMgr::GetGas( int part, int segment, int layer, int upDown, int rpcId, int id )
1869{
1870 if( m_MucGas != NULL ) delete m_MucGas;
1871 return ( m_MucGas = new MucGas(part, segment, layer, upDown, rpcId, id) );
1872}
1873
1874MucBakelite* MucGeoMgr::GetBakelite( int part, int segment, int layer, int upDown, int rpcId, int id )
1875{
1876 if( m_MucBakelite != NULL ) delete m_MucBakelite;
1877 return ( m_MucBakelite = new MucBakelite(part, segment, layer, upDown, rpcId, id) );
1878}
1879
1880MucBoxCover* MucGeoMgr::GetBoxCover( int part, int segment, int layer, int upDown, int id )
1881{
1882 if( m_MucBoxCover != NULL ) delete m_MucBoxCover;
1883 return ( m_MucBoxCover = new MucBoxCover(part, segment, layer, upDown, id) );
1884}
1885
1886// END
const Int_t n
const unsigned int ENTITY_NUM
Definition MucGeoMgr.h:44
#define NULL
TTree * t
Definition binning.cxx:23
virtual void SetAlignment(double dx, double dy, double dz)
Definition MucBox.cxx:397
double GetWu()
double GetW()
double GetObjRotToMot(int i)
double GetObjOrgInBes(int i)
double GetLocOrgInBes(int i)
double GetWd()
double GetH()
double GetL()
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)
StatusCode CreateRpc()
MucAbsorber * GetAbsorber(int part, int segment, int layer, int id)
StatusCode CreateGas()
MucStripPlane * GetStripPlane(int part, int segment, int layer, int id)
MucGeoMgr(const std::string createFlag, bool alignFlag, const std::string alignFile)
Definition MucGeoMgr.cxx:26
MucGas * GetGas(int part, int segment, int layer, int upDown, int rpcId, int id)
StatusCode InitOffset()
Definition MucGeoMgr.cxx:56
IMessageSvc * msgSvc
Definition MucGeoMgr.h:66
StatusCode CreateGap()
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)
StatusCode CreateStrip()
MucBox * GetBox(int part, int segment, int layer, int id)
bool CheckBoxOffset(int part, int segment, int layer, int axis, double offset)
StatusCode CreateBox()
StatusCode CreateEntities()
StatusCode CreateRootGeo()
MucRpc * GetRpc(int part, int segment, int layer, int upDown, int id)
bool SetBoxPos(int boxid, int *part, int *segment, int *layer)
virtual void SetAlignment(double dx, double dy, double dz)
int GetType()
Definition MucStrip.cxx:88