Create the PH1BPIPE geometry.
58 {
59
61
62
63 double pillar_height = 61.9 * CLHEP::cm / 2.;
64 double pillar_length = 3. * CLHEP::cm;
65 double pillar_width = pillar_length;
66 G4VSolid* s_bppillar = new G4Box("s_bppillar", pillar_length, pillar_height, pillar_width);
68 G4VisAttributes* white = new G4VisAttributes(G4Colour(1, 1, 1));
69 white->SetForceAuxEdgeVisible(true);
70 l_bppillar->SetVisAttributes(white);
71 double y_offset = -76. * CLHEP::cm + pillar_height;
72 G4ThreeVector Pillarpos = G4ThreeVector(0, y_offset, -154.0 * CLHEP::cm);
73 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar1", &topVolume, false, 1);
74 Pillarpos = G4ThreeVector(0, y_offset, 154.0 * CLHEP::cm);
75 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar2", &topVolume, false, 1);
76 Pillarpos = G4ThreeVector(11.4175236299 * CLHEP::cm, y_offset, -227.758203051 * CLHEP::cm);
77 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar3", &topVolume, false, 1);
78 Pillarpos = G4ThreeVector(-10.4976636985 * CLHEP::cm, y_offset, 227.758203051 * CLHEP::cm);
79 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar4", &topVolume, false, 1);
80 Pillarpos = G4ThreeVector(-8.71250756316 * CLHEP::cm, y_offset, -209.819190072 * CLHEP::cm);
81 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar5", &topVolume, false, 1);
82 Pillarpos = G4ThreeVector(8.71248973173 * CLHEP::cm, y_offset, 209.819190072 * CLHEP::cm);
83 new G4PVPlacement(0, Pillarpos, l_bppillar, "p_bppilar6", &topVolume, false, 1);
84
85
86 double x_reih = 2. * CLHEP::cm / 2.;
87 double y_reih = 2.3 * CLHEP::cm / 2.;
88 double z_reih = 48. * CLHEP::cm / 2.;
89 G4VSolid* s_reih = new G4Box("s_reih", x_reih, y_reih, z_reih);
91 l_reih->SetVisAttributes(white);
92 G4ThreeVector Reihpos = G4ThreeVector(72.8780869619 * CLHEP::mm, 0, 1.35841468498 * CLHEP::mm);
93 new G4PVPlacement(0, Reihpos, l_reih, "p_Reih1", &topVolume, false, 1);
94 Reihpos = G4ThreeVector(-72.8780869619 * CLHEP::mm, 0, 1.35841468498 * CLHEP::mm);
95 new G4PVPlacement(0, Reihpos, l_reih, "p_Reih2", &topVolume, false, 1);
96
97 double x_reiv = 2. * CLHEP::cm / 2.;
98 double y_reiv = 5.2 * CLHEP::cm / 2.;
99 double z_reiv = 140. * CLHEP::cm / 2.;
100 G4VSolid* s_reiv = new G4Box("s_reiv", x_reiv, y_reiv, z_reiv);
102 l_reiv->SetVisAttributes(white);
103
104 G4ThreeVector Reivpos = G4ThreeVector(0, -83.0 * CLHEP::mm, 0);
105 new G4PVPlacement(0, Reivpos, l_reiv, "p_Reiv1", &topVolume, false, 1);
106
107 Reivpos = G4ThreeVector(0, 83.0 * CLHEP::mm, 0);
108 new G4PVPlacement(0, Reivpos, l_reiv, "p_Reiv2", &topVolume, false, 1);
109
110
111
112
113
114
115
116
117
118
119 double stepSize = content.getLength("stepSize", 5 * CLHEP::um);
120
121
122
123
124
125
126
127 double SafetyLength = 0.1 * CLHEP ::cm;
128
129 double xpipe_hz1 = content.getLength("xpipe_hz1") * CLHEP::cm;
130 double pipe_hz = content.getLength("pipe_hz") * CLHEP::cm;
131 double pipe_outerRadius_x = content.getLength("pipe_outerRadius_x") * CLHEP::cm;
132 double pipe_outerRadius_y = content.getLength("pipe_outerRadius_y") * CLHEP::cm;
133 double pipe_innerRadius_x = content.getLength("pipe_innerRadius_x") * CLHEP::cm;
134 double pipe_innerRadius_y = content.getLength("pipe_innerRadius_y") * CLHEP::cm;
135 double xpipe_innerRadius = content.getLength("xpipe_innerRadius") * CLHEP::cm;
136 double xpipe_outerRadius = content.getLength("xpipe_outerRadius") * CLHEP::cm;
137 double pipe_innerRadiusTiN_x = content.getLength("pipe_innerRadiusTiN_x") * CLHEP::cm;
138 double pipe_innerRadiusTiN_y = content.getLength("pipe_innerRadiusTiN_y") * CLHEP::cm;
139 double xpipe_innerRadiusTiN = content.getLength("xpipe_innerRadiusTiN") * CLHEP::cm;
140 double endcap_hz = content.getLength("endcap_hz") * CLHEP::cm;
141 double endcap_outerRadius = content.getLength("endcap_outerRadius") * CLHEP::cm;
142 double xpipePOS_hz = content.getLength("xpipePOS_hz") * CLHEP::cm;
143 double xpipeMIN_hz = content.getLength("xpipeMIN_hz") * CLHEP::cm;
144
145
146 double startAngle = 0.*CLHEP::deg;
147 double spanningAngle = 360.*CLHEP::deg;
148 double A1 = 0.0415 * CLHEP::rad;
149
150 double OBtemp =
sqrt(pow(xpipe_hz1, 2) + pow(xpipe_innerRadius / 2., 2));
151
152 double BCtemp = OBtemp * sin(A1);
153
154 double ABtemp =
sqrt(pow(pipe_hz, 2) + pow(OBtemp, 2) - 2 * pipe_hz * OBtemp * cos(A1));
155
156 double A2 = asin(BCtemp / ABtemp) * CLHEP::rad;
157
158 double xpipe_hz = ABtemp - 2 * endcap_hz / cos(A2);
159
160 double xcont2 = BCtemp + xpipe_outerRadius;
161 double xcont1 = xpipe_outerRadius + 2 * endcap_hz * tan(A2);
162 double xcont3 = xcont2 + xpipePOS_hz * sin(A1);
163 double xcont4 = xcont3 - 2 * xpipe_outerRadius;
164 double xcont5 = xcont2 - 2 * xpipe_outerRadius;
165 double xcont3M = xcont2 + xpipeMIN_hz * sin(A1);
166 double xcont4M = xcont3M - 2 * xpipe_outerRadius;
167
168
169
170 double dxtr = 0.5 * (ABtemp + 2 * endcap_hz / cos(A2)) * sin(2 * A2);
171 double dztr = (ABtemp + 2 * endcap_hz / cos(A2)) * sin(A2) * sin(A2);
172
173
174 string matPipe = content.getString("MaterialPipe");
175 string matTiN = content.getString("MaterialTiN");
176 string vacPipe = content.getString("MatVacuum");
177 G4double tubinR = 0.0 * CLHEP::cm;
178
179 G4VSolid* s_PH1BPIPE = new G4EllipticalTube("s_PH1BPIPE",
180 pipe_outerRadius_x,
181 pipe_outerRadius_y,
182 pipe_hz);
183 G4LogicalVolume* l_PH1BPIPE =
new G4LogicalVolume(s_PH1BPIPE,
geometry::Materials::get(matPipe),
"l_PH1BPIPE", 0, 0);
184
185 l_PH1BPIPE->SetUserLimits(new G4UserLimits(stepSize));
186
187 G4ThreeVector PH1BPIPEpos = G4ThreeVector(
188 content.getLength("x_ph1bpipe") * CLHEP::cm,
189 content.getLength("y_ph1bpipe") * CLHEP::cm,
190 content.getLength("z_ph1bpipe") * CLHEP::cm
191 );
192 new G4PVPlacement(0, PH1BPIPEpos, l_PH1BPIPE, "p_PH1BPIPE", &topVolume, false, 0);
193
194 G4VSolid* s_PH1BPIPETiN = new G4EllipticalTube("s_PH1BPIPETiN",
195 pipe_innerRadius_x,
196 pipe_innerRadius_y,
197 pipe_hz);
198 G4LogicalVolume* l_PH1BPIPETiN =
new G4LogicalVolume(s_PH1BPIPETiN,
geometry::Materials::get(matTiN),
"l_PH1BPIPETiN", 0, 0);
199 new G4PVPlacement(0, PH1BPIPEpos, l_PH1BPIPETiN, "p_PH1BPIPETiN", l_PH1BPIPE, false, 0);
200
201 G4VSolid* s_PH1BPIPEV = new G4EllipticalTube("s_PH1BPIPEV",
202 pipe_innerRadiusTiN_x,
203 pipe_innerRadiusTiN_y,
204 pipe_hz);
205 G4VSolid* s_PH1BPIPEVac = new G4IntersectionSolid("s_PH1BPIPEVac", s_PH1BPIPE, s_PH1BPIPEV);
206 G4LogicalVolume* l_PH1BPIPEVac =
new G4LogicalVolume(s_PH1BPIPEVac,
geometry::Materials::get(vacPipe),
"l_PH1BPIPEVac", 0, 0);
207
208 new G4PVPlacement(0, PH1BPIPEpos, l_PH1BPIPEVac, "p_PH1BPIPEVac", l_PH1BPIPETiN, false, 0);
209
210
211 G4VSolid* s_PH1BPIPEendcap = new G4Tubs("s_PH1BPIPEendcap", 0.,
212 endcap_outerRadius,
213 endcap_hz,
214 startAngle, spanningAngle);
216 "l_PH1BPIPEendcapTop", 0, 0);
218 "l_PH1BPIPEendcapBot", 0, 0);
219
220 G4ThreeVector PH1BPIPEendcapposTop = G4ThreeVector(
221 content.getLength("x_ph1bpipe") * CLHEP::cm,
222 content.getLength("y_ph1bpipe") * CLHEP::cm,
223 content.getLength("z_ph1bpipe") * CLHEP::cm + pipe_hz + endcap_hz
224 );
225
226 G4ThreeVector PH1BPIPEendcapposBot = G4ThreeVector(
227 content.getLength("x_ph1bpipe") * CLHEP::cm,
228 content.getLength("y_ph1bpipe") * CLHEP::cm,
229 content.getLength("z_ph1bpipe") * CLHEP::cm - pipe_hz - endcap_hz
230 );
231 new G4PVPlacement(0, PH1BPIPEendcapposTop, l_PH1BPIPEendcapTop, "p_PH1BPIPEendcapTop", &topVolume, false, 0);
232 new G4PVPlacement(0, PH1BPIPEendcapposBot, l_PH1BPIPEendcapBot, "p_PH1BPIPEendcapBot", &topVolume, false, 0);
233
234 G4VSolid* s_PH1BPIPEendcapTiN = new G4EllipticalTube("s_PH1BPIPEendcapTiN",
235 pipe_innerRadius_x,
236 pipe_innerRadius_y,
237 endcap_hz);
238 G4LogicalVolume* l_PH1BPIPEendcapTiNTop =
new G4LogicalVolume(s_PH1BPIPEendcapTiN,
geometry::Materials::get(matTiN),
239 "l_PH1BPIPEendcapTiNTop", 0, 0);
240 G4LogicalVolume* l_PH1BPIPEendcapTiNBot =
new G4LogicalVolume(s_PH1BPIPEendcapTiN,
geometry::Materials::get(matTiN),
241 "l_PH1BPIPEendcapTiNBot", 0, 0);
242 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_PH1BPIPEendcapTiNTop, "p_PH1BPIPEendcapTiNTop", l_PH1BPIPEendcapTop, false, 0);
243 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_PH1BPIPEendcapTiNBot, "p_PH1BPIPEendcapTiNBot", l_PH1BPIPEendcapBot, false, 0);
244
245 G4VSolid* s_PH1BPIPEendcapV = new G4EllipticalTube("s_PH1BPIPEendcapV",
246 pipe_innerRadiusTiN_x,
247 pipe_innerRadiusTiN_y,
248 endcap_hz);
249 G4VSolid* s_PH1BPIPEendcapVac = new G4IntersectionSolid("s_PH1BPIPEendcapVac", s_PH1BPIPEendcap, s_PH1BPIPEendcapV);
251 "l_PH1BPIPEendcapVac", 0, 0);
252
253 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_PH1BPIPEendcapVac, "p_PH1BPIPEendcapVacTop", l_PH1BPIPEendcapTiNTop, false, 0);
254 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_PH1BPIPEendcapVac, "p_PH1BPIPEendcapVacBot", l_PH1BPIPEendcapTiNBot, false, 0);
255
256
257
258 G4VSolid* AluCont_f = new G4Trd("AluCont_f", xcont1, xcont2, xcont1, xcont1, xpipe_hz / 2.0 * cos(A2));
259 G4LogicalVolume* logi_AluCont_f =
new G4LogicalVolume(AluCont_f,
geometry::Materials::get(matPipe),
"logi_AluCont_f", 0, 0);
260 new G4PVPlacement(0, G4ThreeVector(0, 0, pipe_hz + endcap_hz * 2.0 + 0.5 * xpipe_hz * cos(A2)),
261 logi_AluCont_f, "phys_AluCont_f", &topVolume, false, 0);
262
263
264
265
266 G4VSolid* s_Xshapef_11 = new G4Tubs("s_Xshapef_11",
267 tubinR,
268 xpipe_innerRadius,
269 xpipe_hz,
270 startAngle, spanningAngle);
271 G4VSolid* s_Xshapef_12 = new G4Tubs("s_Xshapef_12",
272 tubinR,
273 xpipe_innerRadius * 2.0,
274 xpipe_hz / 2.0,
275 startAngle, spanningAngle);
276 G4VSolid* s_Xshapef_21 = new G4Tubs("s_Xshapef_21",
277 tubinR,
278 xpipe_innerRadiusTiN,
279 xpipe_hz,
280 startAngle, spanningAngle);
281 G4VSolid* s_Xshapef_22 = new G4Tubs("s_Xshapef_22",
282 tubinR,
283 xpipe_innerRadiusTiN * 2.0,
284 xpipe_hz / 2.0,
285 startAngle, spanningAngle);
286
287
288 G4VSolid* s_XshapefTiN_11 = new G4Tubs("s_XshapefTiN_11",
289 tubinR,
290 xpipe_innerRadius,
291 xpipe_hz,
292 startAngle, spanningAngle);
293 G4VSolid* s_XshapefTiN_12 = new G4Tubs("s_XshapefTiN_12",
294 tubinR,
295 xpipe_innerRadius * 2.0,
296 xpipe_hz / 2.0,
297 startAngle, spanningAngle);
298 G4VSolid* s_XshapefTiN_21 = new G4Tubs("s_XshapefTiN_21",
299 tubinR,
300 xpipe_innerRadius,
301 xpipe_hz,
302 startAngle, spanningAngle);
303 G4VSolid* s_XshapefTiN_22 = new G4Tubs("s_XshapefTiN_22",
304 tubinR,
305 xpipe_innerRadius * 2.0,
306 xpipe_hz / 2.0,
307 startAngle, spanningAngle);
308
309 G4Transform3D transform_sXshapef_12 = G4Translate3D(0., 0., 0.);
310 transform_sXshapef_12 = transform_sXshapef_12 * G4RotateY3D(-A2);
311 G4IntersectionSolid* Xshapef1 = new G4IntersectionSolid("Xshapef1", s_Xshapef_11, s_Xshapef_12, transform_sXshapef_12);
312
313 G4Transform3D transform_sXshapef_22 = G4Translate3D(0., 0., 0.);
314 transform_sXshapef_22 = transform_sXshapef_22 * G4RotateY3D(A2);
315 G4IntersectionSolid* Xshapef2 = new G4IntersectionSolid("Xshapef2", s_Xshapef_21, s_Xshapef_22, transform_sXshapef_22);
316
317 G4Transform3D transform_sXshapefTiN_12 = G4Translate3D(0., 0., 0.);
318 transform_sXshapefTiN_12 = transform_sXshapefTiN_12 * G4RotateY3D(-A2);
319 G4IntersectionSolid* XshapefTiN1 = new G4IntersectionSolid("XshapefTiN1", s_XshapefTiN_11, s_XshapefTiN_12,
320 transform_sXshapefTiN_12);
321
322 G4Transform3D transform_sXshapefTiN_22 = G4Translate3D(0., 0., 0.);
323 transform_sXshapefTiN_22 = transform_sXshapefTiN_22 * G4RotateY3D(A2);
324 G4IntersectionSolid* XshapefTiN2 = new G4IntersectionSolid("XshapefTiN2", s_XshapefTiN_21, s_XshapefTiN_22,
325 transform_sXshapefTiN_22);
326
327
328 G4Transform3D transform_XshapefTiN1 = G4Translate3D(dxtr, 0., -dztr);
329 transform_XshapefTiN1 = transform_XshapefTiN1 * G4RotateY3D(2.*A2);
330 G4UnionSolid* XshapeTiNForwx = new G4UnionSolid("XshapeTiNForwx", XshapefTiN2, XshapefTiN1, transform_XshapefTiN1);
331
332 G4RotationMatrix* yRot = new G4RotationMatrix;
333 yRot->rotateY(A2);
334 G4ThreeVector transform_XshapeTiNForwx(-dxtr / 2., 0., 0.);
335 G4IntersectionSolid* XshapeTiNForw = new G4IntersectionSolid("XshapeTiNForw", AluCont_f, XshapeTiNForwx, yRot,
336 transform_XshapeTiNForwx);
337 G4LogicalVolume* l_XshapeTiNForw =
new G4LogicalVolume(XshapeTiNForw,
geometry::Materials::get(matTiN),
"l_XshapeTiNForw", 0, 0);
338 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapeTiNForw, "p_XshapeTiNForw", logi_AluCont_f, false, 0);
339
340
341 G4Transform3D transform_Xshapef1 = G4Translate3D(dxtr, 0., -dztr);
342 transform_Xshapef1 = transform_Xshapef1 * G4RotateY3D(2.*A2);
343 G4UnionSolid* XshapeForwx = new G4UnionSolid("XshapeForwx", Xshapef2, Xshapef1, transform_Xshapef1);
344
345 G4Transform3D transform_XshapeForwx = G4Translate3D(-dxtr / 2., 0., 0.);
346 transform_XshapeForwx = transform_XshapeForwx * G4RotateY3D(-A2);
347 G4IntersectionSolid* XshapeForw = new G4IntersectionSolid("XshapeForw", AluCont_f, XshapeForwx, transform_XshapeForwx);
348 G4LogicalVolume* l_XshapeForw =
new G4LogicalVolume(XshapeForw,
geometry::Materials::get(vacPipe),
"l_XshapeForw", 0, 0);
349
350 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapeForw, "p_XshapeForw", l_XshapeTiNForw, false, 0);
351
352
353
354 G4VSolid* AluCont_fpO = new G4Trd("AluCont_fpO", xcont2, xcont3, xcont1, xcont1, xpipePOS_hz / 2.0 * cos(A1));
355 G4VSolid* AluCont_fps = new G4Trd("AluCont_fps", xcont5, xcont4, xcont1, xcont1, xpipePOS_hz / 2.0 * cos(A1));
356 G4Transform3D transform_AluCont_fps = G4Translate3D(0., 0., 0.);
357 G4SubtractionSolid* AluCont_fp = new G4SubtractionSolid("AluCont_fp", AluCont_fpO, AluCont_fps, transform_AluCont_fps);
358 G4LogicalVolume* logi_AluCont_fp =
new G4LogicalVolume(AluCont_fp,
geometry::Materials::get(matPipe),
"logi_AluCont_fp", 0, 0);
359 new G4PVPlacement(0, G4ThreeVector(0, 0, pipe_hz + endcap_hz * 2.0 + xpipe_hz * cos(A2) + xpipePOS_hz / 2.0 * cos(A1)),
360 logi_AluCont_fp, "phys_AluCont_fp", &topVolume, false, 0);
361
362
363 G4VSolid* s_XshapefPOS_11 = new G4Tubs("s_XshapefPOS11",
364 tubinR,
365 xpipe_innerRadius,
366 xpipePOS_hz,
367 startAngle, spanningAngle);
368 G4VSolid* s_XshapefPOS_12 = new G4Tubs("s_XshapefPOS12",
369 tubinR,
370 xpipe_innerRadius * 2,
371 xpipePOS_hz / 2. - 0.7568202457 * SafetyLength,
372 startAngle, spanningAngle);
373 G4Transform3D transform_sXshapefPOS_12 = G4Translate3D(0., 0., 0.);
374 transform_sXshapefPOS_12 = transform_sXshapefPOS_12 * G4RotateY3D(-A1);
375 G4IntersectionSolid* XshapefPOS1 = new G4IntersectionSolid("XshapefPOS1", s_XshapefPOS_11, s_XshapefPOS_12,
376 transform_sXshapefPOS_12);
377
378 G4LogicalVolume* l_XshapefPOS1 =
new G4LogicalVolume(XshapefPOS1,
geometry::Materials::get(vacPipe),
"l_XshapefPOS1", 0, 0);
379
380 G4RotationMatrix* yRotP = new G4RotationMatrix;
381 yRotP->rotateY(-A1);
382 new G4PVPlacement(yRotP, G4ThreeVector(2 * endcap_hz * tan(A2) + xpipe_hz * sin(A2) + xpipePOS_hz / 2.*sin(A1), 0., 0.),
383 l_XshapefPOS1, "p_XshapefPOS1", logi_AluCont_fp, false, 0);
384
385
386 G4VSolid* s_XshapefPOS_21 = new G4Tubs("s_XshapefPOS21",
387 tubinR,
388 xpipe_innerRadius,
389 xpipePOS_hz,
390 startAngle, spanningAngle);
391 G4VSolid* s_XshapefPOS_22 = new G4Tubs("s_XshapefPOS22",
392 tubinR,
393 xpipe_innerRadius * 2,
394 xpipePOS_hz / 2. - 0.7568202457 * SafetyLength,
395 startAngle, spanningAngle);
396 G4Transform3D transform_sXshapefPOS_22 = G4Translate3D(0., 0., 0.);
397 transform_sXshapefPOS_22 = transform_sXshapefPOS_22 * G4RotateY3D(A1);
398 G4IntersectionSolid* XshapefPOS2 = new G4IntersectionSolid("XshapefPOS2", s_XshapefPOS_21, s_XshapefPOS_22,
399 transform_sXshapefPOS_22);
400
401 G4LogicalVolume* l_XshapefPOS2 =
new G4LogicalVolume(XshapefPOS2,
geometry::Materials::get(matTiN),
"l_XshapefPOS2", 0, 0);
402 G4RotationMatrix* yRotM = new G4RotationMatrix;
403 yRotM->rotateY(A1);
404 new G4PVPlacement(yRotM, G4ThreeVector(-(2 * endcap_hz * tan(A2) + xpipe_hz * sin(A2) + xpipePOS_hz / 2.*sin(A1)), 0., 0.),
405 l_XshapefPOS2, "p_XshapefPOS2", logi_AluCont_fp, false, 0);
406
407 G4VSolid* s_XshapefPOS_31 = new G4Tubs("s_XshapefPOS31",
408 tubinR,
409 xpipe_innerRadiusTiN,
410 xpipePOS_hz,
411 startAngle, spanningAngle);
412 G4VSolid* s_XshapefPOS_32 = new G4Tubs("s_XshapefPOS32",
413 tubinR,
414 xpipe_innerRadiusTiN * 2,
415 xpipePOS_hz / 2. - 0.7568202457 * SafetyLength,
416 startAngle, spanningAngle);
417 G4Transform3D transform_sXshapefPOS_32 = G4Translate3D(0., 0., 0.);
418 transform_sXshapefPOS_32 = transform_sXshapefPOS_32 * G4RotateY3D(A1);
419 G4IntersectionSolid* XshapefPOS3 = new G4IntersectionSolid("XshapefPOS3", s_XshapefPOS_31, s_XshapefPOS_32,
420 transform_sXshapefPOS_32);
421
422 G4LogicalVolume* l_XshapefPOS3 =
new G4LogicalVolume(XshapefPOS3,
geometry::Materials::get(vacPipe),
"l_XshapefPOS3", 0, 0);
423
424 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapefPOS3, "p_XshapefPOS3", l_XshapefPOS2, false, 0);
425
426
427
428 G4VSolid* AluCont_b = new G4Trd("AluCont_b", xcont2, xcont1, xcont1, xcont1, xpipe_hz / 2.0 * cos(A2));
429 G4LogicalVolume* logi_AluCont_b =
new G4LogicalVolume(AluCont_b,
geometry::Materials::get(matPipe),
"logi_AluCont_b", 0, 0);
430 new G4PVPlacement(0, G4ThreeVector(0, 0, -pipe_hz - endcap_hz * 2.0 - xpipe_hz * cos(A2) / 2.), logi_AluCont_b, "phys_AluCont_b",
431 &topVolume, false, 1);
432
433
434
435
436 G4VSolid* s_Xshapeb_11 = new G4Tubs("s_Xshapeb_11",
437 tubinR,
438 xpipe_innerRadiusTiN,
439 xpipe_hz,
440 startAngle, spanningAngle);
441 G4VSolid* s_Xshapeb_12 = new G4Tubs("s_Xshapeb_12",
442 tubinR,
443 xpipe_innerRadiusTiN * 2.0,
444 xpipe_hz / 2.0,
445 startAngle, spanningAngle);
446 G4VSolid* s_Xshapeb_21 = new G4Tubs("s_Xshapeb_21",
447 tubinR,
448 xpipe_innerRadius,
449 xpipe_hz,
450 startAngle, spanningAngle);
451 G4VSolid* s_Xshapeb_22 = new G4Tubs("s_Xshapeb_22",
452 tubinR,
453 xpipe_innerRadius * 2.0,
454 xpipe_hz / 2.0,
455 startAngle, spanningAngle);
456
457 G4VSolid* s_XshapebTiN_11 = new G4Tubs("s_XshapebTiN_11",
458 tubinR,
459 xpipe_innerRadius,
460 xpipe_hz,
461 startAngle, spanningAngle);
462 G4VSolid* s_XshapebTiN_12 = new G4Tubs("s_XshapebTiN_12",
463 tubinR,
464 xpipe_innerRadius * 2.0,
465 xpipe_hz / 2.0,
466 startAngle, spanningAngle);
467 G4VSolid* s_XshapebTiN_21 = new G4Tubs("s_XshapebTiN_21",
468 tubinR,
469 xpipe_innerRadius,
470 xpipe_hz,
471 startAngle, spanningAngle);
472 G4VSolid* s_XshapebTiN_22 = new G4Tubs("s_XshapebTiN_22",
473 tubinR,
474 xpipe_innerRadius * 2.0,
475 xpipe_hz / 2.0,
476 startAngle, spanningAngle);
477
478 G4Transform3D transform_sXshapeb_12 = G4Translate3D(0., 0., 0.);
479 transform_sXshapeb_12 = transform_sXshapeb_12 * G4RotateY3D(A2);
480 G4IntersectionSolid* Xshapeb1 = new G4IntersectionSolid("Xshapeb1", s_Xshapeb_11, s_Xshapeb_12, transform_sXshapeb_12);
481
482 G4Transform3D transform_sXshapeb_22 = G4Translate3D(0., 0., 0.);
483 transform_sXshapeb_22 = transform_sXshapeb_22 * G4RotateY3D(-A2);
484 G4IntersectionSolid* Xshapeb2 = new G4IntersectionSolid("Xshapeb2", s_Xshapeb_21, s_Xshapeb_22, transform_sXshapeb_22);
485
486 G4Transform3D transform_sXshapebTiN_12 = G4Translate3D(0., 0., 0.);
487 transform_sXshapebTiN_12 = transform_sXshapebTiN_12 * G4RotateY3D(A2);
488 G4IntersectionSolid* XshapebTiN1 = new G4IntersectionSolid("XshapebTiN1", s_XshapebTiN_11, s_XshapebTiN_12,
489 transform_sXshapebTiN_12);
490
491 G4Transform3D transform_sXshapebTiN_22 = G4Translate3D(0., 0., 0.);
492 transform_sXshapebTiN_22 = transform_sXshapebTiN_22 * G4RotateY3D(-A2);
493 G4IntersectionSolid* XshapebTiN2 = new G4IntersectionSolid("XshapebTiN2", s_XshapebTiN_21, s_XshapebTiN_22,
494 transform_sXshapebTiN_22);
495
496
497 G4Transform3D transform_XshapebTiN1 = G4Translate3D(dxtr, 0., dztr);
498
499 transform_XshapebTiN1 = transform_XshapebTiN1 * G4RotateY3D(-2.*A2);
500 G4UnionSolid* XshapeTiNBackwx = new G4UnionSolid("XshapeTiNBackwx", XshapebTiN2, XshapebTiN1, transform_XshapebTiN1);
501
502 G4Transform3D transform_XshapeTiNBackwx = G4Translate3D(-dxtr / 2., 0., 0.);
503 transform_XshapeTiNBackwx = transform_XshapeTiNBackwx * G4RotateY3D(A2);
504 G4IntersectionSolid* XshapeTiNBackw = new G4IntersectionSolid("XshapeTiNBackw", AluCont_b, XshapeTiNBackwx,
505 transform_XshapeTiNBackwx);
506 G4LogicalVolume* l_XshapeTiNBackw =
new G4LogicalVolume(XshapeTiNBackw,
geometry::Materials::get(matTiN),
"l_XshapeTiNBackw", 0,
507 0);
508 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapeTiNBackw, "p_XshapeTiNBackw", logi_AluCont_b, false, 0);
509
510
511 G4Transform3D transform_Xshapeb1 = G4Translate3D(dxtr, 0., dztr);
512 transform_Xshapeb1 = transform_Xshapeb1 * G4RotateY3D(-2.*A2);
513 G4UnionSolid* XshapeBackwx = new G4UnionSolid("XshapebBackwx", Xshapeb2, Xshapeb1, transform_Xshapeb1);
514 G4Transform3D transform_XshapeBackwx = G4Translate3D(-dxtr / 2., 0., 0.);
515 transform_XshapeBackwx = transform_XshapeBackwx * G4RotateY3D(A2);
516 G4IntersectionSolid* XshapeBackw = new G4IntersectionSolid("XshapeBackw", AluCont_b, XshapeBackwx, transform_XshapeBackwx);
517 G4LogicalVolume* l_XshapeBackw =
new G4LogicalVolume(XshapeBackw,
geometry::Materials::get(vacPipe),
"l_XshapeBackw", 0, 0);
518
519
520 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapeBackw, "p_XshapeBackw", l_XshapeTiNBackw, false, 0);
521
522
523
524 G4VSolid* AluCont_bpO = new G4Trd("AluCont_bpO", xcont3M, xcont2, xcont1, xcont1, xpipeMIN_hz / 2.0 * cos(A1));
525 G4VSolid* AluCont_bps = new G4Trd("AluCont_bps", xcont4M, xcont5, xcont1, xcont1, xpipeMIN_hz / 2.0 * cos(A1));
526 G4Transform3D transform_AluCont_bps = G4Translate3D(0., 0., 0.);
527 G4SubtractionSolid* AluCont_bp = new G4SubtractionSolid("AluCont_bp", AluCont_bpO, AluCont_bps, transform_AluCont_bps);
528 G4LogicalVolume* logi_AluCont_bp =
new G4LogicalVolume(AluCont_bp,
geometry::Materials::get(matPipe),
"logi_AluCont_bp", 0, 0);
529 new G4PVPlacement(0, G4ThreeVector(0, 0, -(pipe_hz + endcap_hz * 2.0 + xpipe_hz * cos(A2) + xpipeMIN_hz / 2.0 * cos(A1))),
530 logi_AluCont_bp, "phys_AluCont_bp", &topVolume, false, 0);
531
532
533 G4VSolid* s_XshapebMIN_11 = new G4Tubs("s_XshapebMIN11",
534 tubinR,
535 xpipe_innerRadius,
536 xpipeMIN_hz,
537 startAngle, spanningAngle);
538 G4VSolid* s_XshapebMIN_12 = new G4Tubs("s_XshapebMIN12",
539 tubinR,
540 xpipe_innerRadius * 2,
541 xpipeMIN_hz / 2. - 0.525641366 * SafetyLength,
542 startAngle, spanningAngle);
543 G4Transform3D transform_sXshapebMIN_12 = G4Translate3D(0., 0., 0.);
544 transform_sXshapebMIN_12 = transform_sXshapebMIN_12 * G4RotateY3D(-A1);
545 G4IntersectionSolid* XshapebMIN1 = new G4IntersectionSolid("XshapebMIN1", s_XshapebMIN_11, s_XshapebMIN_12,
546 transform_sXshapebMIN_12);
547
548 G4LogicalVolume* l_XshapebMIN1 =
new G4LogicalVolume(XshapebMIN1,
geometry::Materials::get(vacPipe),
"l_XshapebMIN1", 0, 0);
549
550 new G4PVPlacement(yRotP, G4ThreeVector(-(2 * endcap_hz * tan(A2) + xpipe_hz * sin(A2) + xpipeMIN_hz / 2.*sin(A1)), 0., 0.),
551 l_XshapebMIN1, "p_XshapebMIN1", logi_AluCont_bp, false, 0);
552
553
554 G4VSolid* s_XshapebMIN_21 = new G4Tubs("s_XshapebMIN21",
555 tubinR,
556 xpipe_innerRadius,
557 xpipeMIN_hz,
558 startAngle, spanningAngle);
559 G4VSolid* s_XshapebMIN_22 = new G4Tubs("s_XshapebMIN22",
560 tubinR,
561 xpipe_innerRadius * 2,
562 xpipeMIN_hz / 2. - 0.525641366 * SafetyLength,
563 startAngle, spanningAngle);
564 G4Transform3D transform_sXshapebMIN_22 = G4Translate3D(0., 0., 0.);
565 transform_sXshapebMIN_22 = transform_sXshapebMIN_22 * G4RotateY3D(A1);
566 G4IntersectionSolid* XshapebMIN2 = new G4IntersectionSolid("XshapebMIN2", s_XshapebMIN_21, s_XshapebMIN_22,
567 transform_sXshapebMIN_22);
568
569 G4LogicalVolume* l_XshapebMIN2 =
new G4LogicalVolume(XshapebMIN2,
geometry::Materials::get(matTiN),
"l_XshapebMIN2", 0, 0);
570 new G4PVPlacement(yRotM, G4ThreeVector(2 * endcap_hz * tan(A2) + xpipe_hz * sin(A2) + xpipeMIN_hz / 2.*sin(A1), 0., 0.),
571 l_XshapebMIN2, "p_XshapebMIN2", logi_AluCont_bp, false, 0);
572
573 G4VSolid* s_XshapebMIN_31 = new G4Tubs("s_XshapebMIN31",
574 tubinR,
575 xpipe_innerRadiusTiN,
576 xpipeMIN_hz,
577 startAngle, spanningAngle);
578 G4VSolid* s_XshapebMIN_32 = new G4Tubs("s_XshapebMIN32",
579 tubinR,
580 xpipe_innerRadiusTiN * 2,
581 xpipeMIN_hz / 2. - 0.525641366 * SafetyLength,
582 startAngle, spanningAngle);
583 G4Transform3D transform_sXshapebMIN_32 = G4Translate3D(0., 0., 0.);
584 transform_sXshapebMIN_32 = transform_sXshapebMIN_32 * G4RotateY3D(A1);
585 G4IntersectionSolid* XshapebMIN3 = new G4IntersectionSolid("XshapebMIN3", s_XshapebMIN_31, s_XshapebMIN_32,
586 transform_sXshapebMIN_32);
587
588 G4LogicalVolume* l_XshapebMIN3 =
new G4LogicalVolume(XshapebMIN3,
geometry::Materials::get(vacPipe),
"l_XshapebMIN3", 0, 0);
589
590 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), l_XshapebMIN3, "p_XshapebMIN3", l_XshapebMIN2, false, 0);
591
592 }
static G4Material * get(const std::string &name)
Find given material.
double sqrt(double a)
sqrt for double
VXD::SensitiveDetector< PXDSimHit, PXDTrueHit > SensitiveDetector
The PXD Sensitive Detector class.