Belle II Software  release-06-00-14
backward.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <ecl/geometry/GeoECLCreator.h>
9 #include "ecl/geometry/BelleLathe.h"
10 #include "ecl/geometry/BelleCrystal.h"
11 #include "G4LogicalVolume.hh"
12 #include "G4PVPlacement.hh"
13 #include <G4VisAttributes.hh>
14 #include <G4Box.hh>
15 #include <G4AssemblyVolume.hh>
16 #include <G4Region.hh>
17 #include <G4TwoVector.hh>
18 #include <G4PVReplica.hh>
19 #include "G4UserLimits.hh"
20 #include <G4Trap.hh>
21 
22 #include <iostream>
23 #include "CLHEP/Matrix/Vector.h"
24 #include "ecl/geometry/shapes.h"
25 #include <geometry/Materials.h>
26 
27 using namespace std;
28 using namespace Belle2;
29 using namespace Belle2::geometry;
30 
31 void Belle2::ECL::GeoECLCreator::backward(G4LogicalVolume& _top)
32 {
33  G4LogicalVolume* top = &_top;
34 
35  const bool sec = 0;
36  const double phi0 = 0;
37  const double dphi = sec ? M_PI / 16 : 2 * M_PI;
38 
39  const bool b_inner_support_ring = 1;
40  const bool b_outer_support_ring = 1;
41  const bool b_support_wall = 1;
42  const bool b_ribs = 1;
43  const bool b_septum_wall = 1;
44  const bool b_crystals = 1;
45  const bool b_preamplifier = 1;
46  const bool b_support_leg = 1;
47  const int overlap = m_overlap;
48 
49  int npoints = 1000 * 1000;
50 
51  // vector<cplacement_t> bp = load_placements("/ecl/data/crystal_placement_backward.dat");
52  vector<cplacement_t> bp = load_placements(m_sap, ECLParts::backward);
53  vector<cplacement_t>::iterator fp = find_if(bp.begin(), bp.end(), [](const cplacement_t& p) {
54  const int ECL_backward_part = 1000; // lookup part
55  return p.nshape == ECL_backward_part;
56  });
57  // global transformation before placing the whole backward part in the top logical volume
58  G4Transform3D gTrans = (fp == bp.end()) ? G4Translate3D(0, 0, -1020) : get_transform(*fp);
59  if (fp != bp.end()) bp.erase(fp); // now not needed
60 
61  if (b_inner_support_ring) {
62  zr_t vc1[] = {{0., 452.3 + 3}, {0., 452.3}, {3., 474.9 - 20 / cosd(27.81)}, {434., 702.27 - 20 / cosd(27.81)}, {434., 702.27}, {3., 474.9}, {3., 452.3 + 3}};
63  std::vector<zr_t> contour1(vc1, vc1 + sizeof(vc1) / sizeof(zr_t));
64  G4VSolid* part1solid = new BelleLathe("part1solid", phi0, dphi, contour1);
65  G4LogicalVolume* part1logical = new G4LogicalVolume(part1solid, Materials::get("SUS304"), "part1logical", 0, 0, 0);
66  part1logical->SetVisAttributes(att("iron"));
67  auto pv = new G4PVPlacement(gTrans * G4RotateY3D(M_PI), part1logical, "part1physical", top, false, 0, 0);
68  if (overlap) pv->CheckOverlaps(npoints);
69  }
70 
71  if (b_support_wall) {
72  // solving equation to get L : 3+L*cosd(52.90)+1.6*cosd(52.90+90) = 435 - 202.67
73  double L = (435 - 202.67 - 3 - 1.6 * cosd(52.90 + 90)) / cosd(52.90);
74  zr_t vc23[] = {{0, 452.3 + 3}, {3, 452.3 + 3}, {3, 1190.2}, {3 + L * cosd(52.90), 1190.2 + L * sind(52.90)},
75  {3 + L * cosd(52.90) + 1.6 * cosd(52.90 + 90), 1190.2 + L * sind(52.90) + 1.6 * sind(52.90 + 90)}, {3 + 1.6 * cosd(52.90 + 90), 1190.2 + 1.6 * sind(52.90 + 90)}, {0, 1190.2}
76  };
77  std::vector<zr_t> contour23(vc23, vc23 + sizeof(vc23) / sizeof(zr_t));
78  G4VSolid* part23solid = new BelleLathe("part23solid", phi0, dphi, contour23);
79  G4LogicalVolume* part23logical = new G4LogicalVolume(part23solid, Materials::get("A5052"), "part23logical", 0, 0, 0);
80  part23logical->SetVisAttributes(att("alum"));
81  auto pv = new G4PVPlacement(gTrans * G4RotateY3D(M_PI), part23logical, "part23physical", top, false, 0, 0);
82  if (overlap) pv->CheckOverlaps(npoints);
83  }
84 
85  if (b_outer_support_ring) {
86  zr_t vc4[] = {{434 - 214.8, 1496 - 20}, {434, 1496 - 20}, {434, 1496 - 5}, {434 + 5, 1496 - 5}, {434 + 5, 1496}, {434 - 199.66, 1496}};
87  std::vector<zr_t> contour4(vc4, vc4 + sizeof(vc4) / sizeof(zr_t));
88  G4VSolid* part4solid = new BelleLathe("part4solid", phi0, dphi, contour4);
89  G4LogicalVolume* part4logical = new G4LogicalVolume(part4solid, Materials::get("SUS304"), "part4logical", 0, 0, 0);
90  part4logical->SetVisAttributes(att("iron"));
91  auto pv = new G4PVPlacement(gTrans * G4RotateY3D(M_PI), part4logical, "part4physical", top, false, 0, 0);
92  if (overlap) pv->CheckOverlaps(npoints);
93  }
94 
95  zr_t cont_array_in[] = {{3., 474.9}, {434., 702.27}, {434, 1496 - 20}, {434 - 214.8, 1496 - 20}, {3, 1190.2}};
96  std::vector<zr_t> contour_in(cont_array_in, cont_array_in + sizeof(cont_array_in) / sizeof(zr_t));
97  G4VSolid* innervolume_solid = new BelleLathe("innervolume_solid", 0, 2 * M_PI, contour_in);
98  G4LogicalVolume* innervolume_logical = new G4LogicalVolume(innervolume_solid, Materials::get("G4_AIR"),
99  "innervolume_logical", 0, 0, 0);
100  innervolume_logical->SetVisAttributes(att("air"));
101 
102  // Set up region for production cuts
103  G4Region* aRegion = new G4Region("ECLBackwardEnvelope");
104  innervolume_logical->SetRegion(aRegion);
105  aRegion->AddRootLogicalVolume(innervolume_logical);
106 
107  auto gpvbp = new G4PVPlacement(gTrans * G4RotateY3D(M_PI),
108  innervolume_logical, "ECLBackwardPhysical",
109  top, false, 0, 0);
110  if (overlap) gpvbp->CheckOverlaps(npoints);
111 
112  G4VSolid* innervolumesector_solid = new BelleLathe("innervolumesector_solid", -M_PI / 8, M_PI / 4, contour_in);
113  G4LogicalVolume* innervolumesector_logical = new G4LogicalVolume(innervolumesector_solid, Materials::get("G4_AIR"),
114  "innervolumesector_logical", 0, 0, 0);
115  innervolumesector_logical->SetVisAttributes(att("air"));
116  new G4PVReplica("ECLBackwardSectorPhysical", innervolumesector_logical, innervolume_logical, kPhi, 8, M_PI / 4, 0);
117 
118  if (b_ribs) {
119  double H = 60, W = 20;
120  double X0 = 702.27 + 0.001, X1 = 1496 - 20;
121  G4TwoVector r0o(X1, 0), r1o(X1 * sqrt(1 - pow(W / X1, 2)), W);
122  double beta = asin(W / X0);
123  G4TwoVector r0i(X0 / cos(beta / 2), 0), r1i(X0 * cos(beta / 2) - tan(beta / 2) * (W - X0 * sin(beta / 2)), W);
124  double dxymzp = (r0o - r0i).x(), dxypzp = (r1o - r1i).x();
125  double theta = atan(tand(27.81) / 2);
126  double dxymzm = dxymzp + tand(27.81) * H, dxypzm = dxypzp + tand(27.81) * H;
127 
128  G4TwoVector m0 = (r0i + r0o) * 0.5, m1 = (r1i + r1o) * 0.5, dm = m1 - m0;
129  double alpha = atan(dm.x() / dm.y());
130 
131  G4VSolid* solid6_p1 = new G4Trap("solid6_p1", H / 2, theta, 0, W / 2, dxymzm / 2, dxypzm / 2, alpha, W / 2, dxymzp / 2, dxypzp / 2,
132  alpha);
133  G4LogicalVolume* lsolid6_p1 = new G4LogicalVolume(solid6_p1, Materials::get("SUS304"), "lsolid6", 0, 0, 0);
134  G4VisAttributes* asolid6 = new G4VisAttributes(G4Colour(1., 0.3, 0.2));
135  lsolid6_p1->SetVisAttributes(asolid6);
136  G4Transform3D tsolid6_p1(G4Translate3D(X0 * cos(beta / 2) + (dxymzp / 2 + dxypzp / 2) / 2 - tan(theta)*H / 2, W / 2, 434 - H / 2));
137  auto pv61 = new G4PVPlacement(G4RotateZ3D(-M_PI / 8)*tsolid6_p1, lsolid6_p1, "psolid6_p1", innervolumesector_logical, false, 0, 0);
138  if (overlap) pv61->CheckOverlaps(npoints);
139  auto pv62 = new G4PVPlacement(G4RotateZ3D(0)*tsolid6_p1, lsolid6_p1, "psolid6_p2", innervolumesector_logical, false, 0, 0);
140  if (overlap) pv62->CheckOverlaps(npoints);
141 
142  H = 40;
143  dxymzm = dxymzp + tand(27.81) * H, dxypzm = dxypzp + tand(27.81) * H;
144  G4VSolid* solid6_p2 = new G4Trap("solid6_p2", H / 2, theta, 0, W / 2, dxypzm / 2, dxymzm / 2, -alpha, W / 2, dxypzp / 2, dxymzp / 2,
145  -alpha);
146  G4LogicalVolume* lsolid6_p2 = new G4LogicalVolume(solid6_p2, Materials::get("SUS304"), "lsolid6", 0, 0, 0);
147  lsolid6_p2->SetVisAttributes(asolid6);
148  G4Transform3D tsolid6_p2(G4Translate3D(X0 * cos(beta / 2) + (dxymzp / 2 + dxypzp / 2) / 2 - tan(theta)*H / 2, -W / 2, 434 - H / 2));
149  auto pv63 = new G4PVPlacement(G4RotateZ3D(0)*tsolid6_p2, lsolid6_p2, "psolid6_p3", innervolumesector_logical, false, 0, 0);
150  if (overlap) pv63->CheckOverlaps(npoints);
151  auto pv64 = new G4PVPlacement(G4RotateZ3D(M_PI / 8)*tsolid6_p2, lsolid6_p2, "psolid6_p4", innervolumesector_logical, false, 0, 0);
152  if (overlap) pv64->CheckOverlaps(npoints);
153 
154  G4VSolid* solid7_p8 = new G4Box("solid7_p8", 171. / 2, (140. - 40) / 2 / 2, 40. / 2);
155  G4LogicalVolume* lsolid7 = new G4LogicalVolume(solid7_p8, Materials::get("SUS304"), "lsolid7", 0, 0, 0);
156  G4VisAttributes* asolid7 = new G4VisAttributes(G4Colour(1., 0.3, 0.2));
157  lsolid7->SetVisAttributes(asolid7);
158  double dx = sqrt(X1 * X1 - 70 * 70) - 171. / 2;
159  G4Transform3D tsolid7_p1(G4Translate3D(dx, -20 - 25, 434 - 40. / 2));
160  auto pv71 = new G4PVPlacement(tsolid7_p1, lsolid7, "psolid7_p1", innervolumesector_logical, false, 0, 0);
161  if (overlap) pv71->CheckOverlaps(npoints);
162  G4Transform3D tsolid7_p2(G4Translate3D(dx, 20 + 25, 434 - 40. / 2));
163  auto pv72 = new G4PVPlacement(tsolid7_p2, lsolid7, "psolid7_p2", innervolumesector_logical, false, 0, 0);
164  if (overlap) pv72->CheckOverlaps(npoints);
165 
166  double L = X1 - (X0 - tand(27.81) * 40) - 10;
167  G4VSolid* solid13 = new G4Box("solid13", L / 2, 5. / 2, 18. / 2);
168  G4LogicalVolume* lsolid13 = new G4LogicalVolume(solid13, Materials::get("SUS304"), "lsolid13", 0, 0, 0);
169  G4VisAttributes* asolid13 = new G4VisAttributes(G4Colour(1., 0.5, 0.5));
170  lsolid13->SetVisAttributes(asolid13);
171  G4Transform3D tsolid13(G4TranslateZ3D(434 - 60 + 18. / 2)*G4TranslateY3D(-5. / 2 - 0.5 / 2)*G4TranslateX3D(X0 - tand(
172  27.81) * 40 + L / 2 + 5));
173  auto pv131 = new G4PVPlacement(tsolid13, lsolid13, "psolid13_p1", innervolumesector_logical, false, 0, 0);
174  if (overlap) pv131->CheckOverlaps(npoints);
175  auto pv132 = new G4PVPlacement(G4RotateZ3D(M_PI / 8)*tsolid13, lsolid13, "psolid13_p2", innervolumesector_logical, false, 0, 0);
176  if (overlap) pv132->CheckOverlaps(npoints);
177  }
178 
179 
180  double zsep = 135;
181  if (b_septum_wall) {
182  double d = 5;
183  Point_t vin[] = {{434. - zsep, 702.27 - tand(27.81)* zsep}, {434. - 60, 702.27 - tand(27.81) * 60}, {434. - 60, 1496 - 20 - d}, {434. - zsep, 1496 - 20 - d}};
184  const int n = sizeof(vin) / sizeof(Point_t);
185  Point_t c = centerofgravity(vin, vin + n);
186  G4ThreeVector contour_swall[n * 2];
187  for (int i = 0; i < n; i++) contour_swall[i + 0] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, -0.5 / 2);
188  for (int i = 0; i < n; i++) contour_swall[i + n] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, 0.5 / 2);
189 
190  G4VSolid* septumwall_solid = new BelleCrystal("septumwall_solid", n, contour_swall);
191 
192  G4LogicalVolume* septumwall_logical = new G4LogicalVolume(septumwall_solid, Materials::get("A5052"),
193  "septumwall_logical", 0, 0, 0);
194  septumwall_logical->SetVisAttributes(att("alum2"));
195  auto pv = new G4PVPlacement(G4RotateZ3D(-M_PI / 2)*G4RotateY3D(-M_PI / 2)*G4Translate3D(c.x, c.y, 0), septumwall_logical,
196  "septumwall_physical", innervolumesector_logical, false, 0, 0);
197  if (overlap) pv->CheckOverlaps(npoints);
198 
199  for (int i = 0; i < n; i++) contour_swall[i + 0] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, -0.5 / 2 / 2);
200  for (int i = 0; i < n; i++) contour_swall[i + n] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, 0.5 / 2 / 2);
201 
202  G4VSolid* septumwall2_solid = new BelleCrystal("septumwall2_solid", n, contour_swall);
203 
204  G4LogicalVolume* septumwall2_logical = new G4LogicalVolume(septumwall2_solid, Materials::get("A5052"),
205  "septumwall2_logical", 0, 0, 0);
206  septumwall2_logical->SetVisAttributes(att("alum2"));
207  auto pv0 = new G4PVPlacement(G4RotateZ3D(-M_PI / 8)*G4RotateZ3D(-M_PI / 2)*G4RotateY3D(-M_PI / 2)*G4Translate3D(c.x, c.y,
208  0.5 / 2 / 2),
209  septumwall2_logical, "septumwall2_physical", innervolumesector_logical, false, 0, 0);
210  if (overlap) pv0->CheckOverlaps(npoints);
211  auto pv1 = new G4PVPlacement(G4RotateZ3D(M_PI / 8)*G4RotateZ3D(-M_PI / 2)*G4RotateY3D(-M_PI / 2)*G4Translate3D(c.x, c.y,
212  -0.5 / 2 / 2),
213  septumwall2_logical, "septumwall2_physical", innervolumesector_logical, false, 1, 0);
214  if (overlap) pv1->CheckOverlaps(npoints);
215  }
216 
217  zr_t vcr[] = {{3., 474.9}, {434. - zsep, 702.27 - tand(27.81)* zsep}, {434 - zsep, 1496 - 20}, {434 - 214.8, 1496 - 20}, {3, 1190.2}};
218  std::vector<zr_t> ccr(vcr, vcr + sizeof(vcr) / sizeof(zr_t));
219  G4VSolid* crystalvolume_solid = new BelleLathe("crystalvolume_solid", 0, M_PI / 8, ccr);
220  G4LogicalVolume* crystalvolume_logical = new G4LogicalVolume(crystalvolume_solid, Materials::get("G4_AIR"),
221  "crystalvolume_logical", 0, 0, 0);
222  crystalvolume_logical->SetVisAttributes(att("air"));
223  auto gpv0 = new G4PVPlacement(G4RotateZ3D(-M_PI / 8), crystalvolume_logical, "ECLBackwardCrystalSectorPhysical_0",
224  innervolumesector_logical,
225  false, 0, 0);
226  if (overlap) gpv0->CheckOverlaps(npoints);
227  auto gpv1 = new G4PVPlacement(G4RotateZ3D(0), crystalvolume_logical, "ECLBackwardCrystalSectorPhysical_1",
228  innervolumesector_logical, false, 1,
229  0);
230  if (overlap) gpv1->CheckOverlaps(npoints);
231 
232  if (b_septum_wall) {
233  double d = 5, dr = 0.001;
234  Point_t vin[] = {{3., 474.9}, {434. - zsep, 702.27 - tand(27.81)* zsep}, {434 - zsep, 1496 - 20 - d - dr}, {434 - 214.8 - d / tand(52.90), 1496 - 20 - d - dr}, {3, 1190.2 - dr}};
235  const int n = sizeof(vin) / sizeof(Point_t);
236  Point_t c = centerofgravity(vin, vin + n);
237  G4ThreeVector contour_swall[n * 2];
238 
239  for (int i = 0; i < n; i++) contour_swall[i + 0] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, -0.5 / 2 / 2);
240  for (int i = 0; i < n; i++) contour_swall[i + n] = G4ThreeVector(vin[i].x - c.x, vin[i].y - c.y, 0.5 / 2 / 2);
241 
242  G4VSolid* septumwall3_solid = new BelleCrystal("septumwall3_solid", n, contour_swall);
243 
244  G4LogicalVolume* septumwall3_logical = new G4LogicalVolume(septumwall3_solid, Materials::get("A5052"),
245  "septumwall3_logical", 0, 0, 0);
246  septumwall3_logical->SetVisAttributes(att("alum2"));
247  auto pv0 = new G4PVPlacement(G4RotateZ3D(-M_PI / 2)*G4RotateY3D(-M_PI / 2)*G4Translate3D(c.x, c.y, 0.5 / 2 / 2),
248  septumwall3_logical,
249  "septumwall3_physical_0", crystalvolume_logical, false, 0, overlap);
250  if (overlap) pv0->CheckOverlaps(npoints);
251  auto pv1 = new G4PVPlacement(G4RotateZ3D(M_PI / 8)*G4RotateZ3D(-M_PI / 2)*G4RotateY3D(-M_PI / 2)*G4Translate3D(c.x, c.y,
252  -0.5 / 2 / 2),
253  septumwall3_logical, "septumwall3_physical_1", crystalvolume_logical, false, 1, overlap);
254  if (overlap) pv1->CheckOverlaps(npoints);
255  }
256 
257  if (b_crystals) {
258  // vector<shape_t*> cryst = load_shapes("/ecl/data/crystal_shape_backward.dat");
259  vector<shape_t*> cryst = load_shapes(m_sap, ECLParts::backward);
260  vector<G4LogicalVolume*> wrapped_crystals;
261  for (auto it = cryst.begin(); it != cryst.end(); it++) {
262  shape_t* s = *it;
263  wrapped_crystals.push_back(wrapped_crystal(s, "backward", 0.20 - 0.02));
264  }
265  for (vector<cplacement_t>::const_iterator it = bp.begin(); it != bp.end(); ++it) {
266  const cplacement_t& t = *it;
267  auto s = find_if(cryst.begin(), cryst.end(), [&t](const shape_t* shape) {return shape->nshape == t.nshape;});
268  if (s == cryst.end()) continue;
269 
270  G4Transform3D twc = G4Translate3D(0, 0, 3) * get_transform(t);
271  int indx = it - bp.begin();
272  auto pv = new G4PVPlacement(twc, wrapped_crystals[s - cryst.begin()], suf("ECLBackwardWrappedCrystal_Physical", indx),
273  crystalvolume_logical,
274  false, (1152 + 6624) / 16 + indx, 0);
275  if (overlap)pv->CheckOverlaps(npoints);
276  }
277  }
278 
279  if (b_preamplifier) {
280  for (vector<cplacement_t>::const_iterator it = bp.begin(); it != bp.end(); ++it) {
281  G4Transform3D twc = G4Translate3D(0, 0, 3) * get_transform(*it);
282  int indx = it - bp.begin();
283  auto pv = new G4PVPlacement(twc * G4TranslateZ3D(300 / 2 + 0.20 + get_pa_box_height() / 2)*G4RotateZ3D(-M_PI / 2), get_preamp(),
284  suf("phys_backward_preamplifier", indx), crystalvolume_logical, false, (1152 + 6624) / 16 + indx, 0);
285  if (overlap)pv->CheckOverlaps(npoints);
286  }
287  }
288 
289  if (b_support_leg) {
290  const G4VisAttributes* batt = att("iron");
291 
292  G4VSolid* s1 = new G4Box("leg_p1", 130. / 2, 185. / 2, (40. - 5) / 2);
293  G4LogicalVolume* l1 = new G4LogicalVolume(s1, Materials::get("SUS304"), "l1", 0, 0, 0);
294  G4Transform3D t1 = G4Translate3D(0, 185. / 2, (40. - 5) / 2);
295  l1->SetVisAttributes(batt);
296 
297  Point_t v3[] = {{ -212. / 2, -135. / 2}, {212. / 2 - 30, -135. / 2}, {212. / 2, -135. / 2 + 30}, {212. / 2, 135. / 2} , { -212. / 2, 135. / 2}};
298  const int n3 = sizeof(v3) / sizeof(Point_t);
299  G4ThreeVector c3[n3 * 2];
300 
301  for (int i = 0; i < n3; i++) c3[i + 0] = G4ThreeVector(v3[i].x, v3[i].y, -60. / 2);
302  for (int i = 0; i < n3; i++) c3[i + n3] = G4ThreeVector(v3[i].x, v3[i].y, 60. / 2);
303 
304  G4VSolid* s3 = new BelleCrystal("leg_p3", n3, c3);
305  G4LogicalVolume* l3 = new G4LogicalVolume(s3, Materials::get("SUS304"), "l3", 0, 0, 0);
306  G4Transform3D t3 = G4Translate3D(0, 135. / 2 + 35, 40. - 5. + 212. / 2) * G4RotateY3D(-M_PI / 2);
307  l3->SetVisAttributes(batt);
308 
309  G4VSolid* s6 = new G4Box("leg_p6", 140. / 2, 189. / 2, 160. / 2);
310  G4LogicalVolume* l6 = new G4LogicalVolume(s6, Materials::get("G4_AIR"), "l6", 0, 0, 0);
311  G4Transform3D t6 = G4Translate3D(0, 170. + 189. / 2, 57. + 35. + 160. / 2);
312  l6->SetVisAttributes(att("air"));
313 
314  G4VSolid* s6a = new G4Box("leg_p6a", 140. / 2, (189. - 45.) / 2, 160. / 2);
315  G4LogicalVolume* l6a = new G4LogicalVolume(s6a, Materials::get("SUS304"), "l6a", 0, 0, 0);
316  l6a->SetVisAttributes(batt);
317  new G4PVPlacement(G4TranslateY3D(-45. / 2), l6a, "l6a_physical", l6, false, 0, overlap);
318 
319  G4VSolid* s6b = new G4Box("leg_p6b", 60. / 2, 45. / 2, 160. / 2);
320  G4LogicalVolume* l6b = new G4LogicalVolume(s6b, Materials::get("SUS304"), "l6b", 0, 0, 0);
321  l6b->SetVisAttributes(batt);
322  double dy = 189. / 2 - 45 + 45. / 2;
323  new G4PVPlacement(G4TranslateY3D(dy), l6b, "l6b_physical", l6, false, 0, overlap);
324 
325  G4VSolid* s6c = new G4Box("leg_p6c", 40. / 2, 45. / 2, 22.5 / 2);
326  G4LogicalVolume* l6c = new G4LogicalVolume(s6c, Materials::get("SUS304"), "l6c", 0, 0, 0);
327  l6c->SetVisAttributes(batt);
328  new G4PVPlacement(G4Translate3D(30 + 20, dy, 20 + 22.5 / 2), l6c, "l6c_physical", l6, false, 0, overlap);
329  new G4PVPlacement(G4Translate3D(30 + 20, dy, -20 - 22.5 / 2), l6c, "l6c_physical", l6, false, 1, overlap);
330  new G4PVPlacement(G4Translate3D(-30 - 20, dy, 20 + 22.5 / 2), l6c, "l6c_physical", l6, false, 2, overlap);
331  new G4PVPlacement(G4Translate3D(-30 - 20, dy, -20 - 22.5 / 2), l6c, "l6c_physical", l6, false, 3, overlap);
332 
333  G4AssemblyVolume* support_leg = new G4AssemblyVolume();
334 
335  support_leg->AddPlacedVolume(l1, t1);
336  // support_leg->AddPlacedVolume(l2,t2);
337  support_leg->AddPlacedVolume(l3, t3);
338  // support_leg->AddPlacedVolume(l4,t4);
339  // support_leg->AddPlacedVolume(l5,t5);
340  support_leg->AddPlacedVolume(l6, t6);
341 
342  G4VSolid* s_all = new G4Box("leg_all", 140. / 2, 359. / 2, (257. - 5.) / 2);
343  G4LogicalVolume* l_all = new G4LogicalVolume(s_all, Materials::get("G4_AIR"), "l_all", 0, 0, 0);
344  l_all->SetVisAttributes(att("air"));
345  G4Transform3D tp = G4Translate3D(0, -359. / 2, -(257. - 5.) / 2);
346  support_leg->MakeImprint(l_all, tp, 0, overlap);
347 
348 
349  for (int i = 0; i < 8; i++)
350  new G4PVPlacement(gTrans * G4RotateX3D(M_PI)*G4RotateZ3D(-M_PI / 2 + M_PI / 8 + i * M_PI / 4)*G4Translate3D(0,
351  1496 - 185 + 359. / 2,
352  434 + 5 + (257. - 5.) / 2), l_all, "lall_physical", top, false, i, overlap);
353 
354 
355  G4VSolid* s1a = new G4Box("leg_p1a", 130. / 2, 178. / 2, 5. / 2);
356  G4LogicalVolume* l1a = new G4LogicalVolume(s1a, Materials::get("SUS304"), "l1a", 0, 0, 0);
357  l1a->SetVisAttributes(batt);
358  for (int i = 0; i < 8; i++)
359  new G4PVPlacement(gTrans * G4RotateX3D(M_PI)*G4RotateZ3D(-M_PI / 2 + M_PI / 8 + i * M_PI / 4)*G4Translate3D(0,
360  1496 - 185 + 178. / 2,
361  434 + 5 - 5. / 2), l1a, "l1a_physical", top, false, i, overlap);
362 
363  }
364 
365 }
a Belle crystal in Geant4
Definition: BelleCrystal.h:34
void backward(G4LogicalVolume &)
Place elements inside the backward endcap.
Definition: backward.cc:31
Common code concerning the geometry representation of the detector.
Definition: CreatorBase.h:25
Abstract base class for different kinds of events.