|
26 | 26 | #include <TGeoManager.h> |
27 | 27 | #include <TGeoShape.h> |
28 | 28 | #include <TGeoCompositeShape.h> |
29 | | -#include <TGeoTube.h> |
30 | 29 |
|
31 | 30 | namespace o2 |
32 | 31 | { |
@@ -345,124 +344,10 @@ TGeoVolume* createChamber(int iChamber) |
345 | 344 | return chamber; |
346 | 345 | } |
347 | 346 |
|
348 | | -/// Magnet geometry variant selector |
349 | | -enum class MagnetVariant { |
350 | | - AluminiumWalls, ///< 11 cm cryostat, Al inner/outer walls |
351 | | - SteelWalls ///< 10 cm cryostat, Fe inner/outer walls |
352 | | -}; |
353 | | - |
354 | | -/// Creates the MID magnet/cryostat geometry |
355 | | -/// Port of GEANT4 simulation by Ian Perez Garcia (ICN-UNAM) |
356 | | -/// Reference: github.com/IanPG/MID-Geometry-Studies |
357 | | -void createMagnetGeometry(TGeoVolume& topVolume, |
358 | | - MagnetVariant variant = MagnetVariant::AluminiumWalls) |
359 | | -{ |
360 | | - const float R_cryostat_inner = 140.0f; |
361 | | - const float R_cryostat_outer = 200.0f; |
362 | | - const float R_coil_inner = 160.0f; |
363 | | - const float magnetHalfLength = 400.0f; |
364 | | - |
365 | | - const float thick_actual_coil = 4.8f; |
366 | | - const float thick_mli = 0.2f; |
367 | | - const float thick_coil_support = 2.0f; |
368 | | - |
369 | | - float thick_inner_wall; |
370 | | - float thick_outer_wall; |
371 | | - int wallMedium; |
372 | | - const char* variantTag; |
373 | | - |
374 | | - if (variant == MagnetVariant::AluminiumWalls) { |
375 | | - thick_inner_wall = 2.5f; |
376 | | - thick_outer_wall = 1.5f; |
377 | | - wallMedium = Medium::Aluminium; |
378 | | - variantTag = "Al"; |
379 | | - } else { |
380 | | - thick_inner_wall = 1.5f; |
381 | | - thick_outer_wall = 1.5f; |
382 | | - wallMedium = Medium::Iron; |
383 | | - variantTag = "Steel"; |
384 | | - } |
385 | | - |
386 | | - const float R_inner_wall_outer = R_cryostat_inner + thick_inner_wall; |
387 | | - const float R_coil_outer = R_coil_inner + thick_actual_coil; |
388 | | - const float R_mli_inner = R_coil_outer; |
389 | | - const float R_mli_outer = R_mli_inner + thick_mli; |
390 | | - const float R_coil_support_inner = R_mli_outer; |
391 | | - const float R_coil_support_outer = R_coil_support_inner + thick_coil_support; |
392 | | - const float R_outer_wall_inner = R_cryostat_outer - thick_outer_wall; |
393 | | - |
394 | | - // Mother volume (contains all cryostat layers) |
395 | | - auto magnetMotherShape = new TGeoTube(Form("MIDMagnetMother_%s_S", variantTag), |
396 | | - R_cryostat_inner, R_cryostat_outer, magnetHalfLength); |
397 | | - auto magnetMotherVol = new TGeoVolume(Form("MIDMagnetMother_%s", variantTag), |
398 | | - magnetMotherShape, assertMedium(Medium::Vacuum)); |
399 | | - magnetMotherVol->SetVisibility(kFALSE); |
400 | | - topVolume.AddNode(magnetMotherVol, 1, new TGeoTranslation(0., 0., -1155.)); |
401 | | - |
402 | | - // Layer 1: Inner wall (Al or Fe) |
403 | | - auto innerWallVol = new TGeoVolume(Form("MIDInnerWall_%s", variantTag), |
404 | | - new TGeoTube(Form("MIDInnerWall_%s_S", variantTag), |
405 | | - R_cryostat_inner, R_inner_wall_outer, magnetHalfLength), |
406 | | - assertMedium(wallMedium)); |
407 | | - innerWallVol->SetLineColor((variant == MagnetVariant::AluminiumWalls) ? kCyan + 1 : kRed + 1); |
408 | | - magnetMotherVol->AddNode(innerWallVol, 1, nullptr); |
409 | | - |
410 | | - // Layer 2: Inner vacuum gap |
411 | | - auto vacGap1Vol = new TGeoVolume(Form("MIDVacGap1_%s", variantTag), |
412 | | - new TGeoTube(Form("MIDVacGap1_%s_S", variantTag), |
413 | | - R_inner_wall_outer, R_coil_inner, magnetHalfLength), |
414 | | - assertMedium(Medium::Vacuum)); |
415 | | - magnetMotherVol->AddNode(vacGap1Vol, 1, nullptr); |
416 | | - |
417 | | - // Layer 3: Winding Pack (NbTi+Cu+Al, density=2.96 g/cm3) |
418 | | - auto coilVol = new TGeoVolume(Form("MIDCoil_%s", variantTag), |
419 | | - new TGeoTube(Form("MIDCoil_%s_S", variantTag), |
420 | | - R_coil_inner, R_coil_outer, magnetHalfLength), |
421 | | - assertMedium(Medium::WindingPack)); |
422 | | - coilVol->SetLineColor(kRed); |
423 | | - magnetMotherVol->AddNode(coilVol, 1, nullptr); |
424 | | - |
425 | | - // Layer 4: MLI - Multi-Layer Insulation (2mm Al) |
426 | | - auto mliVol = new TGeoVolume(Form("MIDMLI_%s", variantTag), |
427 | | - new TGeoTube(Form("MIDMLI_%s_S", variantTag), |
428 | | - R_mli_inner, R_mli_outer, magnetHalfLength), |
429 | | - assertMedium(Medium::Aluminium)); |
430 | | - mliVol->SetLineColor(kYellow); |
431 | | - magnetMotherVol->AddNode(mliVol, 1, nullptr); |
432 | | - |
433 | | - // Layer 5: A-5083 Support cylinder (20mm Al) |
434 | | - auto supportVol = new TGeoVolume(Form("MIDCoilSupport_%s", variantTag), |
435 | | - new TGeoTube(Form("MIDCoilSupport_%s_S", variantTag), |
436 | | - R_coil_support_inner, R_coil_support_outer, magnetHalfLength), |
437 | | - assertMedium(Medium::Aluminium)); |
438 | | - supportVol->SetLineColor(kBlue - 7); |
439 | | - magnetMotherVol->AddNode(supportVol, 1, nullptr); |
440 | | - |
441 | | - // Layer 6: Outer vacuum gap |
442 | | - auto vacGap2Vol = new TGeoVolume(Form("MIDVacGap2_%s", variantTag), |
443 | | - new TGeoTube(Form("MIDVacGap2_%s_S", variantTag), |
444 | | - R_coil_support_outer, R_outer_wall_inner, magnetHalfLength), |
445 | | - assertMedium(Medium::Vacuum)); |
446 | | - magnetMotherVol->AddNode(vacGap2Vol, 1, nullptr); |
447 | | - |
448 | | - // Layer 7: Outer wall (Al or Fe) |
449 | | - auto outerWallVol = new TGeoVolume(Form("MIDOuterWall_%s", variantTag), |
450 | | - new TGeoTube(Form("MIDOuterWall_%s_S", variantTag), |
451 | | - R_outer_wall_inner, R_cryostat_outer, magnetHalfLength), |
452 | | - assertMedium(wallMedium)); |
453 | | - outerWallVol->SetLineColor((variant == MagnetVariant::AluminiumWalls) ? kCyan + 1 : kRed + 1); |
454 | | - magnetMotherVol->AddNode(outerWallVol, 1, nullptr); |
455 | | -} |
456 | | - |
457 | 347 | void createGeometry(TGeoVolume& topVolume) |
458 | 348 | { |
459 | 349 | createMaterials(); |
460 | 350 |
|
461 | | - // Add magnet/cryostat geometry (Francisco Esquivel, June 2026) |
462 | | - printf("[MID] Calling createMagnetGeometry...\n"); |
463 | | - createMagnetGeometry(topVolume, MagnetVariant::AluminiumWalls); |
464 | | - printf("[MID] createMagnetGeometry done. Top volume nodes: %d\n", topVolume.GetNdaughters()); |
465 | | - |
466 | 351 | // create and place the trigger chambers |
467 | 352 | for (int iCh = 0; iCh < detparams::NChambers; iCh++) { |
468 | 353 |
|
|
0 commit comments