42 TGeoVolume* top = gGeoManager->GetTopVolume();
45 TGeoMedium* tungsten = gGeoManager->GetMedium(
"tungsten");
47 TGeoMedium* tantalum = gGeoManager->GetMedium(
"tantalum");
49 TGeoMedium* mo = gGeoManager->GetMedium(
"molybdenum");
51 TGeoMedium* iron = gGeoManager->GetMedium(
"iron");
53 TGeoMedium* steel316L = gGeoManager->GetMedium(
"steel316L");
55 TGeoMedium* copper = gGeoManager->GetMedium(
"copper");
58 TGeoMedium* inc718 = gGeoManager->GetMedium(
"Inconel718");
61 TGeoMedium* vacuum = gGeoManager->GetMedium(
"vacuums");
63 double He_T = 273.15 +
fHeT;
64 double He_P = 1.6e6 * 6.241509e3;
66 std::ostringstream lHename;
67 lHename <<
"PressurisedHe" <<
fHeT;
69 TGeoMedium* pressurised_He = gGeoManager->GetMedium(lHename.str().c_str());
73 TGeoMaterial* fixedCooler = pressurised_He->GetMaterial();
74 fixedCooler->SetTemperature(He_T);
75 fixedCooler->SetPressure(He_P);
76 TGeoMedium* cooler = pressurised_He;
78 LOG(info) <<
"-- Target cooler: " << cooler->GetName()
79 <<
" T=" << cooler->GetMaterial()->GetTemperature()
80 <<
" K, P=" << cooler->GetMaterial()->GetPressure()
81 <<
" MeV/mm3, Density=" << cooler->GetMaterial()->GetDensity();
83 TGeoVolume* tTarget =
new TGeoVolumeAssembly(
"TargetArea");
87 double vessel_thickness = 8 *
mm;
95 vessel = gGeoManager->MakeTube(
"TargetVessel", inc718, vessel_diameter / 2.,
96 vessel_diameter / 2. + vessel_thickness,
98 vessel->SetLineColor(28);
101 new TGeoTranslation(0, 0, -1. * vessel_shift + vessel_length / 2.));
103 vessel = gGeoManager->MakeTube(
"TargetVesselFront", inc718, 0,
104 vessel_diameter / 2. + vessel_thickness,
105 vessel_thickness / 2.);
106 vessel->SetLineColor(28);
109 new TGeoTranslation(0, 0, -1. * vessel_shift - vessel_thickness / 2.));
111 vessel = gGeoManager->MakeTube(
"TargetVesselBack", inc718, 0,
112 vessel_diameter / 2. + vessel_thickness,
113 vessel_thickness / 2.);
114 vessel->SetLineColor(28);
118 0, 0, -1. * vessel_shift + vessel_length + vessel_thickness / 2.));
120 vessel = gGeoManager->MakeTube(
"HeVolume", cooler, 0, vessel_diameter / 2.,
122 vessel->SetLineColor(7);
127 double enclosure_clearance =
129 double enclosure_inner_radius =
fDiameter / 2. + enclosure_clearance;
130 double enclosure_thickness = 66.9 *
mm;
131 double enclosure_outer_radius =
132 enclosure_inner_radius + enclosure_thickness;
133 double enclosure_cutout_width_x = 160 *
mm;
134 double enclosure_cutout_width_y = 280 *
mm;
137 [[maybe_unused]]
auto enclosure_outer_tube =
138 new TGeoTube(
"enclosure_outer_tube", enclosure_inner_radius,
139 enclosure_outer_radius, enclosure_length / 2.);
140 [[maybe_unused]]
auto enclosure_cutout_box =
141 new TGeoBBox(
"enclosure_cutout_box", enclosure_cutout_width_x / 2.,
142 enclosure_cutout_width_y / 2., enclosure_length / 2.);
143 auto enclosure_shape =
new TGeoCompositeShape(
144 "enclosure_shape",
"enclosure_outer_tube - enclosure_cutout_box");
146 new TGeoVolume(
"target_enclosure", enclosure_shape, steel316L);
147 enclosure->SetLineColor(46);
151 0, 0, -vessel_length / 2. + vessel_shift + enclosure_length / 2.));
155 double cladding_width = 1.5 *
mm;
158 unsigned slots =
fnS;
159 if (slots > 0) slots = slots - 1;
161 TGeoVolume* claddedTarget;
162 TGeoVolume* targetCore;
164 for (
unsigned i = 0; i <
fnS; i++) {
165 TString nmi_cladded =
"CladdedTarget_";
166 nmi_cladded += i + 1;
167 TString nmi_core =
"TargetCore_";
170 TGeoMedium* material =
nullptr;
171 if (
fM.at(i) ==
"molybdenum") {
173 }
else if (
fM.at(i) ==
"tungsten") {
178 claddedTarget = gGeoManager->MakeTube(nmi_cladded, tantalum, 0.,
180 claddedTarget->SetLineColor(8);
185 targetCore = gGeoManager->MakeTube(nmi_core, material, 0.,
187 (
fL.at(i) - 2 * cladding_width) / 2.);
188 if (
fM.at(i) ==
"molybdenum") {
189 targetCore->SetLineColor(28);
191 targetCore->SetLineColor(38);
196 claddedTarget->AddNode(targetCore, 1,
new TGeoTranslation(0, 0, 0));
202 0, 0, -vessel_length / 2. + vessel_shift + zPos +
fL.at(i) / 2.));
206 zPos +=
fL.at(i) +
fG.at(i);
215 new TGeoTranslation(0, 0, -1. * vessel_shift + vessel_length / 2.));
222 LOG(fatal) <<
"Target design 2 requires the last disk diameter, "
223 "use SetLastDiskDiameter()";
228 const double he_zmin = -37.8 *
mm;
229 const double he_zmax = 1509.7 *
mm;
230 const double he_rmax = 237 *
mm;
231 const double he_zc = (he_zmin + he_zmax) / 2.;
232 TGeoVolume* heVolume = gGeoManager->MakeTube(
"HeVolume", cooler, 0, he_rmax,
233 (he_zmax - he_zmin) / 2.);
234 heVolume->SetLineColor(7);
237 auto placeAt = [he_zc](
double z0,
double z1) {
238 return new TGeoTranslation(0, 0, (z0 + z1) / 2. - he_zc);
245 for (
unsigned i = 0; i <
fnS; i++) {
246 TString nmi_core =
"TargetCore_";
248 TGeoMedium* material =
nullptr;
249 if (
fM.at(i) ==
"molybdenum") {
251 }
else if (
fM.at(i) ==
"tungsten") {
255 TGeoVolume* targetCore =
256 gGeoManager->MakeTube(nmi_core, material, 0., radius,
fL.at(i) / 2.);
257 targetCore->SetLineColor(
fM.at(i) ==
"molybdenum" ? 28 : 38);
258 heVolume->AddNode(targetCore, 1, placeAt(zPos, zPos +
fL.at(i)));
259 zPos +=
fL.at(i) +
fG.at(i);
266 const double core_zmin = 7.2 *
mm;
267 const double core_zmax = 1443.7 *
mm;
268 const double core_rout = 207 *
mm;
271 const double bore_step_z = 1005 *
mm;
272 const double core_front_rout = 195 *
mm;
273 const double core_front_zmax = 55.2 *
mm;
274 const double core_rear_rout = 190 *
mm;
275 const double core_rear_zmin = 1233.7 *
mm;
276 const double groove_rmax = 153 *
mm;
277 const double groove_phi = 61.;
278 const double margin = 5 *
mm;
280 std::ostringstream core_expr;
281 auto addTube = [&core_expr](
const TString& name,
double rmin,
double rmax,
282 double z0,
double z1,
bool subtract) {
283 new TGeoTube(name, rmin, rmax, (z1 - z0) / 2.);
284 auto trans =
new TGeoTranslation(name +
"_tr", 0, 0, (z0 + z1) / 2.);
285 trans->RegisterYourself();
289 core_expr << name <<
":" << name <<
"_tr";
291 auto addGroove = [&core_expr](
const TString& name,
double rmin,
double rmax,
292 double z0,
double z1,
double phi1,
294 new TGeoTubeSeg(name, rmin, rmax, (z1 - z0) / 2., phi1, phi2);
295 auto trans =
new TGeoTranslation(name +
"_tr", 0, 0, (z0 + z1) / 2.);
296 trans->RegisterYourself();
297 core_expr <<
" - " << name <<
":" << name <<
"_tr";
300 addTube(
"tgt_core_base", bore_r1, core_rout, core_zmin, core_zmax,
false);
301 addTube(
"tgt_core_front_step", core_front_rout, core_rout + margin,
302 core_zmin - margin, core_front_zmax,
true);
303 addTube(
"tgt_core_rear_step", core_rear_rout, core_rout + margin,
304 core_rear_zmin, core_zmax + margin,
true);
305 addTube(
"tgt_core_rear_bore", bore_r1 - margin, bore_r2, bore_step_z,
306 core_zmax + margin,
true);
311 const std::vector<std::pair<double, double>> grooves_top = {{12.2, 57.0},
316 const std::vector<std::pair<double, double>> grooves_bottom = {
317 {45.0, 104.7}, {142.7, 200.7}, {238.7, 334.7}, {385.7, 1005.0}};
319 for (
const auto& [z0, z1] : grooves_top) {
320 addGroove(TString::Format(
"tgt_groove_%d", grooveId++), bore_r1 - margin,
321 groove_rmax, z0 *
mm, z1 *
mm, 90. - groove_phi / 2.,
322 90. + groove_phi / 2.);
324 for (
const auto& [z0, z1] : grooves_bottom) {
325 addGroove(TString::Format(
"tgt_groove_%d", grooveId++), bore_r1 - margin,
326 groove_rmax, z0 *
mm, z1 *
mm, 270. - groove_phi / 2.,
327 270. + groove_phi / 2.);
331 addGroove(
"tgt_groove_rear", bore_r2 - margin, 182 *
mm, bore_step_z,
332 1441.7 *
mm, 90. - 49. / 2., 90. + 49. / 2.);
335 new TGeoCompositeShape(
"target_core_shape", core_expr.str().c_str());
336 auto core =
new TGeoVolume(
"target_core_steel", core_shape, steel316L);
337 core->SetLineColor(46);
338 heVolume->AddNode(core, 1,
new TGeoTranslation(0, 0, -he_zc));
345 const double jacket_zmin = core_front_zmax;
346 const double jacket_zmax = 1198.7 *
mm;
348 gGeoManager->MakeTube(
"target_jacket", steel316L, 217 *
mm, 225 *
mm,
349 (jacket_zmax - jacket_zmin) / 2.);
350 jacket->SetLineColor(46);
351 heVolume->AddNode(jacket, 1, placeAt(jacket_zmin, jacket_zmax));
354 const double flange_front_zmin = -23.8 *
mm;
355 const double nose_zmin = -35.8 *
mm;
357 gGeoManager->MakeTube(
"target_flange_front", steel316L, core_front_rout,
358 225 *
mm, (jacket_zmin - flange_front_zmin) / 2.);
359 flangeFront->SetLineColor(46);
360 heVolume->AddNode(flangeFront, 1, placeAt(flange_front_zmin, jacket_zmin));
365 const double window_rmax = 141 *
mm;
366 auto window = gGeoManager->MakeTube(
"target_front_window", steel316L, 0,
367 window_rmax, (33.5 - 25.5) *
mm / 2.);
368 window->SetLineColor(46);
369 heVolume->AddNode(window, 1, placeAt(-33.5 *
mm, -25.5 *
mm));
370 auto nose = gGeoManager->MakeTube(
"target_front_nose", steel316L,
371 window_rmax, core_front_rout,
372 (flange_front_zmin - nose_zmin) / 2.);
373 nose->SetLineColor(46);
374 heVolume->AddNode(nose, 1, placeAt(nose_zmin, flange_front_zmin));
379 gGeoManager->MakeTube(
"target_cover_ring1", steel316L, 196 *
mm,
380 he_rmax, (flange_front_zmin - he_zmin) / 2.);
381 coverRing1->SetLineColor(46);
382 heVolume->AddNode(coverRing1, 1, placeAt(he_zmin, flange_front_zmin));
384 gGeoManager->MakeTube(
"target_cover_ring2", steel316L, 226 *
mm,
385 he_rmax, (-17.8 *
mm - flange_front_zmin) / 2.);
386 coverRing2->SetLineColor(46);
387 heVolume->AddNode(coverRing2, 1, placeAt(flange_front_zmin, -17.8 *
mm));
388 const double flange_rear_zmax = 1263.7 *
mm;
390 gGeoManager->MakeTube(
"target_flange_back", steel316L, 225 *
mm,
391 he_rmax, (flange_rear_zmax - jacket_zmax) / 2.);
392 flangeRear->SetLineColor(46);
393 heVolume->AddNode(flangeRear, 1, placeAt(jacket_zmax, flange_rear_zmax));
397 const double endcap_zmin = flange_rear_zmax;
399 gGeoManager->MakeTube(
"target_endcap_tube", steel316L, 229 *
mm,
400 237 *
mm, (1413.7 *
mm - endcap_zmin) / 2.);
401 heVolume->AddNode(endcapTube, 1, placeAt(endcap_zmin, 1413.7 *
mm));
402 auto endcapDome1 = gGeoManager->MakeCone(
403 "target_endcap_dome1", steel316L, (1450. - 1413.7) *
mm / 2., 229 *
mm,
404 237 *
mm, 212 *
mm, 223 *
mm);
405 heVolume->AddNode(endcapDome1, 1, placeAt(1413.7 *
mm, 1450. *
mm));
406 auto endcapDome2 = gGeoManager->MakeCone(
407 "target_endcap_dome2", steel316L, (1480. - 1450.) *
mm / 2., 212 *
mm,
408 223 *
mm, 142 *
mm, 166.5 *
mm);
409 heVolume->AddNode(endcapDome2, 1, placeAt(1450. *
mm, 1480. *
mm));
410 auto endcapDome3 = gGeoManager->MakeCone(
"target_endcap_dome3", steel316L,
411 (1505. - 1480.) *
mm / 2.,
412 142 *
mm, 166.5 *
mm, 0, 67 *
mm);
413 heVolume->AddNode(endcapDome3, 1, placeAt(1480. *
mm, 1505. *
mm));
415 gGeoManager->MakeTube(
"target_endcap_cap", steel316L, 0, 67 *
mm,
416 (he_zmax - 1505. *
mm) / 2.);
417 heVolume->AddNode(endcapCap, 1, placeAt(1505. *
mm, he_zmax));
419 {endcapTube, endcapDome1, endcapDome2, endcapDome3, endcapCap}) {
427 const double cover_y_offset = -75 *
mm;
428 [[maybe_unused]]
auto cover_box =
429 new TGeoBBox(
"target_cover_box", 300 *
mm, 325 *
mm, 10 *
mm);
430 [[maybe_unused]]
auto cover_hole =
431 new TGeoTube(
"target_cover_hole", 0, he_rmax, 11 *
mm);
432 auto cover_hole_shift =
433 new TGeoTranslation(
"target_cover_hole_shift", 0, -cover_y_offset, 0);
434 cover_hole_shift->RegisterYourself();
435 auto cover_shape =
new TGeoCompositeShape(
436 "target_cover_shape",
437 "target_cover_box - target_cover_hole:target_cover_hole_shift");
439 new TGeoVolume(
"target_cover_plate", cover_shape, steel316L);
440 coverPlate->SetLineColor(46);
441 tTarget->AddNode(coverPlate, 1,
442 new TGeoTranslation(0, cover_y_offset, -27.8 *
mm));
445 tTarget->AddNode(heVolume, 1,
new TGeoTranslation(0, 0, he_zc));
447 LOG(fatal) <<
"Unknown target design " <<
fDesign <<
", expected 1 or 2";
454 LOG(fatal) <<
"Shielding reference length not set, "
455 "use SetShieldingReferenceLength()";
459 double shielding_width = 1600 *
mm;
460 double shielding_length = 3000 *
mm;
461 double proximity_shielding_height = 1126 *
mm;
462 double proximity_shielding_thickness = 250 *
mm;
463 double proximity_shielding_thickness_front = 550 *
mm;
464 double proximity_shielding_hole_diameter = 200 *
mm;
465 double proximity_shielding_hole_height = 735 *
mm;
466 double proximity_shielding_distance_after_target = 96.1 *
mm;
467 double top_shielding_height = 600 *
mm;
468 double bottom_shielding_height = 545 *
mm;
469 double shielding_position = start_of_target +
fTargetLength +
470 proximity_shielding_distance_after_target +
471 proximity_shielding_thickness -
472 shielding_length / 2;
473 double target_box_shift = 14.45 *
cm;
474 [[maybe_unused]]
auto proximity_shielding_envelope =
475 new TGeoBBox(
"proximity_shielding_envelope", shielding_width / 2,
476 proximity_shielding_height / 2, shielding_length / 2);
477 [[maybe_unused]]
auto proximity_shielding_inner =
new TGeoBBox(
478 "proximity_shielding_inner",
479 shielding_width / 2 - proximity_shielding_thickness,
480 proximity_shielding_height / 2,
482 (proximity_shielding_thickness_front + proximity_shielding_thickness)) /
484 [[maybe_unused]]
auto proximity_shielding_hole =
new TGeoTube(
485 "proximity_shielding_hole", 0, proximity_shielding_hole_diameter / 2,
486 proximity_shielding_thickness_front / 2);
487 auto proximity_shielding_inner_shift =
new TGeoTranslation(
488 "proximity_shielding_inner_shift", 0, 0,
489 (proximity_shielding_thickness_front - proximity_shielding_thickness) /
491 proximity_shielding_inner_shift->RegisterYourself();
492 auto proximity_shielding_hole_shift =
new TGeoTranslation(
493 "proximity_shielding_hole_shift", 0,
494 proximity_shielding_hole_height - proximity_shielding_height / 2,
495 -shielding_length / 2 + proximity_shielding_thickness_front / 2);
496 proximity_shielding_hole_shift->RegisterYourself();
497 auto proximity_shielding_shape =
new TGeoCompositeShape(
498 "proximity_shielding_shape",
499 "proximity_shielding_envelope"
500 "- proximity_shielding_inner:proximity_shielding_inner_shift"
501 "- proximity_shielding_hole:proximity_shielding_hole_shift");
502 auto proximity_shielding =
503 new TGeoVolume(
"proximity_shielding", proximity_shielding_shape, copper);
504 auto proximity_shielding_centre =
new TGeoTranslation(
506 -(proximity_shielding_hole_height - proximity_shielding_height / 2) +
510 auto target_vacuum_box =
511 gGeoManager->MakeBox(
"target_vacuum_box", vacuum, shielding_width / 2,
512 (proximity_shielding_height + top_shielding_height +
513 bottom_shielding_height) /
515 shielding_length / 2);
516 auto vacuum_vessel_centre =
new TGeoTranslation(
520 -target_box_shift, shielding_position);
521 top->AddNode(target_vacuum_box, 1, vacuum_vessel_centre);
523 target_vacuum_box->AddNode(proximity_shielding, 1,
524 proximity_shielding_centre);
528 gGeoManager->MakeBox(
"top_shielding", copper, shielding_width / 2,
529 top_shielding_height / 2, shielding_length / 2);
530 target_vacuum_box->AddNode(
534 top_shielding_height / 2 + proximity_shielding_height -
535 proximity_shielding_hole_height + target_box_shift,
537 auto bottom_shielding =
538 gGeoManager->MakeBox(
"bottom_shielding", copper, shielding_width / 2,
539 bottom_shielding_height / 2, shielding_length / 2);
540 target_vacuum_box->AddNode(
542 new TGeoTranslation(0.,
543 -bottom_shielding_height / 2 -
544 proximity_shielding_hole_height +
547 double pedestal_length = 2170 *
mm;
548 double pedestal_width = 1070 *
mm;
549 double pedestal_height = 150 *
mm;
550 auto shielding_pedestal =
551 gGeoManager->MakeBox(
"shielding_pedestal", iron, pedestal_width / 2,
552 pedestal_height / 2, pedestal_length / 2);
553 target_vacuum_box->AddNode(
554 shielding_pedestal, 1,
557 pedestal_height / 2 - proximity_shielding_hole_height +
559 -shielding_length / 2 + 565 *
mm + pedestal_length / 2));
561 target_vacuum_box->AddNode(
563 new TGeoTranslation(0, target_box_shift,
564 start_of_target - shielding_position));