73 {
74 LOG(
debug) <<
" Construct Geometry of the MS ";
75
76
77
79 LOG(fatal) <<
"ShipMuonShield: expected " <<
nMagnets <<
" magnets x "
81 << " values. Is the geometry from an older version?";
82 }
83 TGeoVolume*
top = gGeoManager->GetTopVolume();
84 TGeoVolume* tShield = new TGeoVolumeAssembly("MuonShieldArea");
86 TGeoMedium* iron = gGeoManager->GetMedium("iron");
87
88 bool absorber_magnet = false;
90 for (
size_t nM = 0; nM <
nMagnets; ++nM) {
95
96 if (nM > 0) {
98 }
99 Z += Zgap + dZ;
100
101 TString
name = nM == 0 ? TString(
"MagnAbsorb") : Form(
"Magn%zu", nM);
102 LOG(
debug) <<
"Magnet " <<
name <<
": Zgap=" << Zgap <<
", dZ=" << dZ
103 << ", dX=" << dX << ", dY=" << dY << ", Z=" << Z;
104 if (dZ < 1e-5 || dX == 0) {
105 continue;
106 }
107 const auto i =
static_cast<Int_t
>(nM);
110 absorber_magnet |= nM == 0;
111 }
112
113
114 top->AddNode(tShield, 1);
115
118
119
120
125 TGeoShape* absorberShape = new TGeoBBox(
126 "absorber", (kTCC8RightX - kTCC8LeftX) / 2. - 0.002 *
m,
127 (kTCC8CeilingY - kTCC8FloorY) / 2., absorber_half_length - 0.002 *
m);
130
131 if (absorber_magnet) {
132
133 auto* absorber_shift =
134 new TGeoTranslation("absorber_shift", shift_x, shift_y, 0);
135 absorber_shift->RegisterYourself();
136 absorberShape = new TGeoCompositeShape(
137 "Absorber", "absorber:absorber_shift - MagnAbsorb");
138 shift_x = shift_y = 0;
139 }
140
141 TGeoVolume* absorber = new TGeoVolume("AbsorberVol", absorberShape, iron);
142 absorber->SetLineColor(42);
143 tShield->AddNode(
144 absorber, 1,
145 new TGeoTranslation(shift_x, shift_y,
147 absorber_offset));
148}
static constexpr size_t nParams
void CreateMagnet(const TString &magnetName, TGeoMedium *medium, TGeoVolume *tShield, Double_t dX, Double_t dY, Double_t dZ, Double_t Z, Bool_t withSNDHole)
const Double_t kTCC8RightX
const Double_t kTCC8LeftX
const Double_t kTCC8CeilingY
const Double_t kTCC8FloorY
Int_t InitMedium(const char *name)