12#include <TGeoManager.h>
13#include <TGeoPhysicalNode.h>
15#include <TVirtualMC.h>
16#include <fairlogger/Logger.h>
33 createPadPlaneArray();
44 int sector = getSector(det);
45 float phi = 2.0 * TMath::Pi() / (float)
NSECTOR * ((
float)sector + 0.5);
47 glb[0] = loc[0] * TMath::Cos(phi) - loc[1] * TMath::Sin(phi);
48 glb[1] = loc[0] * TMath::Sin(phi) + loc[1] * TMath::Cos(phi);
61 for (
int ilayer = 0; ilayer <
NLAYER; ilayer++) {
62 for (
int istack = 0; istack <
NSTACK; istack++) {
63 createPadPlane(ilayer, istack);
69void Geometry::createPadPlane(
int ilayer,
int istack)
74 int ipp = getDetectorSec(ilayer, istack);
78 padPlane.setStack(istack);
80 padPlane.setRowSpacing(0.0);
81 padPlane.setColSpacing(0.0);
83 padPlane.setLengthRim(1.0);
84 padPlane.setWidthRim(0.5);
86 padPlane.setNcols(144);
88 padPlane.setAnodeWireOffset(0.25);
93 const float kTiltAngle = 2.0;
98 padPlane.setNrows(12);
99 padPlane.setLength(108.0);
100 padPlane.setLengthOPad(8.0);
101 padPlane.setLengthIPad(9.0);
104 padPlane.setNrows(16);
105 padPlane.setLength(122.0);
106 padPlane.setLengthOPad(7.5);
107 padPlane.setLengthIPad(7.5);
109 padPlane.setWidth(92.2);
110 padPlane.setWidthOPad(0.515);
111 padPlane.setWidthIPad(0.635);
112 padPlane.setTiltingAngle(-kTiltAngle);
117 padPlane.setNrows(12);
118 padPlane.setLength(108.0);
119 padPlane.setLengthOPad(8.0);
120 padPlane.setLengthIPad(9.0);
123 padPlane.setNrows(16);
124 padPlane.setLength(122.0);
125 padPlane.setLengthOPad(7.5);
126 padPlane.setLengthIPad(7.5);
128 padPlane.setWidth(96.6);
129 padPlane.setWidthOPad(0.585);
130 padPlane.setWidthIPad(0.665);
131 padPlane.setTiltingAngle(kTiltAngle);
136 padPlane.setNrows(12);
137 padPlane.setLength(108.0);
138 padPlane.setLengthOPad(8.0);
139 padPlane.setLengthIPad(9.0);
142 padPlane.setNrows(16);
143 padPlane.setLength(129.0);
144 padPlane.setLengthOPad(7.5);
145 padPlane.setLengthIPad(8.0);
147 padPlane.setWidth(101.1);
148 padPlane.setWidthOPad(0.705);
149 padPlane.setWidthIPad(0.695);
150 padPlane.setTiltingAngle(-kTiltAngle);
155 padPlane.setNrows(12);
156 padPlane.setLength(108.0);
157 padPlane.setLengthOPad(8.0);
158 padPlane.setLengthIPad(9.0);
161 padPlane.setNrows(16);
162 padPlane.setLength(136.0);
163 padPlane.setLengthOPad(7.5);
164 padPlane.setLengthIPad(8.5);
166 padPlane.setWidth(105.5);
167 padPlane.setWidthOPad(0.775);
168 padPlane.setWidthIPad(0.725);
169 padPlane.setTiltingAngle(kTiltAngle);
174 padPlane.setNrows(12);
175 padPlane.setLength(108.0);
176 padPlane.setLengthOPad(8.0);
179 padPlane.setNrows(16);
180 padPlane.setLength(143.0);
181 padPlane.setLengthOPad(7.5);
183 padPlane.setWidth(109.9);
184 padPlane.setWidthOPad(0.845);
185 padPlane.setLengthIPad(9.0);
186 padPlane.setWidthIPad(0.755);
187 padPlane.setTiltingAngle(-kTiltAngle);
192 padPlane.setNrows(12);
193 padPlane.setLength(108.0);
194 padPlane.setLengthOPad(8.0);
197 padPlane.setNrows(16);
198 padPlane.setLength(145.0);
199 padPlane.setLengthOPad(8.5);
201 padPlane.setWidth(114.4);
202 padPlane.setWidthOPad(0.965);
203 padPlane.setLengthIPad(9.0);
204 padPlane.setWidthIPad(0.785);
205 padPlane.setTiltingAngle(kTiltAngle);
214 float row =
CLENGTH[ilayer][istack] / 2.0 -
RPADW - padPlane.getLengthRim();
215 for (
int ir = 0;
ir < padPlane.getNrows();
ir++) {
216 padPlane.setPadRow(
ir,
row);
217 row -= padPlane.getRowSpacing();
219 row -= padPlane.getLengthOPad();
221 row -= padPlane.getLengthIPad();
227 float col = -
CWIDTH[ilayer] / 2.0 -
CROW + padPlane.getWidthRim();
228 for (
int ic = 0; ic < padPlane.getNcols(); ic++) {
229 padPlane.setPadCol(ic,
col);
230 col += padPlane.getColSpacing();
232 col += padPlane.getWidthOPad();
234 col += padPlane.getWidthIPad();
240 for (
int jstack = 0; jstack < istack; jstack++) {
241 rowTmp -=
CLENGTH[ilayer][jstack];
243 padPlane.setPadRowSMOffset(rowTmp -
CLENGTH[ilayer][istack] / 2.0);
246void Geometry::createVolume(
const char*
name,
const char* shape,
int nmed,
float* upar,
int np)
248 TVirtualMC::GetMC()->Gsvolu(
name, shape, nmed, upar, np);
252 if (
name[1] ==
'J' ||
name[1] ==
'K') {
253 mSensitiveVolumeNames.emplace_back(
name);
265 LOG(fatal) <<
"Geometry is not loaded";
268 createVolumes(idtmed);
271void Geometry::createVolumes(std::vector<int>
const& idtmed)
316 const int kNparTrd = 4;
317 const int kNparCha = 3;
323 float parTrd[kNparTrd];
324 float parCha[kNparCha];
326 const int kTag = 100;
343 createVolume(
"UTR1",
"TRD1", idtmed[2], parTrd, kNparTrd);
344 createVolume(
"UTR2",
"TRD1", idtmed[2], parTrd, kNparTrd);
345 createVolume(
"UTR3",
"TRD1", idtmed[2], parTrd, kNparTrd);
346 createVolume(
"UTR4",
"TRD1", idtmed[2], parTrd, kNparTrd);
352 createVolume(
"UTS1",
"TRD1", idtmed[1], parTrd, kNparTrd);
353 createVolume(
"UTS2",
"TRD1", idtmed[1], parTrd, kNparTrd);
354 createVolume(
"UTS3",
"TRD1", idtmed[1], parTrd, kNparTrd);
355 createVolume(
"UTS4",
"TRD1", idtmed[1], parTrd, kNparTrd);
362 createVolume(
"UTI1",
"TRD1", idtmed[2], parTrd, kNparTrd);
363 createVolume(
"UTI2",
"TRD1", idtmed[2], parTrd, kNparTrd);
364 createVolume(
"UTI3",
"TRD1", idtmed[2], parTrd, kNparTrd);
365 createVolume(
"UTI4",
"TRD1", idtmed[2], parTrd, kNparTrd);
373 createVolume(
"UTF1",
"TRD1", idtmed[2], parTrd, kNparTrd);
374 createVolume(
"UTF2",
"TRD1", idtmed[2], parTrd, kNparTrd);
381 for (
int istack : {0, 2}) {
382 for (
int ilayer = 0; ilayer <
NLAYER; ilayer++) {
383 int iShape = shapeClass(ilayer, istack);
392 const double halfWidth =
CWIDTH[ilayer] / 2.0;
393 const double halfLength =
CLENGTH[ilayer][istack] / 2.0 -
HSPACE / 2.0;
395 const double radY = halfLength -
CCLFT -
CGLT;
396 const double ampX = halfWidth +
CROW -
CCUTB;
397 const double ampY = halfLength -
CCUTA;
398 const double robX = halfWidth +
CROW -
CAUT;
399 const double robY = halfLength -
CAUT;
403 snprintf(cTagV, kTag,
"UA%02d", iShape);
404 parCha[0] =
CWIDTH[ilayer] / 2.0;
406 parCha[2] =
CRAH / 2.0 +
CDRH / 2.0;
407 createVolume(cTagV,
"BOX ", idtmed[1], parCha, kNparCha);
412 snprintf(cTagV, kTag,
"UZ%02d", iShape);
416 createVolume(cTagV,
"BOX ", idtmed[1], parCha, kNparCha);
418 snprintf(cTagV, kTag,
"UP%02d", iShape);
419 parCha[0] =
CWSW / 2.0;
421 parCha[2] =
CWSH / 2.0;
422 createVolume(cTagV,
"BOX ", idtmed[7], parCha, kNparCha);
424 snprintf(cTagV, kTag,
"UB%02d", iShape);
426 parCha[1] = halfLength;
427 parCha[2] =
CRAH / 2.0 +
CDRH / 2.0;
428 createVolume(cTagV,
"BOX ", idtmed[7], parCha, kNparCha);
430 snprintf(cTagV, kTag,
"UX%02d", iShape);
433 parCha[2] =
CRAH / 2.0;
434 createVolume(cTagV,
"BOX ", idtmed[11], parCha, kNparCha);
436 snprintf(cTagV, kTag,
"UC%02d", iShape);
439 parCha[2] =
CRAH / 2.0;
440 createVolume(cTagV,
"BOX ", idtmed[2], parCha, kNparCha);
444 snprintf(cTagV, kTag,
"UD%02d", iShape);
447 parCha[2] =
CAMH / 2.0;
448 createVolume(cTagV,
"BOX ", idtmed[7], parCha, kNparCha);
450 snprintf(cTagV, kTag,
"UE%02d", iShape);
453 parCha[2] =
CAMH / 2.0;
454 createVolume(cTagV,
"BOX ", idtmed[2], parCha, kNparCha);
458 snprintf(cTagV, kTag,
"UF%02d", iShape);
461 parCha[2] =
CROH / 2.0;
462 createVolume(cTagV,
"BOX ", idtmed[1], parCha, kNparCha);
464 snprintf(cTagV, kTag,
"UG%02d", iShape);
467 parCha[2] =
CROH / 2.0;
468 createVolume(cTagV,
"BOX ", idtmed[2], parCha, kNparCha);
478 snprintf(cTagV, kTag,
"URMY%02d", iShape);
479 createVolume(cTagV,
"BOX ", idtmed[27], parCha, kNparCha);
484 snprintf(cTagV, kTag,
"URCB%02d", iShape);
485 createVolume(cTagV,
"BOX ", idtmed[26], parCha, kNparCha);
490 snprintf(cTagV, kTag,
"URGL%02d", iShape);
491 createVolume(cTagV,
"BOX ", idtmed[11], parCha, kNparCha);
496 snprintf(cTagV, kTag,
"URRH%02d", iShape);
497 createVolume(cTagV,
"BOX ", idtmed[15], parCha, kNparCha);
502 snprintf(cTagV, kTag,
"URFB%02d", iShape);
503 createVolume(cTagV,
"BOX ", idtmed[28], parCha, kNparCha);
509 snprintf(cTagV, kTag,
"UJ%02d", iShape);
510 createVolume(cTagV,
"BOX ", idtmed[9], parCha, kNparCha);
516 snprintf(cTagV, kTag,
"UK%02d", iShape);
517 createVolume(cTagV,
"BOX ", idtmed[9], parCha, kNparCha);
522 snprintf(cTagV, kTag,
"UW%02d", iShape);
523 createVolume(cTagV,
"BOX ", idtmed[3], parCha, kNparCha);
529 snprintf(cTagV, kTag,
"UPPD%02d", iShape);
530 createVolume(cTagV,
"BOX ", idtmed[5], parCha, kNparCha);
535 snprintf(cTagV, kTag,
"UPPP%02d", iShape);
536 createVolume(cTagV,
"BOX ", idtmed[13], parCha, kNparCha);
541 snprintf(cTagV, kTag,
"UPGL%02d", iShape);
542 createVolume(cTagV,
"BOX ", idtmed[11], parCha, kNparCha);
547 snprintf(cTagV, kTag,
"UPCB%02d", iShape);
548 createVolume(cTagV,
"BOX ", idtmed[26], parCha, kNparCha);
553 snprintf(cTagV, kTag,
"UPHC%02d", iShape);
554 createVolume(cTagV,
"BOX ", idtmed[10], parCha, kNparCha);
559 snprintf(cTagV, kTag,
"UPPC%02d", iShape);
560 createVolume(cTagV,
"BOX ", idtmed[13], parCha, kNparCha);
565 snprintf(cTagV, kTag,
"UPRB%02d", iShape);
566 createVolume(cTagV,
"BOX ", idtmed[6], parCha, kNparCha);
571 snprintf(cTagV, kTag,
"UPEL%02d", iShape);
572 createVolume(cTagV,
"BOX ", idtmed[4], parCha, kNparCha);
583 snprintf(cTagV, kTag,
"URMY%02d", iShape);
584 snprintf(cTagM, kTag,
"UC%02d", iShape);
585 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
587 snprintf(cTagV, kTag,
"URMY%02d", iShape);
588 snprintf(cTagM, kTag,
"UC%02d", iShape);
589 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
592 snprintf(cTagV, kTag,
"URCB%02d", iShape);
593 snprintf(cTagM, kTag,
"UC%02d", iShape);
594 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
596 snprintf(cTagV, kTag,
"URCB%02d", iShape);
597 snprintf(cTagM, kTag,
"UC%02d", iShape);
598 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
601 snprintf(cTagV, kTag,
"URGL%02d", iShape);
602 snprintf(cTagM, kTag,
"UC%02d", iShape);
603 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
605 snprintf(cTagV, kTag,
"URGL%02d", iShape);
606 snprintf(cTagM, kTag,
"UC%02d", iShape);
607 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
610 snprintf(cTagV, kTag,
"URRH%02d", iShape);
611 snprintf(cTagM, kTag,
"UC%02d", iShape);
612 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
614 snprintf(cTagV, kTag,
"URRH%02d", iShape);
615 snprintf(cTagM, kTag,
"UC%02d", iShape);
616 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
619 snprintf(cTagV, kTag,
"URFB%02d", iShape);
620 snprintf(cTagM, kTag,
"UC%02d", iShape);
621 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
625 snprintf(cTagV, kTag,
"UJ%02d", iShape);
626 snprintf(cTagM, kTag,
"UB%02d", iShape);
627 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
632 snprintf(cTagV, kTag,
"UK%02d", iShape);
633 snprintf(cTagM, kTag,
"UE%02d", iShape);
634 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
637 snprintf(cTagV, kTag,
"UW%02d", iShape);
638 snprintf(cTagM, kTag,
"UK%02d", iShape);
639 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
641 snprintf(cTagV, kTag,
"UW%02d", iShape);
642 snprintf(cTagM, kTag,
"UK%02d", iShape);
643 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
648 snprintf(cTagV, kTag,
"UPPD%02d", iShape);
649 snprintf(cTagM, kTag,
"UG%02d", iShape);
650 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
653 snprintf(cTagV, kTag,
"UPPP%02d", iShape);
654 snprintf(cTagM, kTag,
"UG%02d", iShape);
655 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
658 snprintf(cTagV, kTag,
"UPGL%02d", iShape);
659 snprintf(cTagM, kTag,
"UG%02d", iShape);
660 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
663 snprintf(cTagV, kTag,
"UPCB%02d", iShape);
664 snprintf(cTagM, kTag,
"UG%02d", iShape);
665 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
667 snprintf(cTagV, kTag,
"UPCB%02d", iShape);
668 snprintf(cTagM, kTag,
"UG%02d", iShape);
669 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
672 snprintf(cTagV, kTag,
"UPHC%02d", iShape);
673 snprintf(cTagM, kTag,
"UG%02d", iShape);
674 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
677 snprintf(cTagV, kTag,
"UPPC%02d", iShape);
678 snprintf(cTagM, kTag,
"UG%02d", iShape);
679 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
682 snprintf(cTagV, kTag,
"UPRB%02d", iShape);
683 snprintf(cTagM, kTag,
"UG%02d", iShape);
684 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
687 snprintf(cTagV, kTag,
"UPEL%02d", iShape);
688 snprintf(cTagM, kTag,
"UG%02d", iShape);
689 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
697 snprintf(cTagV, kTag,
"UC%02d", iShape);
698 snprintf(cTagM, kTag,
"UX%02d", iShape);
699 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
702 snprintf(cTagV, kTag,
"UX%02d", iShape);
703 snprintf(cTagM, kTag,
"UB%02d", iShape);
704 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
707 snprintf(cTagV, kTag,
"UB%02d", iShape);
708 snprintf(cTagM, kTag,
"UA%02d", iShape);
709 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
713 snprintf(cTagV, kTag,
"UE%02d", iShape);
714 snprintf(cTagM, kTag,
"UD%02d", iShape);
715 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
719 snprintf(cTagV, kTag,
"UG%02d", iShape);
720 snprintf(cTagM, kTag,
"UF%02d", iShape);
721 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
729 createServices(idtmed);
731 for (
int istack = 0; istack <
NSTACK; istack++) {
732 for (
int ilayer = 0; ilayer <
NLAYER; ilayer++) {
733 assembleChamber(ilayer, istack);
740 TVirtualMC::GetMC()->Gspos(
"UTI1", 1,
"UTS1", xpos, ypos, zpos, 0,
"ONLY");
741 TVirtualMC::GetMC()->Gspos(
"UTI2", 1,
"UTS2", xpos, ypos, zpos, 0,
"ONLY");
742 TVirtualMC::GetMC()->Gspos(
"UTI3", 1,
"UTS3", xpos, ypos, zpos, 0,
"ONLY");
743 TVirtualMC::GetMC()->Gspos(
"UTI4", 1,
"UTS4", xpos, ypos, zpos, 0,
"ONLY");
748 TVirtualMC::GetMC()->Gspos(
"UTS1", 1,
"UTR1", xpos, ypos, zpos, 0,
"ONLY");
749 TVirtualMC::GetMC()->Gspos(
"UTS2", 1,
"UTR2", xpos, ypos, zpos, 0,
"ONLY");
750 TVirtualMC::GetMC()->Gspos(
"UTS3", 1,
"UTR3", xpos, ypos, zpos, 0,
"ONLY");
751 TVirtualMC::GetMC()->Gspos(
"UTS4", 1,
"UTR4", xpos, ypos, zpos, 0,
"ONLY");
758 for (
int isector = 0; isector <
NSECTOR; isector++) {
759 if (getSMstatus(isector)) {
760 snprintf(cTagV, kTag,
"BTRD%d", isector);
764 TVirtualMC::GetMC()->Gspos(
"UTR4", 1, cTagV, xpos, ypos, zpos, 0,
"ONLY");
770 TVirtualMC::GetMC()->Gspos(
"UTR3", 1, cTagV, xpos, ypos, zpos, 0,
"ONLY");
775 TVirtualMC::GetMC()->Gspos(
"UTR2", 1, cTagV, xpos, ypos, zpos, 0,
"ONLY");
779 TVirtualMC::GetMC()->Gspos(
"UTR1", 1, cTagV, xpos, ypos, zpos, 0,
"ONLY");
789 for (
int isector = 0; isector <
NSECTOR; isector++) {
790 if (getSMstatus(isector)) {
791 snprintf(cTagV, kTag,
"BTRD%d", isector);
792 TVirtualMC::GetMC()->Gspos(
"UTF1", 1, cTagV, xpos, ypos, zpos, 0,
"ONLY");
793 TVirtualMC::GetMC()->Gspos(
"UTF2", 1, cTagV, xpos, -ypos, zpos, 0,
"ONLY");
804 gGeoManager->CheckGeometry();
808void Geometry::createFrame(std::vector<int>
const& idtmed)
827 const int kTag = 100;
831 const int kNparTRD = 4;
832 float parTRD[kNparTRD];
833 const int kNparBOX = 3;
834 float parBOX[kNparBOX];
835 const int kNparTRP = 11;
836 float parTRP[kNparTRP];
839 const int kNmatrix = 7;
840 int matrix[kNmatrix];
841 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
842 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
843 TVirtualMC::GetMC()->Matrix(matrix[2], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
844 TVirtualMC::GetMC()->Matrix(matrix[3], 90.0, 180.0, 0.0, 180.0, 90.0, 90.0);
845 TVirtualMC::GetMC()->Matrix(matrix[4], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
846 TVirtualMC::GetMC()->Matrix(matrix[5], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
847 TVirtualMC::GetMC()->Matrix(matrix[6], 180.0, 180.0, 90.0, 180.0, 90.0, 90.0);
853 const int kNparCrb = 3;
854 float parCrb[kNparCrb];
858 createVolume(
"USCR",
"BOX ", idtmed[26], parCrb, 0);
860 parCrb[0] = 77.49 / 2.0;
861 parCrb[1] = 104.60 / 2.0;
866 TVirtualMC::GetMC()->Gsposp(
"USCR", 1,
"UTS1", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
867 TVirtualMC::GetMC()->Gsposp(
"USCR", 2,
"UTS2", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
868 TVirtualMC::GetMC()->Gsposp(
"USCR", 3,
"UTS3", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
869 TVirtualMC::GetMC()->Gsposp(
"USCR", 4,
"UTS4", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
871 parCrb[0] = 77.49 / 2.0;
872 parCrb[1] = 55.80 / 2.0;
877 TVirtualMC::GetMC()->Gsposp(
"USCR", 5,
"UTS1", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
878 TVirtualMC::GetMC()->Gsposp(
"USCR", 6,
"UTS2", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
879 TVirtualMC::GetMC()->Gsposp(
"USCR", 7,
"UTS3", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
880 TVirtualMC::GetMC()->Gsposp(
"USCR", 8,
"UTS4", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
881 TVirtualMC::GetMC()->Gsposp(
"USCR", 9,
"UTS1", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
882 TVirtualMC::GetMC()->Gsposp(
"USCR", 10,
"UTS2", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
883 TVirtualMC::GetMC()->Gsposp(
"USCR", 11,
"UTS3", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
884 TVirtualMC::GetMC()->Gsposp(
"USCR", 12,
"UTS4", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
886 parCrb[0] = 77.49 / 2.0;
887 parCrb[1] = 56.00 / 2.0;
892 TVirtualMC::GetMC()->Gsposp(
"USCR", 13,
"UTS1", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
893 TVirtualMC::GetMC()->Gsposp(
"USCR", 14,
"UTS2", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
894 TVirtualMC::GetMC()->Gsposp(
"USCR", 15,
"UTS3", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
895 TVirtualMC::GetMC()->Gsposp(
"USCR", 16,
"UTS4", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
896 TVirtualMC::GetMC()->Gsposp(
"USCR", 17,
"UTS1", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
897 TVirtualMC::GetMC()->Gsposp(
"USCR", 18,
"UTS2", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
898 TVirtualMC::GetMC()->Gsposp(
"USCR", 19,
"UTS3", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
899 TVirtualMC::GetMC()->Gsposp(
"USCR", 20,
"UTS4", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
901 parCrb[0] = 77.49 / 2.0;
902 parCrb[1] = 118.00 / 2.0;
907 TVirtualMC::GetMC()->Gsposp(
"USCR", 21,
"UTS1", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
908 TVirtualMC::GetMC()->Gsposp(
"USCR", 22,
"UTS2", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
909 TVirtualMC::GetMC()->Gsposp(
"USCR", 23,
"UTS3", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
910 TVirtualMC::GetMC()->Gsposp(
"USCR", 24,
"UTS4", xpos, ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
911 TVirtualMC::GetMC()->Gsposp(
"USCR", 25,
"UTS1", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
912 TVirtualMC::GetMC()->Gsposp(
"USCR", 26,
"UTS2", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
913 TVirtualMC::GetMC()->Gsposp(
"USCR", 27,
"UTS3", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
914 TVirtualMC::GetMC()->Gsposp(
"USCR", 28,
"UTS4", xpos, -ypos, zpos, 0,
"ONLY", parCrb, kNparCrb);
916 parCrb[0] = 111.48 / 2.0;
917 parCrb[1] = 105.00 / 2.0;
922 TVirtualMC::GetMC()->Gsposp(
"USCR", 29,
"UTS2", xpos, ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
923 TVirtualMC::GetMC()->Gsposp(
"USCR", 30,
"UTS3", xpos, ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
925 parCrb[0] = 111.48 / 2.0;
926 parCrb[1] = 56.00 / 2.0;
931 TVirtualMC::GetMC()->Gsposp(
"USCR", 31,
"UTS2", xpos, ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
932 TVirtualMC::GetMC()->Gsposp(
"USCR", 32,
"UTS3", xpos, ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
933 TVirtualMC::GetMC()->Gsposp(
"USCR", 33,
"UTS2", xpos, -ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
934 TVirtualMC::GetMC()->Gsposp(
"USCR", 34,
"UTS3", xpos, -ypos, -zpos, 0,
"ONLY", parCrb, kNparCrb);
940 const float kSRLhgt = 2.00;
941 const float kSRLwidA = 2.3;
942 const float kSRLwidB = 1.947;
943 const float kSRLdst = 1.135;
944 const int kNparSRL = 11;
945 float parSRL[kNparSRL];
950 parSRL[3] = kSRLhgt / 2.0;
951 parSRL[4] = kSRLwidB / 2.0;
952 parSRL[5] = kSRLwidA / 2.0;
954 parSRL[7] = kSRLhgt / 2.0;
955 parSRL[8] = kSRLwidB / 2.0;
956 parSRL[9] = kSRLwidA / 2.0;
958 createVolume(
"USRL",
"TRAP", idtmed[1], parSRL, kNparSRL);
963 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
964 xpos =
CWIDTH[ilayer] / 2.0 + kSRLwidA / 2.0 + kSRLdst;
968 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1,
"UTI1", xpos, ypos, zpos, matrix[2],
"ONLY");
969 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 +
NLAYER,
"UTI1", -xpos, ypos, zpos, matrix[3],
"ONLY");
970 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 2 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[2],
"ONLY");
971 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 3 *
NLAYER,
"UTI2", -xpos, ypos, zpos, matrix[3],
"ONLY");
972 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 4 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[2],
"ONLY");
973 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 5 *
NLAYER,
"UTI3", -xpos, ypos, zpos, matrix[3],
"ONLY");
974 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 6 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[2],
"ONLY");
975 TVirtualMC::GetMC()->Gspos(
"USRL", ilayer + 1 + 7 *
NLAYER,
"UTI4", -xpos, ypos, zpos, matrix[3],
"ONLY");
982 const float kSCBwid = 1.0;
983 const float kSCBthk = 2.0;
984 const float kSCHhgt = 0.3;
986 const int kNparSCB = 3;
987 float parSCB[kNparSCB];
988 parSCB[1] = kSCBwid / 2.0;
989 parSCB[2] =
CH / 2.0 +
VSPACE / 2.0 - kSCHhgt;
991 const int kNparSCI = 3;
992 float parSCI[kNparSCI];
998 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1000 parSCB[0] =
CWIDTH[ilayer] / 2.0 + kSRLdst / 2.0;
1001 snprintf(cTagV, kTag,
"USF%01d", ilayer);
1002 createVolume(cTagV,
"BOX ", idtmed[1], parSCB, kNparSCB);
1005 float thkSCB = kSCBthk;
1009 parSCI[2] = parSCB[2] - thkSCB;
1010 parSCI[0] = parSCB[0] / 4.0 - kSCBthk;
1011 snprintf(cTagV, kTag,
"USI%01d", ilayer);
1012 createVolume(cTagV,
"BOX ", idtmed[2], parSCI, kNparSCI);
1014 snprintf(cTagV, kTag,
"USI%01d", ilayer);
1015 snprintf(cTagM, kTag,
"USF%01d", ilayer);
1018 xpos = parSCI[0] + thkSCB / 2.0;
1019 TVirtualMC::GetMC()->Gspos(cTagV, 1, cTagM, xpos, ypos, zpos, 0,
"ONLY");
1020 xpos = -parSCI[0] - thkSCB / 2.0;
1021 TVirtualMC::GetMC()->Gspos(cTagV, 2, cTagM, xpos, ypos, zpos, 0,
"ONLY");
1022 xpos = 3.0 * parSCI[0] + 1.5 * thkSCB;
1023 TVirtualMC::GetMC()->Gspos(cTagV, 3, cTagM, xpos, ypos, zpos, 0,
"ONLY");
1024 xpos = -3.0 * parSCI[0] - 1.5 * thkSCB;
1025 TVirtualMC::GetMC()->Gspos(cTagV, 4, cTagM, xpos, ypos, zpos, 0,
"ONLY");
1027 snprintf(cTagV, kTag,
"USF%01d", ilayer);
1032 TVirtualMC::GetMC()->Gspos(cTagV, 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1033 TVirtualMC::GetMC()->Gspos(cTagV, 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1034 TVirtualMC::GetMC()->Gspos(cTagV, 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1035 TVirtualMC::GetMC()->Gspos(cTagV, 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1038 TVirtualMC::GetMC()->Gspos(cTagV, 2,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1039 TVirtualMC::GetMC()->Gspos(cTagV, 4,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1040 TVirtualMC::GetMC()->Gspos(cTagV, 6,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1041 TVirtualMC::GetMC()->Gspos(cTagV, 8,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1048 const int kNparSCH = 3;
1049 float parSCH[kNparSCH];
1051 for (ilayer = 1; ilayer <
NLAYER - 1; ilayer++) {
1052 parSCH[0] =
CWIDTH[ilayer] / 2.0;
1056 parSCH[2] = kSCHhgt / 2.0;
1058 snprintf(cTagV, kTag,
"USH%01d", ilayer);
1059 createVolume(cTagV,
"BOX ", idtmed[1], parSCH, kNparSCH);
1061 ypos =
CLENGTH[ilayer][2] / 2.0 +
CLENGTH[ilayer][1] + parSCH[1];
1063 TVirtualMC::GetMC()->Gspos(cTagV, 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1064 TVirtualMC::GetMC()->Gspos(cTagV, 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1065 TVirtualMC::GetMC()->Gspos(cTagV, 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1066 TVirtualMC::GetMC()->Gspos(cTagV, 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1068 TVirtualMC::GetMC()->Gspos(cTagV, 2,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1069 TVirtualMC::GetMC()->Gspos(cTagV, 4,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1070 TVirtualMC::GetMC()->Gspos(cTagV, 6,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1071 TVirtualMC::GetMC()->Gspos(cTagV, 8,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1079 parTRD[0] = 87.60 / 2.0;
1080 parTRD[1] = 114.00 / 2.0;
1081 parTRD[2] = 1.20 / 2.0;
1082 parTRD[3] = 71.30 / 2.0;
1083 createVolume(
"USDB",
"TRD1", idtmed[1], parTRD, kNparTRD);
1085 parTRP[0] = 1.20 / 2.0;
1088 parTRP[3] = 27.00 / 2.0;
1089 parTRP[4] = 50.60 / 2.0;
1090 parTRP[5] = 5.00 / 2.0;
1092 parTRP[7] = 27.00 / 2.0;
1093 parTRP[8] = 50.60 / 2.0;
1094 parTRP[9] = 5.00 / 2.0;
1096 createVolume(
"USD1",
"TRAP", idtmed[2], parTRP, kNparTRP);
1099 zpos = 27.00 / 2.0 - 71.3 / 2.0;
1100 TVirtualMC::GetMC()->Gspos(
"USD1", 1,
"USDB", xpos, ypos, zpos, matrix[2],
"ONLY");
1102 parTRP[0] = 1.20 / 2.0;
1105 parTRP[3] = 33.00 / 2.0;
1106 parTRP[4] = 5.00 / 2.0;
1107 parTRP[5] = 62.10 / 2.0;
1109 parTRP[7] = 33.00 / 2.0;
1110 parTRP[8] = 5.00 / 2.0;
1111 parTRP[9] = 62.10 / 2.0;
1113 createVolume(
"USD2",
"TRAP", idtmed[2], parTRP, kNparTRP);
1116 zpos = 71.3 / 2.0 - 33.0 / 2.0;
1117 TVirtualMC::GetMC()->Gspos(
"USD2", 1,
"USDB", xpos, ypos, zpos, matrix[2],
"ONLY");
1119 parBOX[0] = 22.50 / 2.0;
1120 parBOX[1] = 1.20 / 2.0;
1121 parBOX[2] = 70.50 / 2.0;
1122 createVolume(
"USD3",
"BOX ", idtmed[2], parBOX, kNparBOX);
1126 TVirtualMC::GetMC()->Gspos(
"USD3", 1,
"USDB", xpos, ypos, zpos, 0,
"ONLY");
1128 parTRP[0] = 1.20 / 2.0;
1131 parTRP[3] = 25.50 / 2.0;
1132 parTRP[4] = 5.00 / 2.0;
1133 parTRP[5] = 65.00 / 2.0;
1135 parTRP[7] = 25.50 / 2.0;
1136 parTRP[8] = 5.00 / 2.0;
1137 parTRP[9] = 65.00 / 2.0;
1139 createVolume(
"USD4",
"TRAP", idtmed[2], parTRP, kNparTRP);
1143 TVirtualMC::GetMC()->Gspos(
"USD4", 1,
"USDB", xpos, ypos, zpos, matrix[6],
"ONLY");
1145 parTRP[0] = 1.20 / 2.0;
1148 parTRP[3] = 23.50 / 2.0;
1149 parTRP[4] = 63.50 / 2.0;
1150 parTRP[5] = 5.00 / 2.0;
1152 parTRP[7] = 23.50 / 2.0;
1153 parTRP[8] = 63.50 / 2.0;
1154 parTRP[9] = 5.00 / 2.0;
1156 createVolume(
"USD5",
"TRAP", idtmed[2], parTRP, kNparTRP);
1160 TVirtualMC::GetMC()->Gspos(
"USD5", 1,
"USDB", xpos, ypos, zpos, matrix[5],
"ONLY");
1162 parTRP[0] = 1.20 / 2.0;
1165 parTRP[3] = 70.50 / 2.0;
1166 parTRP[4] = 4.50 / 2.0;
1167 parTRP[5] = 16.50 / 2.0;
1169 parTRP[7] = 70.50 / 2.0;
1170 parTRP[8] = 4.50 / 2.0;
1171 parTRP[9] = 16.50 / 2.0;
1173 createVolume(
"USD6",
"TRAP", idtmed[2], parTRP, kNparTRP);
1177 TVirtualMC::GetMC()->Gspos(
"USD6", 1,
"USDB", xpos, ypos, zpos, matrix[2],
"ONLY");
1181 TVirtualMC::GetMC()->Gspos(
"USDB", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1182 TVirtualMC::GetMC()->Gspos(
"USDB", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1183 TVirtualMC::GetMC()->Gspos(
"USDB", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1184 TVirtualMC::GetMC()->Gspos(
"USDB", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1185 TVirtualMC::GetMC()->Gspos(
"USDB", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1186 TVirtualMC::GetMC()->Gspos(
"USDB", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1187 TVirtualMC::GetMC()->Gspos(
"USDB", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1188 TVirtualMC::GetMC()->Gspos(
"USDB", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1190 parBOX[0] = 95.00 / 2.0;
1191 parBOX[1] = 1.20 / 2.0;
1192 parBOX[2] = 3.00 / 2.0;
1193 createVolume(
"USD7",
"BOX ", idtmed[1], parBOX, kNparBOX);
1197 TVirtualMC::GetMC()->Gspos(
"USD7", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1198 TVirtualMC::GetMC()->Gspos(
"USD7", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1199 TVirtualMC::GetMC()->Gspos(
"USD7", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1200 TVirtualMC::GetMC()->Gspos(
"USD7", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1201 TVirtualMC::GetMC()->Gspos(
"USD7", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1202 TVirtualMC::GetMC()->Gspos(
"USD7", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1203 TVirtualMC::GetMC()->Gspos(
"USD7", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1204 TVirtualMC::GetMC()->Gspos(
"USD7", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1206 parBOX[0] = 90.22 / 2.0;
1207 parBOX[1] = 1.20 / 2.0;
1208 parBOX[2] = 1.74 / 2.0;
1209 createVolume(
"USD8",
"BOX ", idtmed[1], parBOX, kNparBOX);
1211 ypos =
CLENGTH[5][2] / 2.0 - 0.1;
1213 TVirtualMC::GetMC()->Gspos(
"USD8", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1214 TVirtualMC::GetMC()->Gspos(
"USD8", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1215 TVirtualMC::GetMC()->Gspos(
"USD8", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1216 TVirtualMC::GetMC()->Gspos(
"USD8", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1217 TVirtualMC::GetMC()->Gspos(
"USD8", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1218 TVirtualMC::GetMC()->Gspos(
"USD8", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1219 TVirtualMC::GetMC()->Gspos(
"USD8", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1220 TVirtualMC::GetMC()->Gspos(
"USD8", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1222 parBOX[0] = 82.60 / 2.0;
1223 parBOX[1] = 1.20 / 2.0;
1224 parBOX[2] = 1.40 / 2.0;
1225 createVolume(
"USD9",
"BOX ", idtmed[1], parBOX, kNparBOX);
1229 TVirtualMC::GetMC()->Gspos(
"USD9", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1230 TVirtualMC::GetMC()->Gspos(
"USD9", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1231 TVirtualMC::GetMC()->Gspos(
"USD9", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1232 TVirtualMC::GetMC()->Gspos(
"USD9", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1233 TVirtualMC::GetMC()->Gspos(
"USD9", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1234 TVirtualMC::GetMC()->Gspos(
"USD9", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1235 TVirtualMC::GetMC()->Gspos(
"USD9", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1236 TVirtualMC::GetMC()->Gspos(
"USD9", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1238 parTRP[0] = 0.10 / 2.0;
1241 parTRP[3] = 74.50 / 2.0;
1242 parTRP[4] = 31.70 / 2.0;
1243 parTRP[5] = 44.00 / 2.0;
1245 parTRP[7] = 74.50 / 2.0;
1246 parTRP[8] = 31.70 / 2.0;
1247 parTRP[9] = 44.00 / 2.0;
1249 createVolume(
"USDF",
"TRAP", idtmed[2], parTRP, kNparTRP);
1251 ypos =
CLENGTH[5][2] / 2.0 + 1.20 / 2.0 + 0.10 / 2.0;
1253 TVirtualMC::GetMC()->Gspos(
"USDF", 1,
"UTI1", xpos, ypos, zpos, matrix[2],
"ONLY");
1254 TVirtualMC::GetMC()->Gspos(
"USDF", 2,
"UTI1", xpos, -ypos, zpos, matrix[2],
"ONLY");
1255 TVirtualMC::GetMC()->Gspos(
"USDF", 3,
"UTI2", xpos, ypos, zpos, matrix[2],
"ONLY");
1256 TVirtualMC::GetMC()->Gspos(
"USDF", 4,
"UTI2", xpos, -ypos, zpos, matrix[2],
"ONLY");
1257 TVirtualMC::GetMC()->Gspos(
"USDF", 5,
"UTI3", xpos, ypos, zpos, matrix[2],
"ONLY");
1258 TVirtualMC::GetMC()->Gspos(
"USDF", 6,
"UTI3", xpos, -ypos, zpos, matrix[2],
"ONLY");
1259 TVirtualMC::GetMC()->Gspos(
"USDF", 7,
"UTI4", xpos, ypos, zpos, matrix[2],
"ONLY");
1260 TVirtualMC::GetMC()->Gspos(
"USDF", 8,
"UTI4", xpos, -ypos, zpos, matrix[2],
"ONLY");
1267 parTRD[0] = 90.00 / 2.0 - 0.1;
1268 parTRD[1] = 114.00 / 2.0 - 0.1;
1269 parTRD[2] = 1.50 / 2.0;
1270 parTRD[3] = 70.30 / 2.0;
1271 createVolume(
"USCB",
"TRD1", idtmed[1], parTRD, kNparTRD);
1273 parTRD[0] = 87.00 / 2.0;
1274 parTRD[1] = 10.00 / 2.0;
1275 parTRD[2] = 1.50 / 2.0;
1276 parTRD[3] = 26.35 / 2.0;
1277 createVolume(
"USC1",
"TRD1", idtmed[2], parTRD, kNparTRD);
1280 zpos = 26.35 / 2.0 - 70.3 / 2.0;
1281 TVirtualMC::GetMC()->Gspos(
"USC1", 1,
"USCB", xpos, ypos, zpos, 0,
"ONLY");
1283 parTRD[0] = 10.00 / 2.0;
1284 parTRD[1] = 111.00 / 2.0;
1285 parTRD[2] = 1.50 / 2.0;
1286 parTRD[3] = 35.05 / 2.0;
1287 createVolume(
"USC2",
"TRD1", idtmed[2], parTRD, kNparTRD);
1290 zpos = 70.3 / 2.0 - 35.05 / 2.0;
1291 TVirtualMC::GetMC()->Gspos(
"USC2", 1,
"USCB", xpos, ypos, zpos, 0,
"ONLY");
1293 parTRP[0] = 1.50 / 2.0;
1296 parTRP[3] = 37.60 / 2.0;
1297 parTRP[4] = 63.90 / 2.0;
1298 parTRP[5] = 8.86 / 2.0;
1300 parTRP[7] = 37.60 / 2.0;
1301 parTRP[8] = 63.90 / 2.0;
1302 parTRP[9] = 8.86 / 2.0;
1304 createVolume(
"USC3",
"TRAP", idtmed[2], parTRP, kNparTRP);
1308 TVirtualMC::GetMC()->Gspos(
"USC3", 1,
"USCB", xpos, ypos, zpos, matrix[4],
"ONLY");
1309 TVirtualMC::GetMC()->Gspos(
"USC3", 2,
"USCB", -xpos, ypos, zpos, matrix[5],
"ONLY");
1313 TVirtualMC::GetMC()->Gspos(
"USCB", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1314 TVirtualMC::GetMC()->Gspos(
"USCB", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1315 TVirtualMC::GetMC()->Gspos(
"USCB", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1316 TVirtualMC::GetMC()->Gspos(
"USCB", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1317 TVirtualMC::GetMC()->Gspos(
"USCB", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1318 TVirtualMC::GetMC()->Gspos(
"USCB", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1319 TVirtualMC::GetMC()->Gspos(
"USCB", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1320 TVirtualMC::GetMC()->Gspos(
"USCB", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1322 parBOX[0] = 95.00 / 2.0;
1323 parBOX[1] = 1.50 / 2.0;
1324 parBOX[2] = 3.00 / 2.0;
1325 createVolume(
"USC4",
"BOX ", idtmed[1], parBOX, kNparBOX);
1329 TVirtualMC::GetMC()->Gspos(
"USC4", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1330 TVirtualMC::GetMC()->Gspos(
"USC4", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1331 TVirtualMC::GetMC()->Gspos(
"USC4", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1332 TVirtualMC::GetMC()->Gspos(
"USC4", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1333 TVirtualMC::GetMC()->Gspos(
"USC4", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1334 TVirtualMC::GetMC()->Gspos(
"USC4", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1335 TVirtualMC::GetMC()->Gspos(
"USC4", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1336 TVirtualMC::GetMC()->Gspos(
"USC4", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1338 parBOX[0] = 90.22 / 2.0;
1339 parBOX[1] = 1.50 / 2.0;
1340 parBOX[2] = 2.00 / 2.0;
1341 createVolume(
"USC5",
"BOX ", idtmed[1], parBOX, kNparBOX);
1345 TVirtualMC::GetMC()->Gspos(
"USC5", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1346 TVirtualMC::GetMC()->Gspos(
"USC5", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1347 TVirtualMC::GetMC()->Gspos(
"USC5", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1348 TVirtualMC::GetMC()->Gspos(
"USC5", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1349 TVirtualMC::GetMC()->Gspos(
"USC5", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1350 TVirtualMC::GetMC()->Gspos(
"USC5", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1351 TVirtualMC::GetMC()->Gspos(
"USC5", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1352 TVirtualMC::GetMC()->Gspos(
"USC5", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1354 parBOX[0] = 82.60 / 2.0;
1355 parBOX[1] = 1.50 / 2.0;
1356 parBOX[2] = 1.60 / 2.0;
1357 createVolume(
"USC6",
"BOX ", idtmed[1], parBOX, kNparBOX);
1361 TVirtualMC::GetMC()->Gspos(
"USC6", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1362 TVirtualMC::GetMC()->Gspos(
"USC6", 2,
"UTI1", xpos, -ypos, zpos, 0,
"ONLY");
1363 TVirtualMC::GetMC()->Gspos(
"USC6", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1364 TVirtualMC::GetMC()->Gspos(
"USC6", 4,
"UTI2", xpos, -ypos, zpos, 0,
"ONLY");
1365 TVirtualMC::GetMC()->Gspos(
"USC6", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1366 TVirtualMC::GetMC()->Gspos(
"USC6", 6,
"UTI3", xpos, -ypos, zpos, 0,
"ONLY");
1367 TVirtualMC::GetMC()->Gspos(
"USC6", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1368 TVirtualMC::GetMC()->Gspos(
"USC6", 8,
"UTI4", xpos, -ypos, zpos, 0,
"ONLY");
1374 const int kNparSCL = 3;
1375 float parSCL[kNparSCL];
1376 const int kNparSCLb = 11;
1377 float parSCLb[kNparSCLb];
1381 const float kSCLthkUa = 0.6;
1382 const float kSCLthkUb = 0.6;
1384 const float kSCLwidUa = 3.2;
1385 const float kSCLwidUb = 4.8;
1387 const float kSCLposxUa = 0.7;
1388 const float kSCLposxUb = 3.3;
1389 const float kSCLposzUa = 1.65;
1390 const float kSCLposzUb = 0.3;
1392 parSCL[0] = kSCLthkUa / 2.0;
1394 parSCL[2] = kSCLwidUa / 2.0;
1395 createVolume(
"USL1",
"BOX ", idtmed[1], parSCL, kNparSCL);
1399 TVirtualMC::GetMC()->Gspos(
"USL1", 1,
"UTI1", xpos, ypos, zpos, matrix[0],
"ONLY");
1400 TVirtualMC::GetMC()->Gspos(
"USL1", 3,
"UTI4", xpos, ypos, zpos, matrix[0],
"ONLY");
1402 TVirtualMC::GetMC()->Gspos(
"USL1", 2,
"UTI1", xpos, ypos, zpos, matrix[1],
"ONLY");
1403 TVirtualMC::GetMC()->Gspos(
"USL1", 4,
"UTI4", xpos, ypos, zpos, matrix[1],
"ONLY");
1405 parSCL[0] = kSCLwidUb / 2.0;
1407 parSCL[2] = kSCLthkUb / 2.0;
1408 createVolume(
"USL2",
"BOX ", idtmed[1], parSCL, kNparSCL);
1412 TVirtualMC::GetMC()->Gspos(
"USL2", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1413 TVirtualMC::GetMC()->Gspos(
"USL2", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1414 TVirtualMC::GetMC()->Gspos(
"USL2", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1415 TVirtualMC::GetMC()->Gspos(
"USL2", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1417 TVirtualMC::GetMC()->Gspos(
"USL2", 2,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1418 TVirtualMC::GetMC()->Gspos(
"USL2", 4,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1419 TVirtualMC::GetMC()->Gspos(
"USL2", 6,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1420 TVirtualMC::GetMC()->Gspos(
"USL2", 8,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1424 const float kSCLthkLa = 2.464;
1425 const float kSCLthkLb = 1.0;
1427 const float kSCLwidLa = 8.3;
1428 const float kSCLwidLb = 4.0;
1430 const float kSCLposxLa = (3.0 * kSCLthkLb - kSCLthkLa) / 4.0 + 0.05;
1431 const float kSCLposxLb = kSCLthkLb + kSCLwidLb / 2.0 + 0.05;
1432 const float kSCLposzLa = kSCLwidLa / 2.0;
1433 const float kSCLposzLb = kSCLthkLb / 2.0;
1439 parSCLb[3] = kSCLwidLa / 2.0;
1440 parSCLb[4] = kSCLthkLb / 2.0;
1441 parSCLb[5] = kSCLthkLa / 2.0;
1443 parSCLb[7] = kSCLwidLa / 2.0;
1444 parSCLb[8] = kSCLthkLb / 2.0;
1445 parSCLb[9] = kSCLthkLa / 2.0;
1447 createVolume(
"USL3",
"TRAP", idtmed[1], parSCLb, kNparSCLb);
1451 TVirtualMC::GetMC()->Gspos(
"USL3", 1,
"UTI1", xpos, ypos, zpos, matrix[2],
"ONLY");
1452 TVirtualMC::GetMC()->Gspos(
"USL3", 3,
"UTI2", xpos, ypos, zpos, matrix[2],
"ONLY");
1453 TVirtualMC::GetMC()->Gspos(
"USL3", 5,
"UTI3", xpos, ypos, zpos, matrix[2],
"ONLY");
1454 TVirtualMC::GetMC()->Gspos(
"USL3", 7,
"UTI4", xpos, ypos, zpos, matrix[2],
"ONLY");
1456 TVirtualMC::GetMC()->Gspos(
"USL3", 2,
"UTI1", xpos, ypos, zpos, matrix[3],
"ONLY");
1457 TVirtualMC::GetMC()->Gspos(
"USL3", 4,
"UTI2", xpos, ypos, zpos, matrix[3],
"ONLY");
1458 TVirtualMC::GetMC()->Gspos(
"USL3", 6,
"UTI3", xpos, ypos, zpos, matrix[3],
"ONLY");
1459 TVirtualMC::GetMC()->Gspos(
"USL3", 8,
"UTI4", xpos, ypos, zpos, matrix[3],
"ONLY");
1461 parSCL[0] = kSCLwidLb / 2.0;
1463 parSCL[2] = kSCLthkLb / 2.0;
1464 createVolume(
"USL4",
"BOX ", idtmed[1], parSCL, kNparSCL);
1468 TVirtualMC::GetMC()->Gspos(
"USL4", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1469 TVirtualMC::GetMC()->Gspos(
"USL4", 3,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1470 TVirtualMC::GetMC()->Gspos(
"USL4", 5,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1471 TVirtualMC::GetMC()->Gspos(
"USL4", 7,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1473 TVirtualMC::GetMC()->Gspos(
"USL4", 2,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
1474 TVirtualMC::GetMC()->Gspos(
"USL4", 4,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
1475 TVirtualMC::GetMC()->Gspos(
"USL4", 6,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
1476 TVirtualMC::GetMC()->Gspos(
"USL4", 8,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
1482 const int kNparTrd = 4;
1483 float parTrd[kNparTrd];
1484 parTrd[0] =
SWIDTH1 / 2.0 - 2.5;
1485 parTrd[1] =
SWIDTH2 / 2.0 - 2.5;
1486 parTrd[2] =
SMPLTT / 2.0;
1487 parTrd[3] =
SHEIGHT / 2.0 - 1.0;
1488 createVolume(
"UTA1",
"TRD1", idtmed[1], parTrd, kNparTrd);
1492 TVirtualMC::GetMC()->Gspos(
"UTA1", 1,
"UTF1", xpos, ypos, zpos, 0,
"ONLY");
1493 TVirtualMC::GetMC()->Gspos(
"UTA1", 2,
"UTF2", xpos, -ypos, zpos, 0,
"ONLY");
1495 const int kNparPlt = 3;
1496 float parPlt[kNparPlt];
1500 createVolume(
"UTA2",
"BOX ", idtmed[1], parPlt, 0);
1504 parPlt[0] =
SWIDTH2 / 2.0 - 0.2;
1506 parPlt[2] =
SMPLTT / 2.0;
1507 TVirtualMC::GetMC()->Gsposp(
"UTA2", 1,
"UTF2", xpos, ypos, zpos, 0,
"ONLY", parPlt, kNparPlt);
1511 parPlt[0] =
SMPLTT / 2.0;
1514 TVirtualMC::GetMC()->Gsposp(
"UTA2", 2,
"UTF2", xpos, ypos, zpos, matrix[0],
"ONLY", parPlt, kNparPlt);
1515 TVirtualMC::GetMC()->Gsposp(
"UTA2", 3,
"UTF2", -xpos, ypos, zpos, matrix[1],
"ONLY", parPlt, kNparPlt);
1518 parBOX[0] = 80.0 / 2.0;
1519 parBOX[1] = 1.0 / 2.0;
1520 parBOX[2] = 10.0 / 2.0;
1521 createVolume(
"UTA3",
"BOX ", idtmed[1], parBOX, kNparBOX);
1524 zpos =
SHEIGHT / 2.0 - 1.5 - 10.0 / 2.0;
1525 TVirtualMC::GetMC()->Gspos(
"UTA3", 1,
"UTF1", xpos, ypos, zpos, 0,
"ONLY");
1526 TVirtualMC::GetMC()->Gspos(
"UTA3", 2,
"UTF2", xpos, -ypos, zpos, 0,
"ONLY");
1530void Geometry::createServices(std::vector<int>
const& idtmed)
1556 const int kTag = 100;
1560 const int kNparBox = 3;
1561 float parBox[kNparBox];
1563 const int kNparTube = 3;
1564 float parTube[kNparTube];
1567 const float kBBMdz = 223.0;
1568 const float kBBSdz = 8.5;
1571 const float kBFMdz = 118.0;
1572 const float kBFSdz = 8.5;
1575 const int kNmatrix = 10;
1576 int matrix[kNmatrix];
1577 TVirtualMC::GetMC()->Matrix(matrix[0], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
1578 TVirtualMC::GetMC()->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
1579 TVirtualMC::GetMC()->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
1580 TVirtualMC::GetMC()->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
1581 TVirtualMC::GetMC()->Matrix(matrix[4], 90.0, 0.0, 0.0, 0.0, 90.0, 90.0);
1582 TVirtualMC::GetMC()->Matrix(matrix[5], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
1583 TVirtualMC::GetMC()->Matrix(matrix[6], 80.0, 0.0, 90.0, 270.0, 10.0, 180.0);
1584 TVirtualMC::GetMC()->Matrix(matrix[7], 90.0, 10.0, 90.0, 100.0, 0.0, 0.0);
1585 TVirtualMC::GetMC()->Matrix(matrix[8], 90.0, 350.0, 90.0, 80.0, 0.0, 0.0);
1586 TVirtualMC::GetMC()->Matrix(matrix[9], 90.0, 90.0, 90.0, 180.0, 0.0, 0.0);
1593 const float kCOLwid = 0.8;
1595 const float kCOLhgt = 6.5;
1597 const float kCOLposx = 1.0;
1598 const float kCOLposz = -1.2;
1600 const float kCOLthk = 0.1;
1601 const int kNparCOL = 3;
1602 float parCOL[kNparCOL];
1606 createVolume(
"UTC1",
"BOX ", idtmed[8], parCOL, 0);
1607 createVolume(
"UTC3",
"BOX ", idtmed[8], parCOL, 0);
1608 parCOL[0] = kCOLwid / 2.0 - kCOLthk;
1610 parCOL[2] = kCOLhgt / 2.0 - kCOLthk;
1611 createVolume(
"UTC2",
"BOX ", idtmed[14], parCOL, kNparCOL);
1612 createVolume(
"UTC4",
"BOX ", idtmed[14], parCOL, kNparCOL);
1617 TVirtualMC::GetMC()->Gspos(
"UTC2", 1,
"UTC1", xpos, ypos, zpos, 0,
"ONLY");
1618 TVirtualMC::GetMC()->Gspos(
"UTC4", 1,
"UTC3", xpos, ypos, zpos, 0,
"ONLY");
1620 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1622 xpos =
CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx;
1626 parCOL[0] = kCOLwid / 2.0;
1628 parCOL[2] = kCOLhgt / 2.0;
1629 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer,
"UTI1", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL, kNparCOL);
1630 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer +
NLAYER,
"UTI1", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1632 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 6 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1634 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 7 *
NLAYER,
"UTI2", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1636 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 8 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1638 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 9 *
NLAYER,
"UTI3", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1640 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 10 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1642 TVirtualMC::GetMC()->Gsposp(
"UTC1", ilayer + 11 *
NLAYER,
"UTI4", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1646 xpos =
CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx;
1650 parCOL[0] = kCOLwid / 2.0;
1652 parCOL[2] = kCOLhgt / 2.0;
1653 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 2 *
NLAYER,
"UTF1", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1655 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 3 *
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1657 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 4 *
NLAYER,
"UTF2", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1659 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 5 *
NLAYER,
"UTF2", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1663 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1665 xpos =
CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx - 2.5;
1666 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1669 parCOL[0] = kCOLwid / 2.0;
1670 parCOL[1] = kBBSdz / 2.0;
1671 parCOL[2] = kCOLhgt / 2.0;
1672 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 6 *
NLAYER,
"BBTRD", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1674 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 7 *
NLAYER,
"BBTRD", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1678 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1680 xpos =
CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 + kCOLposx - 0.3;
1681 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1684 parCOL[0] = kCOLwid / 2.0;
1685 parCOL[1] = kBFSdz / 2.0;
1686 parCOL[2] = kCOLhgt / 2.0;
1687 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 6 *
NLAYER,
"BFTRD", xpos, ypos, zpos, matrix[0],
"ONLY", parCOL,
1689 TVirtualMC::GetMC()->Gsposp(
"UTC3", ilayer + 7 *
NLAYER,
"BFTRD", -xpos, ypos, zpos, matrix[1],
"ONLY", parCOL,
1695 xpos =
CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1698 parCOL[0] = kCOLwid / 2.0;
1700 parCOL[2] = kCOLhgt / 2.0;
1701 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6,
"UTI1", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1702 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 +
NLAYER,
"UTI1", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1703 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 6 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1704 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 7 *
NLAYER,
"UTI2", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1705 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 8 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1706 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 9 *
NLAYER,
"UTI3", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1707 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 10 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1708 TVirtualMC::GetMC()->Gsposp(
"UTC1", 6 + 11 *
NLAYER,
"UTI4", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1710 xpos =
CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1713 parCOL[0] = kCOLwid / 2.0;
1715 parCOL[2] = kCOLhgt / 2.0;
1716 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 2 *
NLAYER,
"UTF1", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1717 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 3 *
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1718 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 4 *
NLAYER,
"UTF2", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1719 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 5 *
NLAYER,
"UTF2", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1721 xpos =
CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 3.1;
1722 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1724 parCOL[0] = kCOLwid / 2.0;
1725 parCOL[1] = kBBSdz / 2.0;
1726 parCOL[2] = kCOLhgt / 2.0;
1727 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 6 *
NLAYER,
"BBTRD", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1728 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 7 *
NLAYER,
"BBTRD", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1730 xpos =
CWIDTH[5] / 2.0 - kCOLhgt / 2.0 - 1.3;
1731 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1733 parCOL[0] = kCOLwid / 2.0;
1734 parCOL[1] = kBFSdz / 2.0;
1735 parCOL[2] = kCOLhgt / 2.0;
1736 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 6 *
NLAYER,
"BFTRD", xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1737 TVirtualMC::GetMC()->Gsposp(
"UTC3", 6 + 7 *
NLAYER,
"BFTRD", -xpos, ypos, zpos, matrix[3],
"ONLY", parCOL, kNparCOL);
1743 const float kPWRwid = 0.6;
1746 const float kPWRhgtA = 5.0 + 0.2;
1747 const float kPWRhgtB = 5.0;
1748 const float kPWRposx = 2.0;
1749 const float kPWRposz = 0.1;
1750 const int kNparPWR = 3;
1751 float parPWR[kNparPWR];
1755 createVolume(
"UTP1",
"BOX ", idtmed[25], parPWR, 0);
1756 createVolume(
"UTP3",
"BOX ", idtmed[25], parPWR, 0);
1758 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1760 xpos =
CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx;
1764 parPWR[0] = kPWRwid / 2.0;
1766 parPWR[2] = kPWRhgtA / 2.0;
1767 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer,
"UTI1", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR, kNparPWR);
1768 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer +
NLAYER,
"UTI1", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1770 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 6 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1772 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 7 *
NLAYER,
"UTI2", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1774 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 8 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1776 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 9 *
NLAYER,
"UTI3", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1778 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 10 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1780 TVirtualMC::GetMC()->Gsposp(
"UTP1", ilayer + 11 *
NLAYER,
"UTI4", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1784 xpos =
CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx;
1788 parPWR[0] = kPWRwid / 2.0;
1790 parPWR[2] = kPWRhgtA / 2.0;
1791 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 2 *
NLAYER,
"UTF1", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1793 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 3 *
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1795 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 4 *
NLAYER,
"UTF2", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1797 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 5 *
NLAYER,
"UTF2", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1801 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1803 xpos =
CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx - 2.5;
1804 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1807 parPWR[0] = kPWRwid / 2.0;
1808 parPWR[1] = kBBSdz / 2.0;
1809 parPWR[2] = kPWRhgtB / 2.0;
1810 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 6 *
NLAYER,
"BBTRD", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1812 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 7 *
NLAYER,
"BBTRD", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1816 for (ilayer = 1; ilayer <
NLAYER; ilayer++) {
1818 xpos =
CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0 + kPWRposx - 0.3;
1819 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1822 parPWR[0] = kPWRwid / 2.0;
1823 parPWR[1] = kBFSdz / 2.0;
1824 parPWR[2] = kPWRhgtB / 2.0;
1825 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 8 *
NLAYER,
"BFTRD", xpos, ypos, zpos, matrix[0],
"ONLY", parPWR,
1827 TVirtualMC::GetMC()->Gsposp(
"UTP3", ilayer + 9 *
NLAYER,
"BFTRD", -xpos, ypos, zpos, matrix[1],
"ONLY", parPWR,
1833 xpos =
CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1836 parPWR[0] = kPWRwid / 2.0;
1838 parPWR[2] = kPWRhgtB / 2.0;
1839 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6,
"UTI1", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1840 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 +
NLAYER,
"UTI1", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1841 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 6 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1842 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 7 *
NLAYER,
"UTI2", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1843 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 8 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1844 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 9 *
NLAYER,
"UTI3", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1845 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 10 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1846 TVirtualMC::GetMC()->Gsposp(
"UTP1", 6 + 11 *
NLAYER,
"UTI4", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1848 xpos =
CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1851 parPWR[0] = kPWRwid / 2.0;
1853 parPWR[2] = kPWRhgtB / 2.0;
1854 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 2 *
NLAYER,
"UTF1", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1855 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 3 *
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1856 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 4 *
NLAYER,
"UTF2", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1857 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 5 *
NLAYER,
"UTF2", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1859 xpos =
CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 3.0;
1860 ypos = kBBSdz / 2.0 - kBBMdz / 2.0;
1862 parPWR[0] = kPWRwid / 2.0;
1863 parPWR[1] = kBBSdz / 2.0;
1864 parPWR[2] = kPWRhgtB / 2.0;
1865 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 6 *
NLAYER,
"BBTRD", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1866 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 7 *
NLAYER,
"BBTRD", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1868 xpos =
CWIDTH[5] / 2.0 + kPWRhgtB / 2.0 - 1.3;
1869 ypos = -kBFSdz / 2.0 + kBFMdz / 2.0;
1871 parPWR[0] = kPWRwid / 2.0;
1872 parPWR[1] = kBFSdz / 2.0;
1873 parPWR[2] = kPWRhgtB / 2.0;
1874 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 8 *
NLAYER,
"BFTRD", xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1875 TVirtualMC::GetMC()->Gsposp(
"UTP3", 6 + 9 *
NLAYER,
"BFTRD", -xpos, ypos, zpos, matrix[3],
"ONLY", parPWR, kNparPWR);
1884 parTube[1] = 2.2 / 2.0;
1886 createVolume(
"UTG1",
"TUBE", idtmed[8], parTube, kNparTube);
1888 parTube[1] = 2.1 / 2.0;
1890 createVolume(
"UTG2",
"TUBE", idtmed[9], parTube, kNparTube);
1894 TVirtualMC::GetMC()->Gspos(
"UTG2", 1,
"UTG1", xpos, ypos, zpos, 0,
"ONLY");
1895 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1896 xpos =
CWIDTH[ilayer] / 2.0 + kCOLwid / 2.0 - 1.5;
1899 TVirtualMC::GetMC()->Gspos(
"UTG1", 1 + ilayer,
"UTI3", xpos, ypos, zpos, matrix[4],
"ONLY");
1900 TVirtualMC::GetMC()->Gspos(
"UTG1", 7 + ilayer,
"UTI3", -xpos, ypos, zpos, matrix[4],
"ONLY");
1904 parTube[1] = 2.2 / 2.0;
1906 createVolume(
"UTG3",
"TUBE", idtmed[8], parTube, kNparTube);
1908 parTube[1] = 2.1 / 2.0;
1910 createVolume(
"UTG4",
"TUBE", idtmed[9], parTube, kNparTube);
1914 TVirtualMC::GetMC()->Gspos(
"UTG4", 1,
"UTG3", xpos, ypos, zpos, 0,
"ONLY");
1915 xpos =
CWIDTH[4] / 2.0 + kCOLwid / 2.0 - 1.5;
1918 TVirtualMC::GetMC()->Gspos(
"UTG3", 1,
"UTI4", xpos, ypos, zpos, matrix[4],
"ONLY");
1921 TVirtualMC::GetMC()->Gspos(
"UTG3", 2,
"UTI4", -xpos, ypos, zpos, matrix[4],
"ONLY");
1927 const int kNparServ = 3;
1928 float parServ[kNparServ];
1930 for (
int istack : {0, 2}) {
1931 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1932 int iDet = getDetectorSec(ilayer, istack);
1934 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
1935 parServ[0] =
CWIDTH[ilayer] / 2.0;
1937 parServ[2] =
CSVH / 2.0;
1938 createVolume(cTagV,
"BOX", idtmed[2], parServ, kNparServ);
1949 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1950 snprintf(cTagV, kTag,
"UCP%01d", ilayer);
1952 parTube[1] = 0.3 / 2.0;
1953 parTube[2] =
CWIDTH[ilayer] / 2.0;
1954 createVolume(cTagV,
"TUBE", idtmed[24], parTube, kNparTube);
1955 snprintf(cTagM, kTag,
"UCW%01d", ilayer);
1957 parTube[1] = 0.2 / 2.0;
1958 parTube[2] =
CWIDTH[ilayer] / 2.0;
1959 createVolume(cTagM,
"TUBE", idtmed[14], parTube, kNparTube);
1960 TVirtualMC::GetMC()->Gspos(cTagM, 1, cTagV, 0.0, 0.0, 0.0, 0,
"ONLY");
1964 for (
int istack : {0, 2}) {
1965 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1966 int iDet = getDetectorSec(ilayer, istack);
1967 int iCopy = getDetector(ilayer, istack, 0) * 100;
1968 int nMCMrow = getRowMax(ilayer, istack, 0);
1969 float ySize = (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)nMCMrow);
1970 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
1971 snprintf(cTagM, kTag,
"UCP%01d", ilayer);
1972 for (
int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
1974 ypos = (0.5 + iMCMrow) * ySize -
CLENGTH[ilayer][istack] / 2.0 +
HSPACE / 2.0;
1975 zpos = 0.0 + 0.742 / 2.0;
1976 TVirtualMC::GetMC()->Gspos(cTagM, iCopy + iMCMrow, cTagV, xpos, ypos, zpos, matrix[2],
"ONLY");
1986 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1987 snprintf(cTagV, kTag,
"UPL%01d", ilayer);
1989 parTube[1] = 0.2 / 2.0;
1990 parTube[2] =
CWIDTH[ilayer] / 2.0;
1991 createVolume(cTagV,
"TUBE", idtmed[5], parTube, kNparTube);
1995 for (
int istack : {0, 2}) {
1996 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
1997 int iDet = getDetectorSec(ilayer, istack);
1998 int iCopy = getDetector(ilayer, istack, 0) * 100;
1999 int nMCMrow = getRowMax(ilayer, istack, 0);
2000 float ySize = (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)nMCMrow);
2001 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
2002 snprintf(cTagM, kTag,
"UPL%01d", ilayer);
2003 for (
int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2005 ypos = (0.5 + iMCMrow) * ySize - 1.0 -
CLENGTH[ilayer][istack] / 2.0 +
HSPACE / 2.0;
2006 zpos = -0.4 + 0.742 / 2.0;
2007 TVirtualMC::GetMC()->Gspos(cTagM, iCopy + iMCMrow, cTagV, xpos, ypos, zpos, matrix[2],
"ONLY");
2016 const float kMCMx = 3.0;
2017 const float kMCMy = 3.0;
2018 const float kMCMz = 0.3;
2020 const float kMCMpcTh = 0.1;
2021 const float kMCMcuTh = 0.0025;
2022 const float kMCMsiTh = 0.03;
2023 const float kMCMcoTh = 0.04;
2026 const int kNparMCM = 3;
2027 float parMCM[kNparMCM];
2028 parMCM[0] = kMCMx / 2.0;
2029 parMCM[1] = kMCMy / 2.0;
2030 parMCM[2] = kMCMz / 2.0;
2031 createVolume(
"UMCM",
"BOX", idtmed[2], parMCM, kNparMCM);
2034 parMCM[0] = kMCMx / 2.0;
2035 parMCM[1] = kMCMy / 2.0;
2036 parMCM[2] = kMCMpcTh / 2.0;
2037 createVolume(
"UMC1",
"BOX", idtmed[19], parMCM, kNparMCM);
2039 parMCM[0] = kMCMx / 2.0;
2040 parMCM[1] = kMCMy / 2.0;
2041 parMCM[2] = kMCMcuTh / 2.0;
2042 createVolume(
"UMC2",
"BOX", idtmed[18], parMCM, kNparMCM);
2044 parMCM[0] = kMCMx / 2.0;
2045 parMCM[1] = kMCMy / 2.0;
2046 parMCM[2] = kMCMsiTh / 2.0;
2047 createVolume(
"UMC3",
"BOX", idtmed[20], parMCM, kNparMCM);
2049 parMCM[0] = kMCMx / 2.0;
2050 parMCM[1] = kMCMy / 2.0;
2051 parMCM[2] = kMCMcoTh / 2.0;
2052 createVolume(
"UMC4",
"BOX", idtmed[24], parMCM, kNparMCM);
2058 parTube[1] = 0.3 / 2.0;
2059 parTube[2] = kMCMx / 2.0;
2060 createVolume(
"UTCQ",
"TUBE", idtmed[24], parTube, kNparTube);
2062 parTube[1] = 0.2 / 2.0;
2063 parTube[2] = kMCMx / 2.0;
2064 createVolume(
"UTCR",
"TUBE", idtmed[14], parTube, kNparTube);
2065 TVirtualMC::GetMC()->Gspos(
"UTCR", 1,
"UTCQ", 0.0, 0.0, 0.0, 0,
"ONLY");
2070 zpos = -kMCMz / 2.0 + kMCMpcTh / 2.0;
2071 TVirtualMC::GetMC()->Gspos(
"UMC1", 1,
"UMCM", xpos, ypos, zpos, 0,
"ONLY");
2072 zpos += kMCMpcTh / 2.0 + kMCMcuTh / 2.0;
2073 TVirtualMC::GetMC()->Gspos(
"UMC2", 1,
"UMCM", xpos, ypos, zpos, 0,
"ONLY");
2074 zpos += kMCMcuTh / 2.0 + kMCMsiTh / 2.0;
2075 TVirtualMC::GetMC()->Gspos(
"UMC3", 1,
"UMCM", xpos, ypos, zpos, 0,
"ONLY");
2076 zpos += kMCMsiTh / 2.0 + kMCMcoTh / 2.0;
2077 TVirtualMC::GetMC()->Gspos(
"UMC4", 1,
"UMCM", xpos, ypos, zpos, 0,
"ONLY");
2080 for (
int istack : {0, 2}) {
2081 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
2082 int iDet = getDetectorSec(ilayer, istack);
2083 int iCopy = getDetector(ilayer, istack, 0) * 1000;
2084 int nMCMrow = getRowMax(ilayer, istack, 0);
2085 float ySize = (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)nMCMrow);
2087 float xSize = (getChamberWidth(ilayer) - 2.0 *
CPADW) / ((
float)nMCMcol + 6);
2088 int iMCM[8] = {1, 2, 3, 5, 8, 9, 10, 12};
2089 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
2090 for (
int iMCMrow = 0; iMCMrow < nMCMrow; iMCMrow++) {
2091 for (
int iMCMcol = 0; iMCMcol < nMCMcol; iMCMcol++) {
2092 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0 -
CWIDTH[ilayer] / 2.0;
2093 ypos = (0.5 + iMCMrow) * ySize + 1.0 -
CLENGTH[ilayer][istack] / 2.0 +
HSPACE / 2.0;
2094 zpos = -0.4 + 0.742 / 2.0;
2095 TVirtualMC::GetMC()->Gspos(
"UMCM", iCopy + iMCMrow * 10 + iMCMcol, cTagV, xpos, ypos, zpos, 0,
"ONLY");
2098 xpos = (0.5 + iMCM[iMCMcol]) * xSize + 1.0 -
CWIDTH[ilayer] / 2.0;
2099 ypos = (0.5 + iMCMrow) * ySize -
CLENGTH[ilayer][istack] / 2.0 +
HSPACE / 2.0;
2100 zpos = 0.0 + 0.742 / 2.0;
2101 TVirtualMC::GetMC()->Gspos(
"UTCQ", iCopy + iMCMrow * 10 + iMCMcol + 50, cTagV, xpos, ypos + 1.0, zpos,
2103 TVirtualMC::GetMC()->Gspos(
"UTCQ", iCopy + iMCMrow * 10 + iMCMcol + 500, cTagV, xpos, ypos + 2.0, zpos,
2114 const float kDCSx = 9.0;
2115 const float kDCSy = 14.5;
2116 const float kDCSz = 0.3;
2118 const float kDCSpcTh = 0.15;
2119 const float kDCScuTh = 0.01;
2120 const float kDCScoTh = 0.04;
2123 const int kNparDCS = 3;
2124 float parDCS[kNparDCS];
2125 parDCS[0] = kDCSx / 2.0;
2126 parDCS[1] = kDCSy / 2.0;
2127 parDCS[2] = kDCSz / 2.0;
2128 createVolume(
"UDCS",
"BOX", idtmed[2], parDCS, kNparDCS);
2131 parDCS[0] = kDCSx / 2.0;
2132 parDCS[1] = kDCSy / 2.0;
2133 parDCS[2] = kDCSpcTh / 2.0;
2134 createVolume(
"UDC1",
"BOX", idtmed[19], parDCS, kNparDCS);
2136 parDCS[0] = kDCSx / 2.0;
2137 parDCS[1] = kDCSy / 2.0;
2138 parDCS[2] = kDCScuTh / 2.0;
2139 createVolume(
"UDC2",
"BOX", idtmed[18], parDCS, kNparDCS);
2141 parDCS[0] = 5.0 / 2.0;
2142 parDCS[1] = 5.0 / 2.0;
2143 parDCS[2] = kDCScoTh / 2.0;
2144 createVolume(
"UDC3",
"BOX", idtmed[24], parDCS, kNparDCS);
2149 zpos = -kDCSz / 2.0 + kDCSpcTh / 2.0;
2150 TVirtualMC::GetMC()->Gspos(
"UDC1", 1,
"UDCS", xpos, ypos, zpos, 0,
"ONLY");
2151 zpos += kDCSpcTh / 2.0 + kDCScuTh / 2.0;
2152 TVirtualMC::GetMC()->Gspos(
"UDC2", 1,
"UDCS", xpos, ypos, zpos, 0,
"ONLY");
2153 zpos += kDCScuTh / 2.0 + kDCScoTh / 2.0;
2154 TVirtualMC::GetMC()->Gspos(
"UDC3", 1,
"UDCS", xpos, ypos, zpos, 0,
"ONLY");
2157 for (
int istack : {0, 2}) {
2158 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
2159 int iDet = getDetectorSec(ilayer, istack);
2160 int iCopy = iDet + 1;
2161 xpos =
CWIDTH[ilayer] / 2.0 -
2162 1.9 * (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)getRowMax(ilayer, istack, 0));
2163 ypos = 0.05 *
CLENGTH[ilayer][istack];
2164 zpos = kDCSz / 2.0 -
CSVH / 2.0;
2165 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
2166 TVirtualMC::GetMC()->Gspos(
"UDCS", iCopy, cTagV, xpos, ypos, zpos, 0,
"ONLY");
2174 const float kORIx = 4.2;
2175 const float kORIy = 13.5;
2176 const float kORIz = 0.3;
2178 const float kORIpcTh = 0.15;
2179 const float kORIcuTh = 0.01;
2180 const float kORIcoTh = 0.04;
2183 const int kNparORI = 3;
2184 float parORI[kNparORI];
2185 parORI[0] = kORIx / 2.0;
2186 parORI[1] = kORIy / 2.0;
2187 parORI[2] = kORIz / 2.0;
2188 createVolume(
"UORI",
"BOX", idtmed[2], parORI, kNparORI);
2191 parORI[0] = kORIx / 2.0;
2192 parORI[1] = kORIy / 2.0;
2193 parORI[2] = kORIpcTh / 2.0;
2194 createVolume(
"UOR1",
"BOX", idtmed[19], parORI, kNparORI);
2196 parORI[0] = kORIx / 2.0;
2197 parORI[1] = kORIy / 2.0;
2198 parORI[2] = kORIcuTh / 2.0;
2199 createVolume(
"UOR2",
"BOX", idtmed[18], parORI, kNparORI);
2201 parORI[0] = kORIx / 2.0;
2202 parORI[1] = kORIy / 2.0;
2203 parORI[2] = kORIcoTh / 2.0;
2204 createVolume(
"UOR3",
"BOX", idtmed[24], parORI, kNparORI);
2209 zpos = -kORIz / 2.0 + kORIpcTh / 2.0;
2210 TVirtualMC::GetMC()->Gspos(
"UOR1", 1,
"UORI", xpos, ypos, zpos, 0,
"ONLY");
2211 zpos += kORIpcTh / 2.0 + kORIcuTh / 2.0;
2212 TVirtualMC::GetMC()->Gspos(
"UOR2", 1,
"UORI", xpos, ypos, zpos, 0,
"ONLY");
2213 zpos += kORIcuTh / 2.0 + kORIcoTh / 2.0;
2214 TVirtualMC::GetMC()->Gspos(
"UOR3", 1,
"UORI", xpos, ypos, zpos, 0,
"ONLY");
2217 for (
int istack : {0, 2}) {
2218 for (ilayer = 0; ilayer <
NLAYER; ilayer++) {
2219 int iDet = getDetectorSec(ilayer, istack);
2220 int iCopy = iDet + 1;
2221 xpos =
CWIDTH[ilayer] / 2.0 -
2222 1.92 * (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)getRowMax(ilayer, istack, 0));
2224 zpos = kORIz / 2.0 -
CSVH / 2.0;
2225 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
2226 TVirtualMC::GetMC()->Gspos(
"UORI", iCopy, cTagV, xpos, ypos, zpos, 0,
"ONLY");
2227 xpos = -
CWIDTH[ilayer] / 2.0 +
2228 3.8 * (getChamberLength(ilayer, istack) - 2.0 *
RPADW) / ((
float)getRowMax(ilayer, istack, 0));
2230 zpos = kORIz / 2.0 -
CSVH / 2.0;
2231 snprintf(cTagV, kTag,
"UU%02d", shapeClass(ilayer, istack));
2232 TVirtualMC::GetMC()->Gspos(
"UORI", iCopy +
MAXCHAMBER, cTagV, xpos, ypos, zpos, 0,
"ONLY");
2243 for (ilayer = 0; ilayer <
NLAYER - 1; ilayer++) {
2244 snprintf(cTagV, kTag,
"UGI%01d", ilayer);
2246 parTube[1] = 1.5 / 2.0;
2247 parTube[2] =
CWIDTH[ilayer] / 2.0 - 2.5;
2248 createVolume(cTagV,
"TUBE", idtmed[8], parTube, kNparTube);
2249 snprintf(cTagM, kTag,
"UGX%01d", ilayer);
2251 parTube[1] = 1.2 / 2.0;
2252 parTube[2] =
CWIDTH[ilayer] / 2.0 - 2.5;
2253 createVolume(cTagM,
"TUBE", idtmed[9], parTube, kNparTube);
2254 TVirtualMC::GetMC()->Gspos(cTagM, 1, cTagV, 0.0, 0.0, 0.0, 0,
"ONLY");
2256 for (ilayer = 0; ilayer <
NLAYER - 1; ilayer++) {
2260 snprintf(cTagV, kTag,
"UGI%01d", ilayer);
2261 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1,
"UTI1", xpos, ypos, zpos, matrix[2],
"ONLY");
2262 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 1 *
NLAYER,
"UTI1", xpos, -ypos, zpos, matrix[2],
"ONLY");
2263 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 2 *
NLAYER,
"UTI2", xpos, ypos, zpos, matrix[2],
"ONLY");
2264 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 3 *
NLAYER,
"UTI2", xpos, -ypos, zpos, matrix[2],
"ONLY");
2265 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 4 *
NLAYER,
"UTI3", xpos, ypos, zpos, matrix[2],
"ONLY");
2266 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 5 *
NLAYER,
"UTI3", xpos, -ypos, zpos, matrix[2],
"ONLY");
2267 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 6 *
NLAYER,
"UTI4", xpos, ypos, zpos, matrix[2],
"ONLY");
2268 TVirtualMC::GetMC()->Gspos(cTagV, ilayer + 1 + 7 *
NLAYER,
"UTI4", xpos, -ypos, zpos, matrix[2],
"ONLY");
2272 parBox[0] = 14.50 / 2.0;
2273 parBox[1] = 4.52 / 2.0;
2274 parBox[2] = 5.00 / 2.0;
2275 createVolume(
"UTGD",
"BOX ", idtmed[8], parBox, kNparBox);
2276 parBox[0] = 14.50 / 2.0;
2277 parBox[1] = 4.00 / 2.0;
2278 parBox[2] = 4.40 / 2.0;
2279 createVolume(
"UTGI",
"BOX ", idtmed[9], parBox, kNparBox);
2281 parTube[1] = 4.0 / 2.0;
2282 parTube[2] = 8.0 / 2.0;
2283 createVolume(
"UTGT",
"TUBE", idtmed[8], parTube, kNparTube);
2285 parTube[1] = 3.4 / 2.0;
2286 parTube[2] = 8.0 / 2.0;
2287 createVolume(
"UTGG",
"TUBE", idtmed[9], parTube, kNparTube);
2291 TVirtualMC::GetMC()->Gspos(
"UTGI", 1,
"UTGD", xpos, ypos, zpos, 0,
"ONLY");
2292 TVirtualMC::GetMC()->Gspos(
"UTGG", 1,
"UTGT", xpos, ypos, zpos, 0,
"ONLY");
2296 TVirtualMC::GetMC()->Gspos(
"UTGD", 1,
"UTF1", xpos, ypos, zpos, 0,
"ONLY");
2300 TVirtualMC::GetMC()->Gspos(
"UTGT", 1,
"UTF1", xpos, ypos, zpos, 0,
"ONLY");
2304 TVirtualMC::GetMC()->Gspos(
"UTGT", 3,
"UTF1", xpos, ypos, zpos, matrix[2],
"ONLY");
2308 TVirtualMC::GetMC()->Gspos(
"UTGT", 5,
"UTF1", xpos, ypos, zpos, matrix[2],
"ONLY");
2311 parBox[0] = 5.0 / 2.0;
2312 parBox[1] = 23.0 / 2.0;
2313 parBox[2] = 70.0 / 2.0;
2314 createVolume(
"UTCM",
"BOX ", idtmed[2], parBox, kNparBox);
2315 parBox[0] = 5.0 / 2.0;
2316 parBox[1] = 5.0 / 2.0;
2317 parBox[2] = 70.0 / 2.0;
2318 createVolume(
"UTCA",
"BOX ", idtmed[8], parBox, kNparBox);
2319 parBox[0] = 5.0 / 2.0 - 0.3;
2320 parBox[1] = 5.0 / 2.0 - 0.3;
2321 parBox[2] = 70.0 / 2.0 - 0.3;
2322 createVolume(
"UTCW",
"BOX ", idtmed[14], parBox, kNparBox);
2326 TVirtualMC::GetMC()->Gspos(
"UTCW", 1,
"UTCA", xpos, ypos, zpos, 0,
"ONLY");
2328 ypos = 5.0 / 2.0 - 23.0 / 2.0;
2330 TVirtualMC::GetMC()->Gspos(
"UTCA", 1,
"UTCM", xpos, ypos, zpos, 0,
"ONLY");
2332 parTube[1] = 3.0 / 2.0;
2333 parTube[2] = 18.0 / 2.0;
2334 createVolume(
"UTCO",
"TUBE", idtmed[8], parTube, kNparTube);
2336 parTube[1] = 3.0 / 2.0 - 0.3;
2337 parTube[2] = 18.0 / 2.0;
2338 createVolume(
"UTCL",
"TUBE", idtmed[14], parTube, kNparTube);
2342 TVirtualMC::GetMC()->Gspos(
"UTCL", 1,
"UTCO", xpos, ypos, zpos, 0,
"ONLY");
2345 zpos = -70.0 / 2.0 + 7.0;
2346 TVirtualMC::GetMC()->Gspos(
"UTCO", 1,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2348 TVirtualMC::GetMC()->Gspos(
"UTCO", 2,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2350 TVirtualMC::GetMC()->Gspos(
"UTCO", 3,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2352 TVirtualMC::GetMC()->Gspos(
"UTCO", 4,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2354 TVirtualMC::GetMC()->Gspos(
"UTCO", 5,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2356 TVirtualMC::GetMC()->Gspos(
"UTCO", 6,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2358 TVirtualMC::GetMC()->Gspos(
"UTCO", 7,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2360 TVirtualMC::GetMC()->Gspos(
"UTCO", 8,
"UTCM", xpos, ypos, zpos, matrix[4],
"ONLY");
2363 ypos =
FLENGTH / 2.0 - 23.0 / 2.0;
2365 TVirtualMC::GetMC()->Gspos(
"UTCM", 1,
"UTF1", xpos, ypos, zpos, matrix[0],
"ONLY");
2366 TVirtualMC::GetMC()->Gspos(
"UTCM", 2,
"UTF1", -xpos, ypos, zpos, matrix[1],
"ONLY");
2367 TVirtualMC::GetMC()->Gspos(
"UTCM", 3,
"UTF2", xpos, -ypos, zpos, matrix[5],
"ONLY");
2368 TVirtualMC::GetMC()->Gspos(
"UTCM", 4,
"UTF2", -xpos, -ypos, zpos, matrix[6],
"ONLY");
2371 parBox[0] = 0.5 / 2.0;
2372 parBox[1] = 15.0 / 2.0;
2373 parBox[2] = 7.0 / 2.0;
2374 createVolume(
"UTPC",
"BOX ", idtmed[25], parBox, kNparBox);
2375 for (ilayer = 0; ilayer <
NLAYER - 1; ilayer++) {
2376 xpos =
CWIDTH[ilayer] / 2.0 + kPWRwid / 2.0;
2379 TVirtualMC::GetMC()->Gspos(
"UTPC", ilayer,
"UTF1", xpos, ypos, zpos, matrix[0],
"ONLY");
2380 TVirtualMC::GetMC()->Gspos(
"UTPC", ilayer +
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[1],
"ONLY");
2382 xpos =
CWIDTH[5] / 2.0 + kPWRhgtA / 2.0 - 2.0;
2385 TVirtualMC::GetMC()->Gspos(
"UTPC", 5,
"UTF1", xpos, ypos, zpos, matrix[3],
"ONLY");
2386 TVirtualMC::GetMC()->Gspos(
"UTPC", 5 +
NLAYER,
"UTF1", -xpos, ypos, zpos, matrix[3],
"ONLY");
2389 parBox[0] = 60.0 / 2.0;
2390 parBox[1] = 10.0 / 2.0;
2391 parBox[2] = 3.0 / 2.0;
2392 createVolume(
"UTPP",
"BOX ", idtmed[1], parBox, kNparBox);
2396 TVirtualMC::GetMC()->Gspos(
"UTPP", 1,
"UTF1", xpos, ypos, zpos, 0,
"ONLY");
2403 parBox[0] = 60.0 / 2.0;
2404 parBox[1] = 10.0 / 2.0;
2405 parBox[2] = 6.0 / 2.0;
2406 createVolume(
"UTE1",
"BOX ", idtmed[8], parBox, kNparBox);
2408 parBox[0] = parBox[0] - 0.5;
2409 parBox[1] = parBox[1] - 0.5;
2410 parBox[2] = parBox[2] - 0.5;
2411 createVolume(
"UTE2",
"BOX ", idtmed[2], parBox, kNparBox);
2415 TVirtualMC::GetMC()->Gspos(
"UTE2", 1,
"UTE1", xpos, ypos, zpos, 0,
"ONLY");
2417 ypos =
SLENGTH / 2.0 - 10.0 / 2.0 - 3.0;
2418 zpos = -
SHEIGHT / 2.0 + 6.0 / 2.0 + 1.0;
2419 TVirtualMC::GetMC()->Gspos(
"UTE1", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
2420 TVirtualMC::GetMC()->Gspos(
"UTE1", 2,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
2421 TVirtualMC::GetMC()->Gspos(
"UTE1", 3,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
2422 TVirtualMC::GetMC()->Gspos(
"UTE1", 4,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
2425 parBox[0] = 50.0 / 2.0;
2426 parBox[1] = 15.0 / 2.0;
2427 parBox[2] = 20.0 / 2.0;
2428 createVolume(
"UTE3",
"BOX ", idtmed[8], parBox, kNparBox);
2430 parBox[0] = parBox[0] - 0.5;
2431 parBox[1] = parBox[1] - 0.5;
2432 parBox[2] = parBox[2] - 0.5;
2433 createVolume(
"UTE4",
"BOX ", idtmed[2], parBox, kNparBox);
2437 TVirtualMC::GetMC()->Gspos(
"UTE4", 1,
"UTE3", xpos, ypos, zpos, 0,
"ONLY");
2439 ypos = -
SLENGTH / 2.0 + 15.0 / 2.0 + 3.0;
2440 zpos = -
SHEIGHT / 2.0 + 20.0 / 2.0 + 1.0;
2441 TVirtualMC::GetMC()->Gspos(
"UTE3", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
2442 TVirtualMC::GetMC()->Gspos(
"UTE3", 2,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
2443 TVirtualMC::GetMC()->Gspos(
"UTE3", 3,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
2444 TVirtualMC::GetMC()->Gspos(
"UTE3", 4,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
2447 parBox[0] = 20.0 / 2.0;
2448 parBox[1] = 7.0 / 2.0;
2449 parBox[2] = 20.0 / 2.0;
2450 createVolume(
"UTE5",
"BOX ", idtmed[8], parBox, kNparBox);
2452 parBox[0] = parBox[0] - 0.5;
2453 parBox[1] = parBox[1] - 0.5;
2454 parBox[2] = parBox[2] - 0.5;
2455 createVolume(
"UTE6",
"BOX ", idtmed[2], parBox, kNparBox);
2459 TVirtualMC::GetMC()->Gspos(
"UTE6", 1,
"UTE5", xpos, ypos, zpos, 0,
"ONLY");
2461 ypos = -
SLENGTH / 2.0 + 7.0 / 2.0 + 3.0;
2463 TVirtualMC::GetMC()->Gspos(
"UTE5", 1,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
2464 TVirtualMC::GetMC()->Gspos(
"UTE5", 2,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
2465 TVirtualMC::GetMC()->Gspos(
"UTE5", 3,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
2466 TVirtualMC::GetMC()->Gspos(
"UTE5", 4,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
2468 TVirtualMC::GetMC()->Gspos(
"UTE5", 5,
"UTI1", xpos, ypos, zpos, 0,
"ONLY");
2469 TVirtualMC::GetMC()->Gspos(
"UTE5", 6,
"UTI2", xpos, ypos, zpos, 0,
"ONLY");
2470 TVirtualMC::GetMC()->Gspos(
"UTE5", 7,
"UTI3", xpos, ypos, zpos, 0,
"ONLY");
2471 TVirtualMC::GetMC()->Gspos(
"UTE5", 8,
"UTI4", xpos, ypos, zpos, 0,
"ONLY");
2475void Geometry::assembleChamber(
int ilayer,
int istack)
2482 const int kTag = 100;
2490 int idet = getDetectorSec(ilayer, istack);
2493 int ishape = shapeClass(ilayer, istack);
2496 snprintf(cTagM, kTag,
"UT%02d", idet);
2497 TGeoVolume*
roc =
new TGeoVolumeAssembly(cTagM);
2504 snprintf(cTagV, kTag,
"UA%02d", ishape);
2505 TGeoVolume* rocA = gGeoManager->GetVolume(cTagV);
2506 roc->AddNode(rocA, 1,
new TGeoTranslation(xpos, ypos, zpos));
2512 snprintf(cTagV, kTag,
"UZ%02d", ishape);
2513 TGeoVolume* rocZ = gGeoManager->GetVolume(cTagV);
2514 roc->AddNode(rocZ, 1,
new TGeoTranslation(xpos, ypos, zpos));
2515 roc->AddNode(rocZ, 2,
new TGeoTranslation(-xpos, ypos, zpos));
2521 snprintf(cTagV, kTag,
"UP%02d", ishape);
2522 TGeoVolume* rocP = gGeoManager->GetVolume(cTagV);
2523 roc->AddNode(rocP, 1,
new TGeoTranslation(xpos, ypos, zpos));
2524 roc->AddNode(rocP, 2,
new TGeoTranslation(-xpos, ypos, zpos));
2531 snprintf(cTagV, kTag,
"UD%02d", ishape);
2532 TGeoVolume* rocD = gGeoManager->GetVolume(cTagV);
2533 roc->AddNode(rocD, 1,
new TGeoTranslation(xpos, ypos, zpos));
2540 snprintf(cTagV, kTag,
"UF%02d", ishape);
2541 TGeoVolume* rocF = gGeoManager->GetVolume(cTagV);
2542 roc->AddNode(rocF, 1,
new TGeoTranslation(xpos, ypos, zpos));
2548 snprintf(cTagV, kTag,
"UU%02d", ishape);
2549 TGeoVolume* rocU = gGeoManager->GetVolume(cTagV);
2550 roc->AddNode(rocU, 1,
new TGeoTranslation(xpos, ypos, zpos));
2556 for (
int ic = 0; ic < istack; ic++) {
2559 ypos -=
CLENGTH[ilayer][istack] / 2.0;
2561 TGeoVolume* sm1 = gGeoManager->GetVolume(
"UTI1");
2562 TGeoVolume* sm2 = gGeoManager->GetVolume(
"UTI2");
2563 TGeoVolume* sm3 = gGeoManager->GetVolume(
"UTI3");
2564 TGeoVolume* sm4 = gGeoManager->GetVolume(
"UTI4");
2565 sm1->AddNode(
roc, 1,
new TGeoTranslation(xpos, ypos, zpos));
2566 sm2->AddNode(
roc, 1,
new TGeoTranslation(xpos, ypos, zpos));
2569 sm3->AddNode(
roc, 1,
new TGeoTranslation(xpos, ypos, zpos));
2571 if (!((ilayer == 4) && (istack == 4))) {
2573 sm4->AddNode(
roc, 1,
new TGeoTranslation(xpos, ypos, zpos));
2592 std::string volPath;
2595 const std::string vpStr{
"ALIC_1/barrel_1/B077_1/BSEGMO"};
2596 const std::string vpApp1{
"_1/BTRD"};
2597 const std::string vpApp2{
"_1"};
2598 const std::string vpApp3a{
"/UTR1_1/UTS1_1/UTI1_1"};
2599 const std::string vpApp3b{
"/UTR2_1/UTS2_1/UTI2_1"};
2600 const std::string vpApp3c{
"/UTR3_1/UTS3_1/UTI3_1"};
2601 const std::string vpApp3d{
"/UTR4_1/UTS4_1/UTI4_1"};
2603 for (
int ilayer = 0; ilayer <
NLAYER; ilayer++) {
2604 for (
int isector = 0; isector <
NSECTOR; isector++) {
2605 for (
int istack = 0; istack <
NSTACK; istack++) {
2606 Int_t lid = getDetector(ilayer, istack, isector);
2615 if ((istack == 4) && (ilayer == 4)) {
2636 if (!gGeoManager->CheckPath(volPath.c_str())) {
2640 TGeoHMatrix rotMatrix;
2641 rotMatrix.RotateX(-90);
2642 rotMatrix.RotateY(-90);
2643 rotMatrix.MultiplyLeft(
m);
2644 const TGeoHMatrix& t2l = rotMatrix.Inverse();
2649 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2650 TGeoHMatrix rotSector;
2651 rotSector.RotateZ(sectorAngle);
2659 const TGeoMatrix& inv = rotSector.Inverse();
2660 rotMatrix.MultiplyLeft(&inv);
2675 LOG(fatal) <<
"Geometry is not loaded";
2678 std::string volPath;
2679 std::string vpStr{
"ALIC_1/barrel_1/B077_1/BSEGMO"};
2680 const std::string vpApp1{
"_1/BTRD"};
2681 const std::string vpApp2{
"_1"};
2682 const std::string vpApp3a{
"/UTR1_1/UTS1_1/UTI1_1"};
2683 const std::string vpApp3b{
"/UTR2_1/UTS2_1/UTI2_1"};
2684 const std::string vpApp3c{
"/UTR3_1/UTS3_1/UTI3_1"};
2685 const std::string vpApp3d{
"/UTR4_1/UTS4_1/UTI4_1"};
2686 std::string symName;
2692 for (
int isector = 0; isector <
NSECTOR; isector++) {
2698 symName = Form(
"TRD/sm%02d", isector);
2699 gGeoManager->SetAlignableEntry(symName.c_str(), volPath.c_str());
2705 for (
int isector = 0; isector <
NSECTOR; isector++) {
2706 if (!getSMstatus(isector)) {
2709 for (
int ilayer = 0; ilayer <
NLAYER; ilayer++) {
2710 for (
int istack = 0; istack <
NSTACK; istack++) {
2711 Int_t lid = getDetector(ilayer, istack, isector);
2712 int idet = getDetectorSec(ilayer, istack);
2722 if ((istack == 4) && (ilayer == 4)) {
2743 volPath += Form(
"/UT%02d_1", idet);
2745 symName = Form(
"TRD/sm%02d/st%d/pl%d", isector, istack, ilayer);
2748 TGeoPNEntry* alignableEntry = gGeoManager->SetAlignableEntry(symName.c_str(), volPath.c_str(), modID);
2751 if (alignableEntry) {
2752 TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
2753 Double_t sectorAngle = 20.0 * (isector % 18) + 10.0;
2754 TGeoHMatrix* t2lMatrix =
new TGeoHMatrix();
2755 t2lMatrix->RotateZ(sectorAngle);
2756 const TGeoHMatrix& globmatrixi = globMatrix->Inverse();
2757 t2lMatrix->MultiplyLeft(&globmatrixi);
2758 alignableEntry->SetMatrix(t2lMatrix);
2760 LOG(error) <<
"Alignable entry is not valid: ModID:" << modID <<
" Sector:" << isector <<
" Lr:" << ilayer
2761 <<
" Stack: " << istack <<
" name: " << symName.c_str() <<
" vol: " << volPath.c_str();
2773 LOG(error) <<
"Geometry is not loaded yet";
2778 LOG(warning) <<
"Already built";
General auxilliary methods.
Definition of the GeometryManager class.
static int getSensID(o2::detectors::DetID detid, int sensid)
static TGeoHMatrix * getMatrix(const char *symname)
Static class with identifiers, bitmasks and names for ALICE detectors.
void setMatrixT2L(const Mat3D &matrix, int sensID)
o2::math_utils::Rotation2Df_t Rot2D
void setSize(int s)=delete
void setMatrixT2GRot(const Rot2D &matrix, int sensID)
o2::math_utils::Transform3D Mat3D
void setMatrixL2G(const Mat3D &matrix, int sensID)
void setMatrixT2G(const Mat3D &matrix, int sensID)
bool isMatrixAvailable(int sensID) const
static constexpr float PGLTHICK
Thickness of the glue layer.
static constexpr float PRBTHICK
Thickness of the PCB copper layers.
static constexpr float AMZPOS
Position of the amplification region.
static constexpr float PELTHICK
Thickness of all other electronics components (caps, etc.)
static constexpr float DRZPOS
Position of the drift region.
static constexpr float AMTHICK
Thickness of the amplification region.
static constexpr float CALHMOD
Height of additional aluminum ledge on lower frame.
static constexpr float CWSW
Width of additional wacosit ledge on lower frame.
static constexpr float CWIDTH[constants::NLAYER]
static constexpr float PPDTHICK
Thickness of copper of the pad plane.
static constexpr float CAUT
Al frame of back panel.
static constexpr float DRTHICK
Thickness of the drift region.
static constexpr float CGLT
Thichness of the glue around the radiator.
static constexpr float CSVH
Height of the services on top of the chambers.
static constexpr float RRHTHICK
Thickness of the rohacell layers in the radiator.
static constexpr float CWSH
Height of additional wacosit ledge on lower frame.
static constexpr float CLENGTH[constants::NLAYER][constants::NSTACK]
static constexpr float CHSV
Total height of the chambers (with services)
static constexpr float SWIDTH1
Lower width of the supermodule.
static constexpr float RFBTHICK
Thickness of the fiber layers in the radiator.
static constexpr float SLENGTH
Length of the supermodule.
static constexpr float WRTHICK
Thickness of the wire planes.
static constexpr float PHCTHICK
Thickness of the honeycomb support structure.
static constexpr float CROW
Additional width of the readout chamber frames.
static constexpr float CCLFT
Thickness of the lower Wacosit frame front.
static constexpr float CROH
Height of the readout of the chambers.
static constexpr float PCBTHICK
Thickness of the carbon layers.
static constexpr float CALZPOS
Position of the additional aluminum ledges.
static constexpr float RCBTHICK
Thickness of the carbon layers in the radiator.
static constexpr float CCLST
Thickness of the lower Wacosit frame sides.
static constexpr float WRZPOSB
Position of the wire planes.
static constexpr float RGLTHICK
Thickness of the glue layers in the radiator.
static constexpr float VROCSM
Radial distance of the first ROC to the outer plates of the SM.
PadPlane mPadPlanes[constants::NLAYER *constants::NSTACK]
static constexpr float FLENGTH
static constexpr float CRAH
Height of the radiator part of the chambers.
static constexpr float PPPTHICK
Thickness of PCB board of the pad plane.
static constexpr float CALH
Height of additional aluminum ledge on lower frame.
static constexpr float VSPACE
Vertical spacing of the chambers.
static constexpr float SHEIGHT
Height of the supermodule.
static constexpr float CDRH
Height of the drift region of the chambers.
static constexpr float CCUTB
Thickness of the upper Wacosit frame around amp. region.
static constexpr float SMPLTT
Thickness of the super module side plates.
static constexpr float HSPACE
Horizontal spacing of the chambers.
static constexpr float CH
Total height of the chambers (w/o services)
static constexpr float CALWMOD
Width of additional aluminum ledge on lower frame.
static constexpr float RMYTHICK
Thickness of the mylar layers in the radiator.
static constexpr float SWIDTH2
Upper width of the supermodule.
static constexpr float CPADW
static constexpr float PPCTHICK
Thickness of the PCB readout boards.
static constexpr float RPADW
>Difference of outer chamber width and pad plane width
static constexpr float WRZPOSA
Position of the wire planes.
static constexpr float CAMH
Height of the amplification region of the chambers.
static constexpr float CCUTA
Upper Wacosit frame around amplification region.
static constexpr float CALT
Thicknesses of different parts of the chamber frame Lower aluminum frame.
bool rotateBack(int det, const float *const loc, float *glb) const
void createPadPlaneArray()
void addAlignableVolumes() const
bool createClusterMatrixArray()
void fillMatrixCache(int mask) override
void createGeometry(std::vector< int > const &idtmed)
bool chamberInGeometry(int det) const
GLuint const GLchar * name
std::string detectors(const std::vector< std::string > &det, unsigned mask)
constexpr int NLAYER
the number of layers
constexpr int NSECTOR
the number of sectors
constexpr int NSTACK
the number of stacks per sector
constexpr int MAXCHAMBER
the maximum number of installed chambers
constexpr int NCHAMBER
the number of chambers actually installed
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)