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