13 #include <klm/eklm/geometry/GeoEKLMCreator.h>
16 #include <klm/eklm/geometry/G4TriangularPrism.h>
17 #include <klm/eklm/simulation/EKLMSensitiveDetector.h>
20 #include <geometry/CreatorFactory.h>
21 #include <geometry/Materials.h>
22 #include <geometry/utilities.h>
26 #include <G4Polyhedra.hh>
27 #include <G4PVPlacement.hh>
28 #include <G4Region.hh>
30 #include <G4UnionSolid.hh>
33 #include <CLHEP/Units/SystemOfUnits.h>
41 static const char MemErr[] =
"Memory allocation error.";
44 geometry::CreatorFactory<EKLM::GeoEKLMCreator> GeoEKLMFactory(
"EKLMCreator");
68 delete m_TransformData;
69 if (m_Solids.plane !=
nullptr)
71 if (m_Sensitive !=
nullptr)
81 (G4VSolid**)malloc(m_GeoDat->getNPlanes() *
sizeof(G4VSolid*));
82 if (m_Solids.plane ==
nullptr)
84 m_Solids.plasticSheetElement =
85 (G4VSolid**)malloc(m_GeoDat->getNStrips() *
sizeof(G4VSolid*));
86 if (m_Solids.plasticSheetElement ==
nullptr)
89 (G4VSolid**)malloc(m_GeoDat->getNSegments() *
sizeof(G4VSolid*));
90 if (m_Solids.psheet ==
nullptr)
92 m_LogVol.psheet = (G4LogicalVolume**)
93 malloc(m_GeoDat->getNSegments() *
sizeof(G4LogicalVolume*));
94 if (m_LogVol.psheet ==
nullptr)
97 (G4LogicalVolume**)malloc(m_GeoDat->getNSegments() *
98 sizeof(G4LogicalVolume*));
99 if (m_LogVol.segment ==
nullptr)
101 m_Solids.stripSegment =
102 (G4VSolid**)malloc(m_GeoDat->getNSegments() *
sizeof(G4VSolid*));
103 if (m_Solids.stripSegment ==
nullptr)
105 m_LogVol.stripSegment =
106 (G4LogicalVolume**)malloc(m_GeoDat->getNSegments() *
107 sizeof(G4LogicalVolume*));
108 if (m_LogVol.stripSegment ==
nullptr)
110 nDiff = m_GeoDat->getNStripsDifferentLength();
111 m_Solids.strip = (G4VSolid**)malloc(nDiff *
sizeof(G4VSolid*));
112 if (m_Solids.strip ==
nullptr)
114 m_LogVol.strip = (G4LogicalVolume**)malloc(nDiff *
sizeof(G4LogicalVolume*));
115 if (m_LogVol.strip ==
nullptr)
117 m_Solids.groove = (G4VSolid**)malloc(nDiff *
sizeof(G4VSolid*));
118 if (m_Solids.groove ==
nullptr)
120 m_LogVol.groove = (G4LogicalVolume**)malloc(nDiff *
sizeof(G4LogicalVolume*));
121 if (m_LogVol.groove ==
nullptr)
123 m_LogVol.scint = (G4LogicalVolume**)malloc(nDiff *
sizeof(G4LogicalVolume*));
124 if (m_LogVol.scint ==
nullptr)
126 m_LogVol.segmentsup =
127 (G4LogicalVolume***)malloc(m_GeoDat->getNPlanes() *
128 sizeof(G4LogicalVolume**));
129 if (m_LogVol.segmentsup ==
nullptr)
131 for (i = 0; i < m_GeoDat->getNPlanes(); i++) {
132 m_LogVol.segmentsup[i] =
133 (G4LogicalVolume**)malloc((m_GeoDat->getNSegments() + 1) *
134 sizeof(G4LogicalVolume*));
135 if (m_LogVol.segmentsup[i] ==
nullptr)
138 for (i = 0; i < m_GeoDat->getNSegments(); i++)
139 m_LogVol.psheet[i] =
nullptr;
147 }
catch (std::bad_alloc& ba) {
155 free(m_Solids.plane);
156 free(m_Solids.plasticSheetElement);
157 free(m_Solids.psheet);
158 free(m_LogVol.psheet);
159 free(m_LogVol.segment);
160 free(m_Solids.stripSegment);
161 free(m_LogVol.stripSegment);
162 free(m_Solids.strip);
163 free(m_LogVol.strip);
164 free(m_Solids.groove);
165 free(m_LogVol.groove);
166 free(m_LogVol.scint);
167 for (i = 0; i < m_GeoDat->getNPlanes(); i++)
168 free(m_LogVol.segmentsup[i]);
169 free(m_LogVol.segmentsup);
196 m_GeoDat->getEndcapStructureGeometry();
198 m_GeoDat->getSectionPosition();
199 const double z[2] = { -sectionPos->
getLength() / 2,
202 const double rMin[2] = {0, 0};
204 G4Polyhedra* op =
nullptr;
205 G4Tubs* tb =
nullptr;
207 op =
new G4Polyhedra(
"Section_Octagonal_Prism",
208 sectionStructureGeometry->
getPhi(),
212 }
catch (std::bad_alloc& ba) {
217 tb =
new G4Tubs(
"Section_Tube", 0, sectionPos->
getInnerR(),
218 sectionPos->
getLength() / 2.0 + 1.0 * CLHEP::mm,
219 0.0, 360.0 * CLHEP::deg);
220 }
catch (std::bad_alloc& ba) {
224 m_Solids.section =
new G4SubtractionSolid(
"Section", op, tb);
225 }
catch (std::bad_alloc& ba) {
233 G4LogicalVolume* logicLayer =
nullptr;
235 logicLayer =
new G4LogicalVolume(m_Solids.layer, m_Materials.air, name);
236 }
catch (std::bad_alloc& ba) {
249 layerPos->
getLength() / 2.0, 0.0, 360. * CLHEP::deg);
250 }
catch (std::bad_alloc& ba) {
258 G4LogicalVolume* logicSector =
nullptr;
260 logicSector =
new G4LogicalVolume(m_Solids.sector, m_Materials.air, name);
261 }
catch (std::bad_alloc& ba) {
271 m_GeoDat->getSectorPosition();
275 0.5 * sectorPos->
getLength(), 0.0, 90. * CLHEP::deg);
276 }
catch (std::bad_alloc& ba) {
284 HepGeom::Transform3D t1;
285 HepGeom::Transform3D t2;
286 G4Tubs* solidCoverTube =
nullptr;
287 G4Box* solidCoverBox =
nullptr;
288 G4Box* box =
nullptr;
289 G4IntersectionSolid* is =
nullptr;
290 G4SubtractionSolid* solidCover =
nullptr;
292 m_GeoDat->getSectorPosition();
294 m_GeoDat->getSectorSupportPosition();
296 m_GeoDat->getSectorSupportGeometry();
300 solidCoverTube =
new G4Tubs(
"Cover_Tube", sectorSupportPos->
getInnerR(),
301 sectorSupportPos->
getOuterR(), 0.5 * lz, 0.0,
303 }
catch (std::bad_alloc& ba) {
307 solidCoverBox =
new G4Box(
"Cover_Box", 0.5 * sectorSupportPos->
getOuterR(),
308 0.5 * sectorSupportPos->
getOuterR(), 0.5 * lz);
309 }
catch (std::bad_alloc& ba) {
313 box =
new G4Box(
"Cover_SubtractionBox", 0.5 * sectorSupportPos->
getOuterR(),
314 0.5 * sectorSupportPos->
getOuterR(), lz);
315 }
catch (std::bad_alloc& ba) {
318 t1 = HepGeom::Translate3D(
322 t2 = HepGeom::Translate3D(
323 sectorSupportPos->
getX() +
324 0.5 * sectorSupportPos->
getOuterR() * cos(ang) -
325 0.5 * sectorSupportPos->
getOuterR() * sin(ang),
328 0.5 * sectorSupportPos->
getOuterR() * cos(ang) +
329 0.5 * sectorSupportPos->
getOuterR() * sin(ang),
330 0.) * HepGeom::RotateZ3D(ang);
332 is =
new G4IntersectionSolid(
"Cover_Intersection",
333 solidCoverTube, solidCoverBox, t1);
334 }
catch (std::bad_alloc& ba) {
338 solidCover =
new G4SubtractionSolid(
"Cover", is, box, t2);
339 }
catch (std::bad_alloc& ba) {
344 new G4LogicalVolume(solidCover, m_Materials.duralumin,
"Cover");
345 }
catch (std::bad_alloc& ba) {
355 G4Box* res =
nullptr;
357 m_GeoDat->getSectorSupportPosition();
359 m_GeoDat->getSectorSupportGeometry();
361 sectorSupportPos->
getY() * sectorSupportPos->
getY());
362 t = HepGeom::Translate3D(0.5 * (x + sectorSupportGeometry->
getCorner3().x()),
363 sectorSupportPos->
getY() +
366 res =
new G4Box(
"SectorSupport_BoxX",
367 0.5 * (x - sectorSupportGeometry->
getCorner3().x()),
370 }
catch (std::bad_alloc& ba) {
378 G4Box* res =
nullptr;
380 m_GeoDat->getSectorSupportPosition();
382 m_GeoDat->getSectorSupportGeometry();
383 t = HepGeom::Translate3D(sectorSupportPos->
getX() +
385 0.5 * (sectorSupportGeometry->
getCorner4().y() +
387 0.) * HepGeom::RotateZ3D(90. * CLHEP::deg);
389 res =
new G4Box(
"SectorSupport_BoxY",
394 }
catch (std::bad_alloc& ba) {
404 G4Box* res =
nullptr;
406 m_GeoDat->getSectorSupportPosition();
408 m_GeoDat->getSectorSupportGeometry();
409 t = HepGeom::Translate3D(
418 0.) * HepGeom::RotateZ3D(sectorSupportGeometry->
getCornerAngle());
424 res =
new G4Box(
"SectorSupport_BoxTop", 0.5 * sqrt(dx * dx + dy * dy),
427 }
catch (std::bad_alloc& ba) {
437 G4Tubs* res =
nullptr;
439 m_GeoDat->getSectorSupportPosition();
441 m_GeoDat->getSectorSupportGeometry();
442 ang1 = atan2(sectorSupportGeometry->
getCorner3().y(),
444 ang2 = atan2(sectorSupportGeometry->
getCorner4().y(),
447 res =
new G4Tubs(
"SectorSupport_InnerTube", sectorSupportPos->
getInnerR(),
451 ang1 * CLHEP::rad, (ang2 - ang1) * CLHEP::rad);
452 }
catch (std::bad_alloc& ba) {
464 G4Tubs* res =
nullptr;
466 m_GeoDat->getSectorSupportPosition();
468 m_GeoDat->getSectorSupportGeometry();
470 x = sqrt(r * r - sectorSupportPos->
getY() * sectorSupportPos->
getY());
471 ang1 = atan2(sectorSupportPos->
getY(), x);
472 ang2 = atan2(sectorSupportGeometry->
getCorner1B().y(),
475 res =
new G4Tubs(
"SectorSupport_OuterTube", r,
478 ang1 * CLHEP::rad, (ang2 - ang1) * CLHEP::rad);
479 }
catch (std::bad_alloc& ba) {
489 G4Tubs* solidCorner1Tube =
nullptr;
490 G4Box* solidCorner1Box1 =
nullptr;
491 G4Box* solidCorner1Box2 =
nullptr;
492 G4IntersectionSolid* is1 =
nullptr;
493 G4IntersectionSolid* solidCorner1 =
nullptr;
494 HepGeom::Transform3D t1;
495 HepGeom::Transform3D t2;
497 m_GeoDat->getSectorSupportPosition();
499 m_GeoDat->getSectorSupportGeometry();
504 solidCorner1Tube =
new G4Tubs(
505 "SectorSupport_Corner1_Tube", 0.,
508 0., 90. * CLHEP::deg);
509 }
catch (std::bad_alloc& ba) {
513 solidCorner1Box1 =
new G4Box(
514 "SectorSupport_Corner1_Box1", 0.5 * lx,
517 }
catch (std::bad_alloc& ba) {
522 new G4Box(
"SectorSupport_Corner1_Box2",
528 }
catch (std::bad_alloc& ba) {
531 x = sectorSupportPos->
getX() + 0.5 * (sectorSupportGeometry->
getCornerX() +
534 t1 = HepGeom::Translate3D(x, 0.5 * sectorSupportPos->
getOuterR(), 0.);
535 t2 = HepGeom::Translate3D(
542 is1 =
new G4IntersectionSolid(
"SectorSupport_Corner1_Intersection1",
543 solidCorner1Tube, solidCorner1Box1, t1);
544 }
catch (std::bad_alloc& ba) {
548 solidCorner1 =
new G4IntersectionSolid(
"SectorSupport_Corner1", is1,
549 solidCorner1Box2, t2);
550 }
catch (std::bad_alloc& ba) {
554 m_LogVol.sectorsup.corn1 =
555 new G4LogicalVolume(solidCorner1, m_Materials.duralumin,
"Corner1");
556 }
catch (std::bad_alloc& ba) {
566 G4SubtractionSolid* solidCorner2 =
nullptr;
567 HepGeom::Transform3D t1;
569 m_GeoDat->getSectorSupportGeometry();
578 }
catch (std::bad_alloc& ba) {
581 t1 = HepGeom::Translate3D(-sectorSupportGeometry->
getCorner2Inner().x(),
584 solidCorner2 =
new G4SubtractionSolid(
"SectorSupport_Corner2",
586 m_Solids.sectorsup.otube, t1);
587 }
catch (std::bad_alloc& ba) {
590 delete solidCorner2Prism;
592 m_LogVol.sectorsup.corn2 =
593 new G4LogicalVolume(solidCorner2, m_Materials.duralumin,
"Corner2");
594 }
catch (std::bad_alloc& ba) {
604 G4SubtractionSolid* solidCorner3 =
nullptr;
605 HepGeom::Transform3D t1;
607 m_GeoDat->getSectorSupportGeometry();
615 }
catch (std::bad_alloc& ba) {
618 t1 = HepGeom::Translate3D(-sectorSupportGeometry->
getCorner3Prism().x(),
621 solidCorner3 =
new G4SubtractionSolid(
"SectorSupport_Corner3",
623 m_Solids.sectorsup.itube, t1);
624 }
catch (std::bad_alloc& ba) {
627 delete solidCorner3Prism;
629 m_LogVol.sectorsup.corn3 =
630 new G4LogicalVolume(solidCorner3, m_Materials.duralumin,
"Corner3");
631 }
catch (std::bad_alloc& ba) {
641 G4SubtractionSolid* solidCorner4 =
nullptr;
642 HepGeom::Transform3D t1;
644 m_GeoDat->getSectorSupportGeometry();
652 }
catch (std::bad_alloc& ba) {
655 t1 = HepGeom::Translate3D(-sectorSupportGeometry->
getCorner4Prism().x(),
658 solidCorner4 =
new G4SubtractionSolid(
"SectorSupport_Corner4",
660 m_Solids.sectorsup.itube, t1);
661 }
catch (std::bad_alloc& ba) {
664 delete solidCorner4Prism;
666 m_LogVol.sectorsup.corn4 =
667 new G4LogicalVolume(solidCorner4, m_Materials.duralumin,
"Corner4");
668 }
catch (std::bad_alloc& ba) {
680 G4Tubs* solidLimitationTube =
nullptr;
681 G4UnionSolid* us1 =
nullptr;
682 G4UnionSolid* us2 =
nullptr;
683 G4UnionSolid* us3 =
nullptr;
684 G4UnionSolid* us4 =
nullptr;
685 G4IntersectionSolid* solidSectorSupport =
nullptr;
686 HepGeom::Transform3D tbx;
687 HepGeom::Transform3D tby;
688 HepGeom::Transform3D tbt;
690 m_GeoDat->getSectorSupportPosition();
691 solidBoxX = createSectorSupportBoxX(tbx);
692 solidBoxY = createSectorSupportBoxY(tby);
693 solidBoxTop = createSectorSupportBoxTop(tbt);
694 m_Solids.sectorsup.otube = createSectorSupportOuterTube();
695 m_Solids.sectorsup.itube = createSectorSupportInnerTube();
697 solidLimitationTube =
new G4Tubs(
"SectorSupport_LimitationTube",
701 }
catch (std::bad_alloc& ba) {
705 us1 =
new G4UnionSolid(
"SectorSupport_Union1",
706 m_Solids.sectorsup.itube, solidBoxY, tby);
707 }
catch (std::bad_alloc& ba) {
711 us2 =
new G4UnionSolid(
"SectorSupport_Union2",
712 us1, solidBoxX, tbx);
713 }
catch (std::bad_alloc& ba) {
717 us3 =
new G4UnionSolid(
"SectorSupport_Union3", us2,
718 m_Solids.sectorsup.otube,
719 HepGeom::Translate3D(0., 0., 0.));
720 }
catch (std::bad_alloc& ba) {
724 us4 =
new G4UnionSolid(
"SectorSupport_Union4",
725 us3, solidBoxTop, tbt);
726 }
catch (std::bad_alloc& ba) {
731 new G4IntersectionSolid(
"SectorSupport", us4, solidLimitationTube,
732 HepGeom::Translate3D(0., 0., 0.));
733 }
catch (std::bad_alloc& ba) {
737 m_LogVol.sectorsup.supp =
738 new G4LogicalVolume(solidSectorSupport, m_Materials.duralumin,
"Support");
739 }
catch (std::bad_alloc& ba) {
750 m_GeoDat->getSectorSupportPosition();
752 m_Solids.subtractionBox =
753 new G4Box(
"SubractionBox", 0.5 * sectorSupportPos->
getOuterR(),
755 }
catch (std::bad_alloc& ba) {
762 HepGeom::Transform3D& transf,
bool largerAngles,
763 double x1,
double y1,
double x2,
double y2)
766 ang = atan2(y2 - y1, x2 - x1);
767 return cutSolidCorner(name, solid, subtractionBox, transf, largerAngles,
773 HepGeom::Transform3D& transf,
bool largerAngles,
774 double x,
double y,
double ang)
777 HepGeom::Transform3D t;
778 G4SubtractionSolid* ss =
nullptr;
779 lx = subtractionBox->GetXHalfLength();
780 ly = subtractionBox->GetYHalfLength();
782 t = HepGeom::Translate3D(x + lx * cos(ang) - ly * sin(ang),
783 y + lx * sin(ang) + ly * cos(ang), 0) *
784 HepGeom::RotateZ3D(ang);
786 t = HepGeom::Translate3D(x + lx * cos(ang) + ly * sin(ang),
787 y + lx * sin(ang) - ly * cos(ang), 0) *
788 HepGeom::RotateZ3D(ang);
790 ss =
new G4SubtractionSolid(name, solid, subtractionBox, transf * t);
791 }
catch (std::bad_alloc& ba) {
801 HepGeom::Transform3D t;
802 HepGeom::Transform3D t1;
804 G4Tubs* tb =
nullptr;
805 G4IntersectionSolid* is =
nullptr;
806 G4SubtractionSolid* ss1, *ss2, *ss3, *ss4;
808 m_GeoDat->getSectorSupportPosition();
810 m_GeoDat->getSectorSupportGeometry();
813 snprintf(name, 128,
"Plane_%d_Tube", n + 1);
816 0.5 * planePos->
getLength(), 0.0, 90.0 * CLHEP::deg);
817 }
catch (std::bad_alloc& ba) {
820 snprintf(name, 128,
"Plane_%d_Box", n + 1);
824 t1 = HepGeom::Translate3D(m_Solids.subtractionBox->GetXHalfLength() + box_x,
825 m_Solids.subtractionBox->GetXHalfLength() + box_y,
829 t = HepGeom::Rotate3D(180. * CLHEP::deg,
830 HepGeom::Vector3D<double>(1., 1., 0.));
833 t = HepGeom::Translate3D(0, 0, 0);
835 snprintf(name, 128,
"Plane_%d_Intersection", n + 1);
837 is =
new G4IntersectionSolid(name, tb, m_Solids.subtractionBox, t1);
838 }
catch (std::bad_alloc& ba) {
841 snprintf(name, 128,
"Plane_%d_Subtraction_1", n + 1);
842 ss1 = cutSolidCorner(name, is, m_Solids.subtractionBox, t,
true,
846 snprintf(name, 128,
"Plane_%d_Subtraction_2", n + 1);
847 ss2 = cutSolidCorner(
848 name, ss1, m_Solids.subtractionBox, t,
false,
855 snprintf(name, 128,
"Plane_%d_Subtraction_3", n + 1);
856 ss3 = cutSolidCorner(
857 name, ss2, m_Solids.subtractionBox, t,
false,
864 snprintf(name, 128,
"Plane_%d_Subtraction_4", n + 1);
865 ss4 = cutSolidCorner(
866 name, ss3, m_Solids.subtractionBox, t,
true,
873 snprintf(name, 128,
"Plane_%d", n + 1);
874 m_Solids.plane[n] = ss4;
880 HepGeom::Transform3D t1, t2;
881 G4Box* topBox =
nullptr;
882 G4Box* midBox =
nullptr;
883 G4Box* botBox =
nullptr;
884 G4UnionSolid* us =
nullptr;
885 G4UnionSolid* solidSegmentSupport =
nullptr;
886 std::string segmentSupportName =
887 "SegmentSupport_" + std::to_string(iSegmentSupport) +
888 "_Plane_" + std::to_string(iPlane);
890 m_GeoDat->getSegmentSupportPosition(iPlane, iSegmentSupport);
892 m_GeoDat->getSegmentSupportGeometry();
894 topBox =
new G4Box(
"BoxTop_" + segmentSupportName,
900 }
catch (std::bad_alloc& ba) {
904 midBox =
new G4Box(
"BoxMiddle_" + segmentSupportName,
910 }
catch (std::bad_alloc& ba) {
914 botBox =
new G4Box(
"BoxBottom_" + segmentSupportName,
918 }
catch (std::bad_alloc& ba) {
921 t1 = HepGeom::Translate3D(
924 t2 = HepGeom::Translate3D(
930 us =
new G4UnionSolid(
"Union1_" + segmentSupportName, midBox, topBox, t1);
931 }
catch (std::bad_alloc& ba) {
935 solidSegmentSupport =
new G4UnionSolid(segmentSupportName, us, botBox, t2);
936 }
catch (std::bad_alloc& ba) {
940 m_LogVol.segmentsup[iPlane - 1][iSegmentSupport - 1] =
941 new G4LogicalVolume(solidSegmentSupport, m_Materials.duralumin,
943 }
catch (std::bad_alloc& ba) {
954 int nSolids,
const std::string& name)
958 G4VSolid** solidArray;
959 HepGeom::Transform3D* inverseTransf;
960 HepGeom::Transform3D t;
963 int n, nUnions, i, i1, i2, k, k1, k2, l, dl;
965 B2FATAL(
"Number of solids to be unified must be greater than 1.");
967 inverseTransf =
new HepGeom::Transform3D[nSolids];
968 }
catch (std::bad_alloc& ba) {
971 for (i = 0; i < nSolids; i++)
972 inverseTransf[i] = transf[i].inverse();
980 nUnions = nUnions + n;
982 u = (G4UnionSolid**)malloc(
sizeof(G4UnionSolid*) * nUnions);
1000 for (i = i1; i < i2; i++) {
1003 t = inverseTransf[l] * transf[l + dl];
1005 snprintf(str, 128,
"_Union_%d", i + 1);
1006 u[i] =
new G4UnionSolid(name + str, solidArray[k],
1007 solidArray[k + 1], t);
1008 }
catch (std::bad_alloc& ba) {
1013 u[i] = (G4UnionSolid*)solids[k];
1018 solidArray = (G4VSolid**)u;
1023 d =
new G4DisplacedSolid(name +
"_Displaced", u[nUnions - 1], transf[0]);
1025 delete[] inverseTransf;
1035 G4VSolid** elements;
1036 HepGeom::Transform3D* t;
1038 m_GeoDat->getPlasticSheetGeometry();
1040 m_GeoDat->getStripGeometry();
1041 nStrip = m_ElementNumbers->getNStripsSegment();
1042 elements =
new G4VSolid*[nStrip];
1043 t =
new HepGeom::Transform3D[nStrip];
1045 for (i = 0; i < nStrip; i++) {
1046 m = nStrip * iSegment + i;
1047 m_GeoDat->getSheetTransform(&(t[i]), m);
1050 for (i = 0; i < nStrip; i++) {
1051 snprintf(name, 128,
"PlasticSheet_%d_Element_%d", iSegment + 1, i + 1);
1053 if (i == 0 || i == nStrip - 1)
1054 ly = ly - plasticSheetGeometry->
getDeltaL();
1055 m = nStrip * iSegment + i;
1057 m_GeoDat->getStripPosition(m + 1);
1059 m_Solids.plasticSheetElement[m] =
1060 new G4Box(name, 0.5 * stripPos->
getLength(), 0.5 * ly,
1061 0.5 * plasticSheetGeometry->
getWidth());
1062 }
catch (std::bad_alloc& ba) {
1065 elements[i] = m_Solids.plasticSheetElement[m];
1068 snprintf(name, 128,
"PlasticSheet_%d", iSegment + 1);
1069 m_Solids.psheet[iSegment] = unifySolids(elements, t, nStrip, name);
1071 m_LogVol.psheet[iSegment] =
1072 new G4LogicalVolume(m_Solids.psheet[iSegment],
1073 m_Materials.polystyrol, name);
1074 }
catch (std::bad_alloc& ba) {
1089 HepGeom::Transform3D* t;
1090 nStrip = m_ElementNumbers->getNStripsSegment();
1091 strips =
new G4VSolid*[nStrip];
1092 t =
new HepGeom::Transform3D[nStrip];
1093 for (i = 0; i < nStrip; i++) {
1094 m = nStrip * iSegment + i;
1095 m_GeoDat->getStripTransform(&(t[i]), m);
1096 strips[i] = m_Solids.strip[m_GeoDat->getStripLengthIndex(m)];
1098 snprintf(name, 128,
"StripSegment_%d", iSegment + 1);
1099 m_Solids.stripSegment[iSegment] = unifySolids(strips, t, nStrip, name);
1101 m_LogVol.stripSegment[iSegment] =
1102 new G4LogicalVolume(m_Solids.stripSegment[iSegment], m_Materials.air,
1104 }
catch (std::bad_alloc& ba) {
1117 G4UnionSolid* u1, *u2;
1118 HepGeom::Transform3D t;
1120 m_GeoDat->getPlasticSheetGeometry();
1122 m_GeoDat->getStripGeometry();
1124 snprintf(name, 128,
"Segment_%d_Union_1", iSegment + 1);
1125 t = HepGeom::Translate3D(0, 0, -z);
1127 u1 =
new G4UnionSolid(name, m_Solids.stripSegment[iSegment],
1128 m_Solids.psheet[iSegment], t);
1129 }
catch (std::bad_alloc& ba) {
1132 snprintf(name, 128,
"Segment_%d", iSegment + 1);
1133 t = HepGeom::Translate3D(0, 0, z);
1135 u2 =
new G4UnionSolid(name, u1, m_Solids.psheet[iSegment], t);
1136 }
catch (std::bad_alloc& ba) {
1140 m_LogVol.segment[iSegment] =
1141 new G4LogicalVolume(u2, m_Materials.air, name);
1142 }
catch (std::bad_alloc& ba) {
1155 m_GeoDat->getStripGeometry();
1156 iPos = m_GeoDat->getStripPositionIndex(iStrip);
1157 stripPos = m_GeoDat->getStripPosition(iPos + 1);
1158 snprintf(name, 128,
"Strip_%d", iStrip + 1);
1160 m_Solids.strip[iStrip] =
new G4Box(name, 0.5 * stripPos->
getLength(),
1163 }
catch (std::bad_alloc& ba) {
1167 m_LogVol.strip[iStrip] =
1168 new G4LogicalVolume(m_Solids.strip[iStrip], m_Materials.polystyrene,
1170 }
catch (std::bad_alloc& ba) {
1183 m_GeoDat->getStripGeometry();
1184 iPos = m_GeoDat->getStripPositionIndex(iStrip);
1185 stripPos = m_GeoDat->getStripPosition(iPos + 1);
1186 snprintf(name, 128,
"Groove_%d", iStrip + 1);
1188 m_Solids.groove[iStrip] =
new G4Box(name, 0.5 * stripPos->
getLength(),
1191 }
catch (std::bad_alloc& ba) {
1195 m_LogVol.groove[iStrip] =
1196 new G4LogicalVolume(m_Solids.groove[iStrip], m_Materials.gel, name);
1197 }
catch (std::bad_alloc& ba) {
1210 m_GeoDat->getStripGeometry();
1211 HepGeom::Transform3D t;
1213 G4SubtractionSolid* scintillatorSolid;
1214 iPos = m_GeoDat->getStripPositionIndex(iStrip);
1215 stripPos = m_GeoDat->getStripPosition(iPos + 1);
1216 snprintf(name, 128,
"StripSensitive_%d_Box", iStrip + 1);
1225 }
catch (std::bad_alloc& ba) {
1228 snprintf(name, 128,
"StripSensitive_%d", iStrip + 1);
1229 t = HepGeom::Translate3D(0., 0., 0.5 * (stripGeometry->
getThickness() -
1233 new G4SubtractionSolid(name, b, m_Solids.groove[iStrip], t);
1234 }
catch (std::bad_alloc& ba) {
1238 m_LogVol.scint[iStrip] =
1239 new G4LogicalVolume(scintillatorSolid, m_Materials.polystyrene,
1240 name, 0, m_Sensitive, 0);
1241 }
catch (std::bad_alloc& ba) {
1250 G4Box* box =
nullptr;
1251 G4SubtractionSolid* ss1, *ss2, *ss3, *solidDetailA;
1254 m_GeoDat->getShieldGeometry();
1257 HepGeom::Transform3D t = HepGeom::Translate3D(0, 0, 0);
1261 box =
new G4Box(
"ShieldDetailA_Box", lx, ly,
1263 }
catch (std::bad_alloc& ba) {
1266 ss1 = cutSolidCorner(
"ShieldDetailA_Subtraction_1", box,
1267 m_Solids.subtractionBox, t,
false,
1272 ss2 = cutSolidCorner(
"ShieldDetailA_Subtraction_2", ss1,
1273 m_Solids.subtractionBox, t,
true,
1278 ss3 = cutSolidCorner(
"ShieldDetailA_Subtraction_3", ss2,
1279 m_Solids.subtractionBox, t,
false,
1284 solidDetailA = cutSolidCorner(
"ShieldDetailA", ss3,
1285 m_Solids.subtractionBox, t,
false,
1291 m_LogVol.shield.detailA =
1292 new G4LogicalVolume(solidDetailA, m_Materials.polyethylene,
1294 }
catch (std::bad_alloc& ba) {
1303 G4Box* box =
nullptr;
1304 G4SubtractionSolid* ss1, *solidDetailB;
1307 m_GeoDat->getShieldGeometry();
1310 HepGeom::Transform3D t = HepGeom::Translate3D(0, 0, 0);
1314 box =
new G4Box(
"ShieldDetailB_Box", lx, ly,
1316 }
catch (std::bad_alloc& ba) {
1319 ss1 = cutSolidCorner(
"ShieldDetailB_Subtraction_1", box,
1320 m_Solids.subtractionBox, t,
false,
1325 solidDetailB = cutSolidCorner(
"ShieldDetailB", ss1,
1326 m_Solids.subtractionBox, t,
false,
1332 m_LogVol.shield.detailB =
1333 new G4LogicalVolume(solidDetailB, m_Materials.polyethylene,
1335 }
catch (std::bad_alloc& ba) {
1344 G4Box* box =
nullptr;
1345 G4SubtractionSolid* ss1, *ss2, *ss3, *solidDetailC;
1348 m_GeoDat->getShieldGeometry();
1351 HepGeom::Transform3D t = HepGeom::Translate3D(0, 0, 0);
1355 box =
new G4Box(
"ShieldDetailC_Box", lx, ly,
1357 }
catch (std::bad_alloc& ba) {
1360 ss1 = cutSolidCorner(
"ShieldDetailC_Subtraction_1", box,
1361 m_Solids.subtractionBox, t,
false,
1366 ss2 = cutSolidCorner(
"ShieldDetailC_Subtraction_2", ss1,
1367 m_Solids.subtractionBox, t,
true,
1372 ss3 = cutSolidCorner(
"ShieldDetailC_Subtraction_3", ss2,
1373 m_Solids.subtractionBox, t,
false,
1378 solidDetailC = cutSolidCorner(
"ShieldDetailC", ss3,
1379 m_Solids.subtractionBox, t,
false,
1385 m_LogVol.shield.detailC =
1386 new G4LogicalVolume(solidDetailC, m_Materials.polyethylene,
1388 }
catch (std::bad_alloc& ba) {
1399 m_GeoDat->getShieldGeometry();
1408 }
catch (std::bad_alloc& ba) {
1412 m_LogVol.shield.detailD =
1413 new G4LogicalVolume(solidDetailDPrism->
getSolid(),
1414 m_Materials.polyethylene,
"ShieldDetailD");
1415 }
catch (std::bad_alloc& ba) {
1420 delete solidDetailDPrism;
1426 HepGeom::Transform3D t;
1428 createSectionSolid();
1430 m_LogVol.shieldLayer = createLayerLogicalVolume(
"ShieldLayer");
1431 createSectorSolid();
1432 m_LogVol.shieldLayerSector = createSectorLogicalVolume(
"ShieldLayerSector");
1433 createSectorCoverLogicalVolume();
1434 createSectorSupportLogicalVolume();
1439 createSectorSupportCorner1LogicalVolume();
1440 createSectorSupportCorner2LogicalVolume();
1441 createSectorSupportCorner3LogicalVolume();
1442 createSectorSupportCorner4LogicalVolume();
1444 createSubtractionBoxSolid();
1445 for (i = 0; i < m_GeoDat->getNPlanes(); i++) {
1446 createPlaneSolid(i);
1448 for (j = 1; j <= m_GeoDat->getNSegments() + 1; j++)
1449 createSegmentSupportLogicalVolume(i + 1, j);
1452 n = m_GeoDat->getNStripsDifferentLength();
1453 for (i = 0; i < n; i++) {
1454 createStripLogicalVolume(i);
1455 createStripGrooveLogicalVolume(i);
1456 createScintillatorLogicalVolume(i);
1459 for (i = 0; i < m_GeoDat->getNSegments(); i++)
1460 createPlasticSheetLogicalVolume(i);
1462 for (i = 0; i < m_GeoDat->getNSegments(); i++)
1463 createStripSegmentLogicalVolume(i);
1465 for (i = 0; i < m_GeoDat->getNSegments(); i++)
1466 createSegmentLogicalVolume(i);
1468 createShieldDetailALogicalVolume();
1469 createShieldDetailBLogicalVolume();
1470 createShieldDetailCLogicalVolume();
1471 createShieldDetailDLogicalVolume();
1479 G4LogicalVolume* logicSection =
nullptr;
1480 const HepGeom::Transform3D* t;
1481 std::string sectionName =
"Section_" + std::to_string(m_CurVol.section);
1483 logicSection =
new G4LogicalVolume(m_Solids.section, m_Materials.iron,
1485 }
catch (std::bad_alloc& ba) {
1490 t = m_TransformData->getSectionTransform(m_CurVol.section);
1492 new G4PVPlacement(*t, logicSection, sectionName, topVolume,
false,
1493 m_CurVol.section,
false);
1494 }
catch (std::bad_alloc& ba) {
1497 return logicSection;
1503 G4LogicalVolume* logicLayer;
1504 const HepGeom::Transform3D* t;
1505 if (layer ==
nullptr) {
1506 std::string layerName =
"Layer_" + std::to_string(m_CurVol.layer) +
1507 "_" + section->GetName();
1508 logicLayer = createLayerLogicalVolume(layerName.c_str());
1511 t = m_TransformData->getLayerTransform(m_CurVol.section, m_CurVol.layer);
1513 new G4PVPlacement(*t, logicLayer, logicLayer->GetName(), section,
false,
1514 m_CurVol.layer,
false);
1515 }
catch (std::bad_alloc& ba) {
1524 G4LogicalVolume* logicSector;
1525 const HepGeom::Transform3D* t;
1526 if (sector ==
nullptr) {
1527 std::string sectorName =
"Sector_" + std::to_string(m_CurVol.sector) +
1528 "_" + layer->GetName();
1529 logicSector = createSectorLogicalVolume(sectorName.c_str());
1531 logicSector = sector;
1532 t = m_TransformData->getSectorTransform(m_CurVol.section, m_CurVol.layer,
1535 new G4PVPlacement(*t, logicSector, logicSector->GetName(), layer,
false,
1536 m_CurVol.sector,
false);
1537 }
catch (std::bad_alloc& ba) {
1547 HepGeom::Transform3D t;
1548 G4LogicalVolume* lv = m_LogVol.cover;
1550 m_GeoDat->getSectorPosition();
1552 m_GeoDat->getSectorSupportPosition();
1556 t = HepGeom::Translate3D(0., 0., z);
1558 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1560 }
catch (std::bad_alloc& ba) {
1568 HepGeom::Transform3D t;
1569 G4LogicalVolume* lv = m_LogVol.sectorsup.corn1;
1571 m_GeoDat->getSectorSupportGeometry();
1572 t = HepGeom::Translate3D(0., 0., sectorSupportGeometry->
getCorner1Z());
1574 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1576 }
catch (std::bad_alloc& ba) {
1584 HepGeom::Transform3D t;
1585 G4LogicalVolume* lv = m_LogVol.sectorsup.corn2;
1587 m_GeoDat->getSectorSupportGeometry();
1588 t = HepGeom::Translate3D(sectorSupportGeometry->
getCorner2Inner().x(),
1592 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1594 }
catch (std::bad_alloc& ba) {
1602 HepGeom::Transform3D t;
1603 G4LogicalVolume* lv = m_LogVol.sectorsup.corn3;
1605 m_GeoDat->getSectorSupportGeometry();
1606 t = HepGeom::Translate3D(sectorSupportGeometry->
getCorner3Prism().x(),
1610 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1612 }
catch (std::bad_alloc& ba) {
1620 HepGeom::Transform3D t;
1621 G4LogicalVolume* lv = m_LogVol.sectorsup.corn4;
1623 m_GeoDat->getSectorSupportGeometry();
1624 t = HepGeom::Translate3D(sectorSupportGeometry->
getCorner4Prism().x(),
1628 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1630 }
catch (std::bad_alloc& ba) {
1638 HepGeom::Transform3D t;
1639 G4LogicalVolume* lv = m_LogVol.sectorsup.supp;
1641 m_GeoDat->getSectorSupportPosition();
1642 t = HepGeom::Translate3D(0., 0., sectorSupportPos->
getZ());
1644 new G4PVPlacement(t, lv, lv->GetName() +
"_" + sector->GetName(), sector,
1646 }
catch (std::bad_alloc& ba) {
1654 G4LogicalVolume* logicPlane =
nullptr;
1655 const HepGeom::Transform3D* t;
1656 std::string planeName =
1657 "Plane_" + std::to_string(m_CurVol.plane) +
"_" + sector->GetName();
1659 logicPlane =
new G4LogicalVolume(m_Solids.plane[m_CurVol.plane - 1],
1660 m_Materials.air, planeName);
1661 }
catch (std::bad_alloc& ba) {
1665 t = m_TransformData->getPlaneTransform(m_CurVol.section, m_CurVol.layer,
1666 m_CurVol.sector, m_CurVol.plane);
1668 new G4PVPlacement(*t, logicPlane, planeName, sector,
false,
1669 m_CurVol.plane,
false);
1670 }
catch (std::bad_alloc& ba) {
1679 HepGeom::Transform3D t;
1680 G4LogicalVolume* lv =
1681 m_LogVol.segmentsup[m_CurVol.plane - 1][iSegmentSupport - 1];
1683 m_GeoDat->getSegmentSupportPosition(m_CurVol.plane, iSegmentSupport);
1684 t = (*m_TransformData->getPlaneDisplacement(m_CurVol.section, m_CurVol.layer,
1685 m_CurVol.sector, m_CurVol.plane)) *
1686 HepGeom::Translate3D(
1689 segmentSupportPos->
getX(), segmentSupportPos->
getY(),
1690 segmentSupportPos->
getZ()) *
1691 HepGeom::RotateX3D(180.0 * CLHEP::deg);
1693 new G4PVPlacement(t, lv, lv->GetName() +
"_" + plane->GetName(), plane,
1695 }
catch (std::bad_alloc& ba) {
1703 HepGeom::Transform3D t;
1705 m_GeoDat->getPlasticSheetGeometry();
1707 m_GeoDat->getStripGeometry();
1708 std::string sheetName =
1709 "Sheet_" + std::to_string(iSheet) +
1710 "_SheetPlane_" + std::to_string(iSheetPlane);
1712 if (iSheetPlane == 2)
1714 t = HepGeom::Translate3D(0, 0, z);
1716 new G4PVPlacement(t, m_LogVol.psheet[iSheet - 1], sheetName,
1717 m_LogVol.segment[iSheet - 1],
false, (iSheetPlane - 1) *
1718 m_GeoDat->getNSegments() + iSheet,
false);
1719 }
catch (std::bad_alloc& ba) {
1726 HepGeom::Transform3D t;
1727 std::string segmentName =
"StripSegment_" + std::to_string(iSegment);
1728 t = HepGeom::Translate3D(0, 0, 0);
1730 new G4PVPlacement(t, m_LogVol.stripSegment[iSegment - 1], segmentName,
1731 m_LogVol.segment[iSegment - 1],
false, iSegment,
false);
1732 }
catch (std::bad_alloc& ba) {
1739 HepGeom::Transform3D t;
1740 std::string segmentName =
1741 "Segment_" + std::to_string(m_CurVol.segment) +
"_" + plane->GetName();
1742 t = (*m_TransformData->getPlaneDisplacement(m_CurVol.section, m_CurVol.layer,
1743 m_CurVol.sector, m_CurVol.plane)) *
1744 (*m_TransformData->getSegmentTransform(
1745 m_CurVol.section, m_CurVol.layer, m_CurVol.sector, m_CurVol.plane,
1748 new G4PVPlacement(t, m_LogVol.segment[m_CurVol.segment - 1], segmentName,
1749 plane,
false, m_CurVol.segment,
false);
1750 }
catch (std::bad_alloc& ba) {
1758 HepGeom::Transform3D t, t2;
1759 G4LogicalVolume* lv;
1760 n = m_GeoDat->getStripLengthIndex(m_CurVol.strip - 1);
1761 m_GeoDat->getStripTransform(&t, m_CurVol.strip - 1);
1762 t2 = t * HepGeom::RotateX3D(180.0 * CLHEP::deg);
1763 lv = m_LogVol.strip[n];
1765 new G4PVPlacement(t2, lv, lv->GetName(), segment,
false, m_CurVol.strip,
1767 }
catch (std::bad_alloc& ba) {
1774 HepGeom::Transform3D t;
1775 G4LogicalVolume* lv;
1776 G4LogicalVolume* lvm;
1778 m_GeoDat->getStripGeometry();
1779 t = HepGeom::Translate3D(0., 0., 0.5 * (stripGeometry->
getThickness() -
1781 lvm = m_LogVol.strip[iStrip];
1782 lv = m_LogVol.groove[iStrip];
1784 new G4PVPlacement(t, lv, lv->GetName(), lvm,
false, 1,
false);
1785 }
catch (std::bad_alloc& ba) {
1792 HepGeom::Transform3D t;
1793 G4LogicalVolume* lv;
1794 G4LogicalVolume* lvm;
1795 t = HepGeom::Translate3D(0., 0., 0.);
1796 lvm = m_LogVol.strip[iStrip];
1797 lv = m_LogVol.scint[iStrip];
1799 new G4PVPlacement(t, lv, lv->GetName(), lvm,
false, 1,
false);
1800 }
catch (std::bad_alloc& ba) {
1807 HepGeom::Transform3D ta, tb, tc, td, te;
1808 G4LogicalVolume* lv;
1810 const double asqrt2 = 1.0 / sqrt(2.0);
1812 m_GeoDat->getShieldGeometry();
1817 HepGeom::RotateZ3D(-45.0 * CLHEP::deg);
1820 HepGeom::RotateZ3D(-45.0 * CLHEP::deg);
1823 HepGeom::RotateZ3D(-45.0 * CLHEP::deg) *
1824 HepGeom::RotateY3D(180.0 * CLHEP::deg);
1825 td = HepGeom::Translate3D(
1828 HepGeom::RotateZ3D(-45.0 * CLHEP::deg) *
1829 HepGeom::RotateX3D(180.0 * CLHEP::deg);
1830 te = HepGeom::Translate3D(
1833 HepGeom::RotateZ3D(135.0 * CLHEP::deg);
1834 lv = m_LogVol.shield.detailA;
1836 new G4PVPlacement(ta, lv, lv->GetName(), sector,
false, 1,
false);
1837 }
catch (std::bad_alloc& ba) {
1840 lv = m_LogVol.shield.detailB;
1842 new G4PVPlacement(tb, lv, lv->GetName(), sector,
false, 1,
false);
1843 }
catch (std::bad_alloc& ba) {
1846 lv = m_LogVol.shield.detailC;
1848 new G4PVPlacement(tc, lv, lv->GetName(), sector,
false, 1,
false);
1849 }
catch (std::bad_alloc& ba) {
1852 lv = m_LogVol.shield.detailD;
1854 new G4PVPlacement(td, lv, lv->GetName(), sector,
false, 1,
false);
1855 }
catch (std::bad_alloc& ba) {
1859 new G4PVPlacement(te, lv,
"ShieldDetailE", sector,
false, 1,
false);
1860 }
catch (std::bad_alloc& ba) {
1867 return ((section == 1 && layer <= m_GeoDat->getNDetectorLayers(1)) ||
1868 (section == 2 && layer <= m_GeoDat->getNDetectorLayers(2)));
1874 int i, j, imin, imax;
1876 G4LogicalVolume* section, *layer, *sector, *plane;
1880 for (i = 0; i < m_GeoDat->getNStripsDifferentLength(); i++) {
1881 createStripGroove(i);
1882 createScintillator(i);
1884 for (i = 0; i < m_GeoDat->getNSegments(); i++) {
1885 imin = i * m_ElementNumbers->getNStripsSegment();
1886 imax = (i + 1) * m_ElementNumbers->getNStripsSegment();
1887 for (m_CurVol.strip = imin + 1; m_CurVol.strip <= imax; m_CurVol.strip++)
1888 createStrip(m_LogVol.stripSegment[i]);
1890 for (i = 1; i <= m_GeoDat->getNSegments(); i++) {
1891 for (j = 1; j <= 2; j++)
1892 createPlasticSheet(j, i);
1893 createStripSegment(i);
1897 G4Region* aRegion =
new G4Region(
"EKLMEnvelope");
1898 for (m_CurVol.section = 1; m_CurVol.section <= m_GeoDat->getNSections();
1899 m_CurVol.section++) {
1900 section = createSection(&topVolume);
1902 section->SetRegion(aRegion);
1903 aRegion->AddRootLogicalVolume(section);
1904 for (m_CurVol.layer = 1; m_CurVol.layer <= m_GeoDat->getNLayers();
1906 if (detectorLayer(m_CurVol.section, m_CurVol.layer)) {
1908 layer = createLayer(section,
nullptr);
1909 for (m_CurVol.sector = 1; m_CurVol.sector <= m_GeoDat->getNSectors();
1910 m_CurVol.sector++) {
1911 sector = createSector(layer,
nullptr);
1912 createSectorSupport(sector);
1913 createSectorSupportCorner1(sector);
1914 createSectorSupportCorner2(sector);
1915 createSectorSupportCorner3(sector);
1916 createSectorSupportCorner4(sector);
1917 for (i = 1; i <= 2; i++)
1918 createSectorCover(i, sector);
1919 for (m_CurVol.plane = 1; m_CurVol.plane <= m_GeoDat->getNPlanes();
1921 plane = createPlane(sector);
1922 for (i = 1; i <= m_GeoDat->getNSegments() + 1; i++)
1923 createSegmentSupport(i, plane);
1924 for (m_CurVol.segment = 1;
1925 m_CurVol.segment <= m_GeoDat->getNSegments();
1927 createSegment(plane);
1932 layer = createLayer(section, m_LogVol.shieldLayer);
1933 for (m_CurVol.sector = 1; m_CurVol.sector <= m_GeoDat->getNSectors();
1935 createSector(layer, m_LogVol.shieldLayerSector);
1936 createSectorSupport(m_LogVol.shieldLayerSector);
1937 createSectorSupportCorner1(m_LogVol.shieldLayerSector);
1938 createSectorSupportCorner2(m_LogVol.shieldLayerSector);
1939 createSectorSupportCorner3(m_LogVol.shieldLayerSector);
1940 createSectorSupportCorner4(m_LogVol.shieldLayerSector);
1941 for (i = 1; i <= 2; i++)
1942 createSectorCover(i, m_LogVol.shieldLayerSector);
1943 createShield(m_LogVol.shieldLayerSector);
1950 G4LogicalVolume& topVolume,
1959 }
catch (std::bad_alloc& ba) {
1968 G4LogicalVolume& topVolume,
1977 }
catch (std::bad_alloc& ba) {
1993 }
catch (std::bad_alloc& ba) {
1996 m_GeoDat->saveToDatabase(iov);